summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-06-12 16:02:29 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-12 23:02:50 +0000
commite16c1bf9309391111c923b1e8a11b3cb122f15f3 (patch)
tree47a631289725b9989ead20749c6f54cc3d79eb0c
parent85931a65b94572f86dcb7f0fa39add9e528b4d90 (diff)
downloadchromium_src-e16c1bf9309391111c923b1e8a11b3cb122f15f3.zip
chromium_src-e16c1bf9309391111c923b1e8a11b3cb122f15f3.tar.gz
chromium_src-e16c1bf9309391111c923b1e8a11b3cb122f15f3.tar.bz2
cc: Stop using occlusion tracker on the main thread.
It was only used by TiledLayer, which we can't quite delete but we can just make it stop using occlusion. This will allow us to de-templatize the OcclusionTracker. R=enne, vmpstr BUG=413479 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1182233004 Cr-Commit-Position: refs/heads/master@{#334269}
-rw-r--r--cc/layers/content_layer.cc5
-rw-r--r--cc/layers/content_layer.h3
-rw-r--r--cc/layers/contents_scaling_layer.cc5
-rw-r--r--cc/layers/contents_scaling_layer.h3
-rw-r--r--cc/layers/delegated_renderer_layer.cc5
-rw-r--r--cc/layers/delegated_renderer_layer.h3
-rw-r--r--cc/layers/io_surface_layer.cc5
-rw-r--r--cc/layers/io_surface_layer.h3
-rw-r--r--cc/layers/layer.cc3
-rw-r--r--cc/layers/layer.h5
-rw-r--r--cc/layers/nine_patch_layer_unittest.cc6
-rw-r--r--cc/layers/painted_scrollbar_layer.cc5
-rw-r--r--cc/layers/painted_scrollbar_layer.h3
-rw-r--r--cc/layers/picture_layer.cc5
-rw-r--r--cc/layers/picture_layer.h4
-rw-r--r--cc/layers/picture_layer_unittest.cc4
-rw-r--r--cc/layers/scrollbar_layer_unittest.cc31
-rw-r--r--cc/layers/texture_layer.cc5
-rw-r--r--cc/layers/texture_layer.h3
-rw-r--r--cc/layers/tiled_layer.cc90
-rw-r--r--cc/layers/tiled_layer.h23
-rw-r--r--cc/layers/tiled_layer_unittest.cc385
-rw-r--r--cc/layers/ui_resource_layer_unittest.cc13
-rw-r--r--cc/layers/video_layer.cc5
-rw-r--r--cc/layers/video_layer.h3
-rw-r--r--cc/test/fake_painted_scrollbar_layer.cc6
-rw-r--r--cc/test/fake_painted_scrollbar_layer.h3
-rw-r--r--cc/test/fake_picture_layer.cc5
-rw-r--r--cc/test/fake_picture_layer.h3
-rw-r--r--cc/trees/layer_tree_host.cc20
-rw-r--r--cc/trees/layer_tree_host_unittest.cc10
31 files changed, 104 insertions, 568 deletions
diff --git a/cc/layers/content_layer.cc b/cc/layers/content_layer.cc
index 2955773..458137e 100644
--- a/cc/layers/content_layer.cc
+++ b/cc/layers/content_layer.cc
@@ -66,8 +66,7 @@ void ContentLayer::SetTexturePriorities(
TiledLayer::SetTexturePriorities(priority_calc);
}
-bool ContentLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
+bool ContentLayer::Update(ResourceUpdateQueue* queue) {
{
base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_,
true);
@@ -75,7 +74,7 @@ bool ContentLayer::Update(ResourceUpdateQueue* queue,
CreateUpdaterIfNeeded();
}
- bool updated = TiledLayer::Update(queue, occlusion);
+ bool updated = TiledLayer::Update(queue);
return updated;
}
diff --git a/cc/layers/content_layer.h b/cc/layers/content_layer.h
index f8b9f20..35f0538 100644
--- a/cc/layers/content_layer.h
+++ b/cc/layers/content_layer.h
@@ -41,8 +41,7 @@ class CC_EXPORT ContentLayer : public TiledLayer {
void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override;
void SetTexturePriorities(const PriorityCalculator& priority_calc) override;
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
bool NeedMoreUpdates() override;
void SetContentsOpaque(bool contents_opaque) override;
diff --git a/cc/layers/contents_scaling_layer.cc b/cc/layers/contents_scaling_layer.cc
index c50575b..10d5793 100644
--- a/cc/layers/contents_scaling_layer.cc
+++ b/cc/layers/contents_scaling_layer.cc
@@ -47,9 +47,8 @@ void ContentsScalingLayer::CalculateContentsScale(
}
}
-bool ContentsScalingLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
- bool updated = Layer::Update(queue, occlusion);
+bool ContentsScalingLayer::Update(ResourceUpdateQueue* queue) {
+ bool updated = Layer::Update(queue);
if (draw_properties().contents_scale_x == last_update_contents_scale_x_ &&
draw_properties().contents_scale_y == last_update_contents_scale_y_)
diff --git a/cc/layers/contents_scaling_layer.h b/cc/layers/contents_scaling_layer.h
index 1ac6863..6ad3f35 100644
--- a/cc/layers/contents_scaling_layer.h
+++ b/cc/layers/contents_scaling_layer.h
@@ -19,8 +19,7 @@ class CC_EXPORT ContentsScalingLayer : public Layer {
float* contents_scale_y,
gfx::Size* content_bounds) override;
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
protected:
explicit ContentsScalingLayer(const LayerSettings& settings);
diff --git a/cc/layers/delegated_renderer_layer.cc b/cc/layers/delegated_renderer_layer.cc
index 99f089f..cf2c787 100644
--- a/cc/layers/delegated_renderer_layer.cc
+++ b/cc/layers/delegated_renderer_layer.cc
@@ -83,9 +83,8 @@ void DelegatedRendererLayer::ProviderHasNewFrame() {
SetNextCommitWaitsForActivation();
}
-bool DelegatedRendererLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
- bool updated = Layer::Update(queue, occlusion);
+bool DelegatedRendererLayer::Update(ResourceUpdateQueue* queue) {
+ bool updated = Layer::Update(queue);
if (!should_collect_new_frame_)
return updated;
diff --git a/cc/layers/delegated_renderer_layer.h b/cc/layers/delegated_renderer_layer.h
index 14c2e34..4182289 100644
--- a/cc/layers/delegated_renderer_layer.h
+++ b/cc/layers/delegated_renderer_layer.h
@@ -24,8 +24,7 @@ class CC_EXPORT DelegatedRendererLayer : public Layer {
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
void SetLayerTreeHost(LayerTreeHost* host) override;
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
void PushPropertiesTo(LayerImpl* impl) override;
// Called by the DelegatedFrameProvider when a new frame is available to be
diff --git a/cc/layers/io_surface_layer.cc b/cc/layers/io_surface_layer.cc
index 0962a21..ffcb0e2 100644
--- a/cc/layers/io_surface_layer.cc
+++ b/cc/layers/io_surface_layer.cc
@@ -44,9 +44,8 @@ void IOSurfaceLayer::PushPropertiesTo(LayerImpl* layer) {
io_surface_layer->SetIOSurfaceProperties(io_surface_id_, io_surface_size_);
}
-bool IOSurfaceLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
- bool updated = Layer::Update(queue, occlusion);
+bool IOSurfaceLayer::Update(ResourceUpdateQueue* queue) {
+ bool updated = Layer::Update(queue);
// This layer doesn't update any resources from the main thread side,
// but repaint rects need to be sent to the layer impl via commit.
diff --git a/cc/layers/io_surface_layer.h b/cc/layers/io_surface_layer.h
index 9c5dd8f..56823f3 100644
--- a/cc/layers/io_surface_layer.h
+++ b/cc/layers/io_surface_layer.h
@@ -18,8 +18,7 @@ class CC_EXPORT IOSurfaceLayer : public Layer {
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
void PushPropertiesTo(LayerImpl* layer) override;
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
protected:
bool HasDrawableContent() const override;
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 706fc0a..406688f 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -1377,8 +1377,7 @@ void Layer::SavePaintProperties() {
layer_tree_host_->source_frame_number();
}
-bool Layer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
+bool Layer::Update(ResourceUpdateQueue* queue) {
DCHECK(layer_tree_host_);
DCHECK_EQ(layer_tree_host_->source_frame_number(),
paint_properties_.source_frame_number) <<
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 2ae79a0..e7e0f8a 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -69,8 +69,6 @@ class ResourceUpdateQueue;
class ScrollbarLayerInterface;
class SimpleEnclosedRegion;
struct AnimationEvent;
-template <typename LayerType>
-class OcclusionTracker;
// Base class for composited layers. Special layer types are derived from
// this class.
@@ -377,8 +375,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
// This methods typically need to be overwritten by derived classes.
virtual void SavePaintProperties();
// Returns true iff any resources were updated that need to be committed.
- virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion);
+ virtual bool Update(ResourceUpdateQueue* queue);
virtual bool NeedMoreUpdates();
virtual void SetIsMask(bool is_mask) {}
virtual void ReduceMemoryUsage() {}
diff --git a/cc/layers/nine_patch_layer_unittest.cc b/cc/layers/nine_patch_layer_unittest.cc
index b9fab76..b6be34d 100644
--- a/cc/layers/nine_patch_layer_unittest.cc
+++ b/cc/layers/nine_patch_layer_unittest.cc
@@ -15,7 +15,6 @@
#include "cc/test/geometry_test_utils.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/trees/layer_tree_host.h"
-#include "cc/trees/occlusion_tracker.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -59,9 +58,8 @@ TEST_F(NinePatchLayerTest, SetLayerProperties) {
ResourceUpdateQueue queue;
gfx::Rect screen_space_clip_rect;
- OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
test_layer->SavePaintProperties();
- test_layer->Update(&queue, &occlusion_tracker);
+ test_layer->Update(&queue);
EXPECT_FALSE(test_layer->DrawsContent());
@@ -73,7 +71,7 @@ TEST_F(NinePatchLayerTest, SetLayerProperties) {
test_layer->SetAperture(aperture);
test_layer->SetUIResourceId(resource->id());
test_layer->SetFillCenter(fill_center);
- test_layer->Update(&queue, &occlusion_tracker);
+ test_layer->Update(&queue);
EXPECT_TRUE(test_layer->DrawsContent());
}
diff --git a/cc/layers/painted_scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc
index 5ed8fc6..287d28f 100644
--- a/cc/layers/painted_scrollbar_layer.cc
+++ b/cc/layers/painted_scrollbar_layer.cc
@@ -231,12 +231,11 @@ void PaintedScrollbarLayer::UpdateInternalContentScale() {
}
}
-bool PaintedScrollbarLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
+bool PaintedScrollbarLayer::Update(ResourceUpdateQueue* queue) {
{
base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_,
true);
- Layer::Update(queue, occlusion);
+ Layer::Update(queue);
UpdateInternalContentScale();
}
diff --git a/cc/layers/painted_scrollbar_layer.h b/cc/layers/painted_scrollbar_layer.h
index dbc581e..2b5c263 100644
--- a/cc/layers/painted_scrollbar_layer.h
+++ b/cc/layers/painted_scrollbar_layer.h
@@ -37,8 +37,7 @@ class CC_EXPORT PaintedScrollbarLayer : public ScrollbarLayerInterface,
ScrollbarOrientation orientation() const override;
// Layer interface
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
void SetLayerTreeHost(LayerTreeHost* host) override;
void PushPropertiesTo(LayerImpl* layer) override;
void PushScrollClipPropertiesTo(LayerImpl* layer) override;
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index f55f4c4..f746836 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -115,10 +115,9 @@ void PictureLayer::SetNeedsDisplayRect(const gfx::Rect& layer_rect) {
Layer::SetNeedsDisplayRect(layer_rect);
}
-bool PictureLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
+bool PictureLayer::Update(ResourceUpdateQueue* queue) {
update_source_frame_number_ = layer_tree_host()->source_frame_number();
- bool updated = Layer::Update(queue, occlusion);
+ bool updated = Layer::Update(queue);
gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect(
visible_content_rect(), 1.f / contents_scale_x());
diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h
index c602ea5..8c7e2e8 100644
--- a/cc/layers/picture_layer.h
+++ b/cc/layers/picture_layer.h
@@ -9,7 +9,6 @@
#include "cc/debug/devtools_instrumentation.h"
#include "cc/debug/micro_benchmark_controller.h"
#include "cc/layers/layer.h"
-#include "cc/trees/occlusion_tracker.h"
namespace cc {
@@ -31,8 +30,7 @@ class CC_EXPORT PictureLayer : public Layer {
void SetLayerTreeHost(LayerTreeHost* host) override;
void PushPropertiesTo(LayerImpl* layer) override;
void SetNeedsDisplayRect(const gfx::Rect& layer_rect) override;
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
void SetIsMask(bool is_mask) override;
skia::RefPtr<SkPicture> GetPicture() const override;
bool IsSuitableForGpuRasterization() const override;
diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc
index 2b4da20..4e6946b 100644
--- a/cc/layers/picture_layer_unittest.cc
+++ b/cc/layers/picture_layer_unittest.cc
@@ -13,7 +13,6 @@
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_proxy.h"
#include "cc/test/impl_side_painting_settings.h"
-#include "cc/trees/occlusion_tracker.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -46,9 +45,8 @@ TEST(PictureLayerTest, NoTilesIfEmptyBounds) {
layer->SetIsDrawable(true);
layer->SavePaintProperties();
- OcclusionTracker<Layer> occlusion(gfx::Rect(0, 0, 1000, 1000));
scoped_ptr<ResourceUpdateQueue> queue(new ResourceUpdateQueue);
- layer->Update(queue.get(), &occlusion);
+ layer->Update(queue.get());
EXPECT_EQ(0, host->source_frame_number());
host->CommitComplete();
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index 74882a1..656e14d 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -736,12 +736,10 @@ class ScrollbarLayerTestResourceCreationAndRelease : public ScrollbarLayerTest {
EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get());
ResourceUpdateQueue queue;
- gfx::Rect screen_space_clip_rect;
- OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
scrollbar_layer->SavePaintProperties();
for (int update_counter = 0; update_counter < num_updates; update_counter++)
- scrollbar_layer->Update(&queue, &occlusion_tracker);
+ scrollbar_layer->Update(&queue);
// A non-solid-color scrollbar should have requested two textures.
EXPECT_EQ(expected_resources, layer_tree_host_->UIResourceCount());
@@ -805,16 +803,14 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get());
ResourceUpdateQueue queue;
- gfx::Rect screen_space_clip_rect;
size_t resource_count;
int expected_created, expected_deleted;
- OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
scrollbar_layer->SavePaintProperties();
resource_count = 2;
expected_created = 2;
expected_deleted = 0;
- EXPECT_TRUE(scrollbar_layer->Update(&queue, &occlusion_tracker));
+ EXPECT_TRUE(scrollbar_layer->Update(&queue));
EXPECT_NE(0, scrollbar_layer->track_resource_id());
EXPECT_NE(0, scrollbar_layer->thumb_resource_id());
EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount());
@@ -825,7 +821,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
expected_created = 2;
expected_deleted = 2;
scrollbar_layer->fake_scrollbar()->set_track_rect(gfx::Rect(0, 0, 0, 0));
- EXPECT_TRUE(scrollbar_layer->Update(&queue, &occlusion_tracker));
+ EXPECT_TRUE(scrollbar_layer->Update(&queue));
EXPECT_EQ(0, scrollbar_layer->track_resource_id());
EXPECT_EQ(0, scrollbar_layer->thumb_resource_id());
EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount());
@@ -836,7 +832,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
expected_created = 2;
expected_deleted = 2;
scrollbar_layer->fake_scrollbar()->set_track_rect(gfx::Rect(0, 0, 0, 0));
- EXPECT_FALSE(scrollbar_layer->Update(&queue, &occlusion_tracker));
+ EXPECT_FALSE(scrollbar_layer->Update(&queue));
EXPECT_EQ(0, scrollbar_layer->track_resource_id());
EXPECT_EQ(0, scrollbar_layer->thumb_resource_id());
EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount());
@@ -847,7 +843,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
expected_created = 4;
expected_deleted = 2;
scrollbar_layer->fake_scrollbar()->set_track_rect(gfx::Rect(30, 10, 50, 10));
- EXPECT_TRUE(scrollbar_layer->Update(&queue, &occlusion_tracker));
+ EXPECT_TRUE(scrollbar_layer->Update(&queue));
EXPECT_NE(0, scrollbar_layer->track_resource_id());
EXPECT_NE(0, scrollbar_layer->thumb_resource_id());
EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount());
@@ -858,7 +854,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
expected_created = 5;
expected_deleted = 4;
scrollbar_layer->fake_scrollbar()->set_has_thumb(false);
- EXPECT_TRUE(scrollbar_layer->Update(&queue, &occlusion_tracker));
+ EXPECT_TRUE(scrollbar_layer->Update(&queue));
EXPECT_NE(0, scrollbar_layer->track_resource_id());
EXPECT_EQ(0, scrollbar_layer->thumb_resource_id());
EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount());
@@ -869,7 +865,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
expected_created = 5;
expected_deleted = 5;
scrollbar_layer->fake_scrollbar()->set_track_rect(gfx::Rect(0, 0, 0, 0));
- EXPECT_TRUE(scrollbar_layer->Update(&queue, &occlusion_tracker));
+ EXPECT_TRUE(scrollbar_layer->Update(&queue));
EXPECT_EQ(0, scrollbar_layer->track_resource_id());
EXPECT_EQ(0, scrollbar_layer->thumb_resource_id());
EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount());
@@ -881,7 +877,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
expected_deleted = 5;
scrollbar_layer->fake_scrollbar()->set_track_rect(gfx::Rect(30, 10, 50, 10));
scrollbar_layer->fake_scrollbar()->set_has_thumb(true);
- EXPECT_TRUE(scrollbar_layer->Update(&queue, &occlusion_tracker));
+ EXPECT_TRUE(scrollbar_layer->Update(&queue));
EXPECT_NE(0, scrollbar_layer->track_resource_id());
EXPECT_NE(0, scrollbar_layer->thumb_resource_id());
@@ -891,7 +887,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
scrollbar_layer->fake_scrollbar()->set_track_rect(gfx::Rect(30, 10, 50, 10));
scrollbar_layer->fake_scrollbar()->set_has_thumb(false);
scrollbar_layer->SetBounds(gfx::Size(90, 15));
- EXPECT_TRUE(scrollbar_layer->Update(&queue, &occlusion_tracker));
+ EXPECT_TRUE(scrollbar_layer->Update(&queue));
EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount());
EXPECT_EQ(expected_created, layer_tree_host_->TotalUIResourceCreated());
EXPECT_EQ(expected_deleted, layer_tree_host_->TotalUIResourceDeleted());
@@ -900,7 +896,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
layer_tree_host_->ui_resource_size(scrollbar_layer->track_resource_id()));
scrollbar_layer->ResetNeedsDisplayForTesting();
- EXPECT_FALSE(scrollbar_layer->Update(&queue, &occlusion_tracker));
+ EXPECT_FALSE(scrollbar_layer->Update(&queue));
EXPECT_NE(0, scrollbar_layer->track_resource_id());
EXPECT_EQ(0, scrollbar_layer->thumb_resource_id());
EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount());
@@ -951,10 +947,8 @@ class ScaledScrollbarLayerTestResourceCreation : public ScrollbarLayerTest {
EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get());
ResourceUpdateQueue queue;
- gfx::Rect screen_space_clip_rect;
- OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
scrollbar_layer->SavePaintProperties();
- scrollbar_layer->Update(&queue, &occlusion_tracker);
+ scrollbar_layer->Update(&queue);
// Verify that we have not generated any content uploads that are larger
// than their destination textures.
@@ -1021,10 +1015,9 @@ class ScaledScrollbarLayerTestScaledRasterization : public ScrollbarLayerTest {
ResourceUpdateQueue queue;
gfx::Rect screen_space_clip_rect;
- OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
scrollbar_layer->SavePaintProperties();
- scrollbar_layer->Update(&queue, &occlusion_tracker);
+ scrollbar_layer->Update(&queue);
UIResourceBitmap* bitmap = layer_tree_host_->ui_resource_bitmap(
scrollbar_layer->track_resource_id());
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index 87c2c49..965b2f3 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -216,9 +216,8 @@ bool TextureLayer::HasDrawableContent() const {
return (client_ || holder_ref_) && Layer::HasDrawableContent();
}
-bool TextureLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
- bool updated = Layer::Update(queue, occlusion);
+bool TextureLayer::Update(ResourceUpdateQueue* queue) {
+ bool updated = Layer::Update(queue);
if (client_) {
TextureMailbox mailbox;
scoped_ptr<SingleReleaseCallback> release_callback;
diff --git a/cc/layers/texture_layer.h b/cc/layers/texture_layer.h
index c4b1efa..e9276b3 100644
--- a/cc/layers/texture_layer.h
+++ b/cc/layers/texture_layer.h
@@ -142,8 +142,7 @@ class CC_EXPORT TextureLayer : public Layer {
void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override;
void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override;
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
void PushPropertiesTo(LayerImpl* layer) override;
SimpleEnclosedRegion VisibleContentOpaqueRegion() const override;
diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc
index 972f5c8..7529ff2 100644
--- a/cc/layers/tiled_layer.cc
+++ b/cc/layers/tiled_layer.cc
@@ -17,7 +17,6 @@
#include "cc/resources/prioritized_resource.h"
#include "cc/resources/priority_calculator.h"
#include "cc/trees/layer_tree_host.h"
-#include "cc/trees/occlusion_tracker.h"
#include "ui/gfx/geometry/rect_conversions.h"
namespace cc {
@@ -52,7 +51,6 @@ class UpdatableTile : public LayerTilingData::Tile {
// pushed.
void ResetUpdateState() {
update_rect = gfx::Rect();
- occluded = false;
partial_update = false;
valid_for_frame = !is_dirty();
}
@@ -70,13 +68,11 @@ class UpdatableTile : public LayerTilingData::Tile {
gfx::Rect update_rect;
bool partial_update;
bool valid_for_frame;
- bool occluded;
private:
explicit UpdatableTile(scoped_ptr<LayerUpdater::Resource> updater_resource)
: partial_update(false),
valid_for_frame(false),
- occluded(false),
updater_resource_(updater_resource.Pass()) {}
scoped_ptr<LayerUpdater::Resource> updater_resource_;
@@ -227,9 +223,8 @@ void TiledLayer::PushPropertiesTo(LayerImpl* layer) {
++iter)
tiler_->TakeTile((*iter)->i(), (*iter)->j());
- // TiledLayer must push properties every frame, since viewport state and
- // occlusion from anywhere in the tree can change what the layer decides to
- // push to the impl tree.
+ // TiledLayer must push properties every frame, since viewport state can
+ // change what the layer decides to push to the impl tree.
needs_push_properties_ = true;
}
@@ -322,37 +317,27 @@ bool TiledLayer::UpdateTiles(int left,
int right,
int bottom,
ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion,
bool* updated) {
CreateUpdaterIfNeeded();
- bool ignore_occlusions = !occlusion;
- if (!HaveTexturesForTiles(left, top, right, bottom, ignore_occlusions)) {
+ if (!HaveTexturesForTiles(left, top, right, bottom)) {
failed_update_ = true;
return false;
}
gfx::Rect update_rect;
gfx::Rect paint_rect;
- MarkTilesForUpdate(
- &update_rect, &paint_rect, left, top, right, bottom, ignore_occlusions);
+ MarkTilesForUpdate(&update_rect, &paint_rect, left, top, right, bottom);
if (paint_rect.IsEmpty())
return true;
*updated = true;
- UpdateTileTextures(
- update_rect, paint_rect, left, top, right, bottom, queue, occlusion);
+ UpdateTileTextures(update_rect, paint_rect, left, top, right, bottom, queue);
return true;
}
-void TiledLayer::MarkOcclusionsAndRequestTextures(
- int left,
- int top,
- int right,
- int bottom,
- const OcclusionTracker<Layer>* occlusion) {
- int occluded_tile_count = 0;
+void TiledLayer::RequestTextures(int left, int top, int right, int bottom) {
bool succeeded = true;
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
@@ -361,19 +346,9 @@ void TiledLayer::MarkOcclusionsAndRequestTextures(
// TODO(enne): This should not ever be null.
if (!tile)
continue;
- // Did ResetUpdateState get skipped? Are we doing more than one occlusion
- // pass?
- DCHECK(!tile->occluded);
gfx::Rect visible_tile_rect = gfx::IntersectRects(
tiler_->tile_bounds(i, j), visible_content_rect());
- if (!draw_transform_is_animating() && occlusion &&
- occlusion->GetCurrentOcclusionForLayer(draw_transform())
- .IsOccluded(visible_tile_rect)) {
- tile->occluded = true;
- occluded_tile_count++;
- } else {
- succeeded &= tile->managed_resource()->RequestLate();
- }
+ succeeded &= tile->managed_resource()->RequestLate();
}
}
}
@@ -381,8 +356,7 @@ void TiledLayer::MarkOcclusionsAndRequestTextures(
bool TiledLayer::HaveTexturesForTiles(int left,
int top,
int right,
- int bottom,
- bool ignore_occlusions) {
+ int bottom) {
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
UpdatableTile* tile = TileAt(i, j);
@@ -395,11 +369,6 @@ bool TiledLayer::HaveTexturesForTiles(int left,
if (!tile->managed_resource()->have_backing_texture())
tile->dirty_rect = tiler_->TileRect(tile);
- // If using occlusion and the visible region of the tile is occluded,
- // don't reserve a texture or update the tile.
- if (tile->occluded && !ignore_occlusions)
- continue;
-
if (!tile->managed_resource()->can_acquire_backing_texture())
return false;
}
@@ -412,8 +381,7 @@ void TiledLayer::MarkTilesForUpdate(gfx::Rect* update_rect,
int left,
int top,
int right,
- int bottom,
- bool ignore_occlusions) {
+ int bottom) {
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
UpdatableTile* tile = TileAt(i, j);
@@ -421,8 +389,6 @@ void TiledLayer::MarkTilesForUpdate(gfx::Rect* update_rect,
// TODO(enne): This should not ever be null.
if (!tile)
continue;
- if (tile->occluded && !ignore_occlusions)
- continue;
// Prepare update rect from original dirty rects.
update_rect->Union(tile->dirty_rect);
@@ -457,8 +423,7 @@ void TiledLayer::UpdateTileTextures(const gfx::Rect& update_rect,
int top,
int right,
int bottom,
- ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
+ ResourceUpdateQueue* queue) {
// The update_rect should be in layer space. So we have to convert the
// paint_rect from content space to layer space.
float width_scale = 1 / draw_properties().contents_scale_x;
@@ -681,8 +646,7 @@ void TiledLayer::UpdateScrollPrediction() {
previous_visible_rect_ = visible_content_rect();
}
-bool TiledLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
+bool TiledLayer::Update(ResourceUpdateQueue* queue) {
DCHECK(!skips_draw_ && !failed_update_); // Did ResetUpdateState get skipped?
// Tiled layer always causes commits to wait for activation, as it does
@@ -695,7 +659,7 @@ bool TiledLayer::Update(ResourceUpdateQueue* queue,
base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_,
true);
- updated |= ContentsScalingLayer::Update(queue, occlusion);
+ updated |= ContentsScalingLayer::Update(queue);
UpdateBounds();
}
@@ -703,8 +667,7 @@ bool TiledLayer::Update(ResourceUpdateQueue* queue,
return false;
// Animation pre-paint. If the layer is small, try to paint it all
- // immediately whether or not it is occluded, to avoid paint/upload
- // hiccups while it is animating.
+ // immediately to avoid paint/upload hiccups while it is animating.
if (IsSmallAnimatedLayer()) {
int left, top, right, bottom;
tiler_->ContentRectToTileIndices(gfx::Rect(content_bounds()),
@@ -712,7 +675,7 @@ bool TiledLayer::Update(ResourceUpdateQueue* queue,
&top,
&right,
&bottom);
- UpdateTiles(left, top, right, bottom, queue, nullptr, &updated);
+ UpdateTiles(left, top, right, bottom, queue, &updated);
if (updated)
return updated;
// This was an attempt to paint the entire layer so if we fail it's okay,
@@ -723,14 +686,12 @@ bool TiledLayer::Update(ResourceUpdateQueue* queue,
if (predicted_visible_rect_.IsEmpty())
return updated;
- // Visible painting. First occlude visible tiles and paint the non-occluded
- // tiles.
+ // Visible painting.
int left, top, right, bottom;
tiler_->ContentRectToTileIndices(
predicted_visible_rect_, &left, &top, &right, &bottom);
- MarkOcclusionsAndRequestTextures(left, top, right, bottom, occlusion);
- skips_draw_ = !UpdateTiles(
- left, top, right, bottom, queue, occlusion, &updated);
+ RequestTextures(left, top, right, bottom);
+ skips_draw_ = !UpdateTiles(left, top, right, bottom, queue, &updated);
if (skips_draw_)
tiler_->reset();
if (skips_draw_ || updated)
@@ -742,11 +703,6 @@ bool TiledLayer::Update(ResourceUpdateQueue* queue,
if (idle_paint_content_rect.IsEmpty())
return updated;
- // Prepaint anything that was occluded but inside the layer's visible region.
- if (!UpdateTiles(left, top, right, bottom, queue, nullptr, &updated) ||
- updated)
- return updated;
-
int prepaint_left, prepaint_top, prepaint_right, prepaint_bottom;
tiler_->ContentRectToTileIndices(idle_paint_content_rect,
&prepaint_left,
@@ -772,8 +728,7 @@ bool TiledLayer::Update(ResourceUpdateQueue* queue,
if (deltas[i].y() > 0) {
while (bottom < prepaint_bottom) {
++bottom;
- if (!UpdateTiles(
- left, bottom, right, bottom, queue, nullptr, &updated) ||
+ if (!UpdateTiles(left, bottom, right, bottom, queue, &updated) ||
updated)
return updated;
}
@@ -781,24 +736,21 @@ bool TiledLayer::Update(ResourceUpdateQueue* queue,
if (deltas[i].y() < 0) {
while (top > prepaint_top) {
--top;
- if (!UpdateTiles(left, top, right, top, queue, nullptr, &updated) ||
- updated)
+ if (!UpdateTiles(left, top, right, top, queue, &updated) || updated)
return updated;
}
}
if (deltas[i].x() < 0) {
while (left > prepaint_left) {
--left;
- if (!UpdateTiles(left, top, left, bottom, queue, nullptr, &updated) ||
- updated)
+ if (!UpdateTiles(left, top, left, bottom, queue, &updated) || updated)
return updated;
}
}
if (deltas[i].x() > 0) {
while (right < prepaint_right) {
++right;
- if (!UpdateTiles(right, top, right, bottom, queue, nullptr, &updated) ||
- updated)
+ if (!UpdateTiles(right, top, right, bottom, queue, &updated) || updated)
return updated;
}
}
diff --git a/cc/layers/tiled_layer.h b/cc/layers/tiled_layer.h
index c701e07..4fe0902 100644
--- a/cc/layers/tiled_layer.h
+++ b/cc/layers/tiled_layer.h
@@ -32,8 +32,7 @@ class CC_EXPORT TiledLayer : public ContentsScalingLayer {
void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override;
void SetTexturePriorities(const PriorityCalculator& priority_calc) override;
SimpleEnclosedRegion VisibleContentOpaqueRegion() const override;
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
void OnOutputSurfaceCreated() override;
protected:
@@ -84,40 +83,28 @@ class CC_EXPORT TiledLayer : public ContentsScalingLayer {
bool TileOnlyNeedsPartialUpdate(UpdatableTile* tile);
bool TileNeedsBufferedUpdate(UpdatableTile* tile);
- void MarkOcclusionsAndRequestTextures(
- int left,
- int top,
- int right,
- int bottom,
- const OcclusionTracker<Layer>* occlusion);
+ void RequestTextures(int left, int top, int right, int bottom);
bool UpdateTiles(int left,
int top,
int right,
int bottom,
ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion,
bool* did_paint);
- bool HaveTexturesForTiles(int left,
- int top,
- int right,
- int bottom,
- bool ignore_occlusions);
+ bool HaveTexturesForTiles(int left, int top, int right, int bottom);
void MarkTilesForUpdate(gfx::Rect* update_rect,
gfx::Rect* paint_rect,
int left,
int top,
int right,
- int bottom,
- bool ignore_occlusions);
+ int bottom);
void UpdateTileTextures(const gfx::Rect& update_rect,
const gfx::Rect& paint_rect,
int left,
int top,
int right,
int bottom,
- ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion);
+ ResourceUpdateQueue* queue);
void UpdateScrollPrediction();
UpdatableTile* TileAt(int i, int j) const;
diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc
index 525a22e..cce9812 100644
--- a/cc/layers/tiled_layer_unittest.cc
+++ b/cc/layers/tiled_layer_unittest.cc
@@ -25,7 +25,6 @@
#include "cc/test/geometry_test_utils.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/tiled_layer_test_common.h"
-#include "cc/trees/occlusion_tracker.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect_conversions.h"
@@ -34,21 +33,6 @@
namespace cc {
namespace {
-class TestOcclusionTracker : public OcclusionTracker<Layer> {
- public:
- TestOcclusionTracker() : OcclusionTracker(gfx::Rect(0, 0, 1000, 1000)) {
- stack_.push_back(StackObject());
- }
-
- void SetRenderTarget(Layer* render_target) {
- stack_.back().target = render_target;
- }
-
- void SetOcclusion(const SimpleEnclosedRegion& occlusion) {
- stack_.back().occlusion_from_inside_target = occlusion;
- }
-};
-
class SynchronousOutputSurfaceClient : public FakeLayerTreeHostClient {
public:
SynchronousOutputSurfaceClient()
@@ -84,8 +68,7 @@ class TiledLayerTest : public testing::Test {
: proxy_(nullptr),
output_surface_(FakeOutputSurface::Create3d()),
queue_(make_scoped_ptr(new ResourceUpdateQueue)),
- impl_thread_("ImplThread"),
- occlusion_(nullptr) {
+ impl_thread_("ImplThread") {
settings_.max_partial_texture_updates = std::numeric_limits<size_t>::max();
settings_.layer_transforms_should_scale_layer_contents = true;
settings_.impl_side_painting = false;
@@ -164,15 +147,12 @@ class TiledLayerTest : public testing::Test {
layer->ResetNumDependentsNeedPushProperties();
}
- void LayerUpdate(FakeTiledLayer* layer, TestOcclusionTracker* occluded) {
+ void LayerUpdate(FakeTiledLayer* layer) {
DebugScopedSetMainThread main_thread(proxy_);
- layer->Update(queue_.get(), occluded);
+ layer->Update(queue_.get());
}
void CalcDrawProps(RenderSurfaceLayerList* render_surface_layer_list) {
- if (occlusion_)
- occlusion_->SetRenderTarget(layer_tree_host_->root_layer());
-
LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs(
layer_tree_host_->root_layer(),
layer_tree_host_->device_viewport_size(),
@@ -212,9 +192,9 @@ class TiledLayerTest : public testing::Test {
// Update content
if (layer1.get())
- layer1->Update(queue_.get(), occlusion_);
+ layer1->Update(queue_.get());
if (layer2.get())
- layer2->Update(queue_.get(), occlusion_);
+ layer2->Update(queue_.get());
bool needs_update = false;
if (layer1.get())
@@ -247,7 +227,6 @@ class TiledLayerTest : public testing::Test {
scoped_ptr<LayerTreeHost> layer_tree_host_;
scoped_ptr<FakeLayerTreeHostImpl> host_impl_;
scoped_ptr<PrioritizedResourceManager> resource_manager_;
- TestOcclusionTracker* occlusion_;
};
TEST_F(TiledLayerTest, PushDirtyTiles) {
@@ -304,47 +283,6 @@ TEST_F(TiledLayerTest, Scale) {
EXPECT_EQ(1.5, layer->fake_layer_updater()->last_contents_width_scale());
}
-TEST_F(TiledLayerTest, PushOccludedDirtyTiles) {
- scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(
- new FakeTiledLayer(layer_settings_, resource_manager_.get()));
- scoped_ptr<FakeTiledLayerImpl> layer_impl =
- make_scoped_ptr(new FakeTiledLayerImpl(host_impl_->active_tree(), 1));
- TestOcclusionTracker occluded;
- occlusion_ = &occluded;
- layer_tree_host_->SetViewportSize(gfx::Size(1000, 1000));
-
- layer_tree_host_->root_layer()->AddChild(layer);
-
- {
- RenderSurfaceLayerList render_surface_layer_list;
-
- // The tile size is 100x100, so this invalidates and then paints two tiles.
- layer->SetBounds(gfx::Size(100, 200));
- CalcDrawProps(&render_surface_layer_list);
- UpdateAndPush(layer, layer_impl);
-
- // We should have both tiles on the impl side.
- EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0));
- EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 1));
- }
-
- {
- RenderSurfaceLayerList render_surface_layer_list;
-
- // Invalidates part of the top tile...
- layer->InvalidateContentRect(gfx::Rect(0, 0, 50, 50));
- // ....but the area is occluded.
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(0, 0, 50, 50)));
- CalcDrawProps(&render_surface_layer_list);
- UpdateAndPush(layer, layer_impl);
-
- // We should still have both tiles, as part of the top tile is still
- // unoccluded.
- EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0));
- EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 1));
- }
-}
-
TEST_F(TiledLayerTest, PushDeletedTiles) {
layer_tree_host_->SetViewportSize(gfx::Size(1000, 1000));
@@ -566,29 +504,6 @@ TEST_F(TiledLayerTest, PushTilesAfterIdlePaintFailed) {
EXPECT_FALSE(layer_impl2->HasResourceIdForTileAt(0, 2));
}
-TEST_F(TiledLayerTest, PushIdlePaintedOccludedTiles) {
- scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(
- new FakeTiledLayer(layer_settings_, resource_manager_.get()));
- scoped_ptr<FakeTiledLayerImpl> layer_impl =
- make_scoped_ptr(new FakeTiledLayerImpl(host_impl_->active_tree(), 1));
- RenderSurfaceLayerList render_surface_layer_list;
- TestOcclusionTracker occluded;
- occlusion_ = &occluded;
-
- layer_tree_host_->root_layer()->AddChild(layer);
-
- // The tile size is 100x100, so this invalidates one occluded tile, culls it
- // during paint, but prepaints it.
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(0, 0, 100, 100)));
-
- layer->SetBounds(gfx::Size(100, 100));
- CalcDrawProps(&render_surface_layer_list);
- layer->draw_properties().visible_content_rect = gfx::Rect(0, 0, 100, 100);
- UpdateAndPush(layer, layer_impl);
-
- EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0));
-}
-
TEST_F(TiledLayerTest, PushTilesMarkedDirtyDuringPaint) {
scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(
new FakeTiledLayer(layer_settings_, resource_manager_.get()));
@@ -717,7 +632,7 @@ TEST_F(TiledLayerTest, PaintSmallAnimatedLayersImmediately) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
UpdateTextures();
LayerPushPropertiesTo(layer.get(), layer_impl.get());
@@ -906,7 +821,7 @@ TEST_F(TiledLayerTest, VerifyUpdateRectWhenContentBoundsAreScaled) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
// Update rect is 200x300 (tile size of 100x100). Scaled this gives 400x240.
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 400, 240), layer->update_rect());
@@ -918,7 +833,7 @@ TEST_F(TiledLayerTest, VerifyUpdateRectWhenContentBoundsAreScaled) {
resource_manager_->PrioritizeTextures();
layer->InvalidateContentRect(content_bounds);
layer->SavePaintProperties();
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(layer_bounds), layer->update_rect());
UpdateTextures();
@@ -929,7 +844,7 @@ TEST_F(TiledLayerTest, VerifyUpdateRectWhenContentBoundsAreScaled) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
EXPECT_FLOAT_RECT_EQ(gfx::RectF(60, 80, 20, 8), layer->update_rect());
}
@@ -946,7 +861,7 @@ TEST_F(TiledLayerTest, VerifyInvalidationWhenContentsScaleChanges) {
layer->SetBounds(gfx::Size(100, 100));
CalcDrawProps(&render_surface_layer_list);
layer->draw_properties().visible_content_rect = gfx::Rect(0, 0, 100, 100);
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
UpdateTextures();
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 100, 100),
layer->last_needs_display_rect());
@@ -955,7 +870,7 @@ TEST_F(TiledLayerTest, VerifyInvalidationWhenContentsScaleChanges) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
UpdateTextures();
LayerPushPropertiesTo(layer.get(), layer_impl.get());
EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0));
@@ -974,7 +889,7 @@ TEST_F(TiledLayerTest, VerifyInvalidationWhenContentsScaleChanges) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
UpdateTextures();
LayerPushPropertiesTo(layer.get(), layer_impl.get());
EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0));
@@ -1062,7 +977,7 @@ TEST_F(TiledLayerTest, ResizeToSmaller) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
layer->SetBounds(gfx::Size(200, 200));
layer->InvalidateContentRect(gfx::Rect(0, 0, 200, 200));
@@ -1083,7 +998,7 @@ TEST_F(TiledLayerTest, HugeLayerUpdateCrash) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
}
class TiledLayerPartialUpdateTest : public TiledLayerTest {
@@ -1215,272 +1130,10 @@ TEST_F(TiledLayerTest, TilesPaintedWithoutOcclusion) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->SavePaintProperties();
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
EXPECT_EQ(2, layer->fake_layer_updater()->update_count());
}
-TEST_F(TiledLayerTest, TilesPaintedWithOcclusion) {
- scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(
- new FakeTiledLayer(layer_settings_, resource_manager_.get()));
- RenderSurfaceLayerList render_surface_layer_list;
- TestOcclusionTracker occluded;
- occlusion_ = &occluded;
-
- layer_tree_host_->root_layer()->AddChild(layer);
-
- // The tile size is 100x100.
-
- layer_tree_host_->SetViewportSize(gfx::Size(600, 600));
- layer->SetBounds(gfx::Size(600, 600));
- CalcDrawProps(&render_surface_layer_list);
-
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(200, 200, 300, 100)));
- layer->draw_properties().drawable_content_rect =
- gfx::Rect(layer->content_bounds());
- layer->draw_properties().visible_content_rect =
- gfx::Rect(layer->content_bounds());
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
-
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count());
-
- layer->fake_layer_updater()->ClearUpdateCount();
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
-
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(250, 200, 300, 100)));
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- EXPECT_EQ(36 - 2, layer->fake_layer_updater()->update_count());
-
- layer->fake_layer_updater()->ClearUpdateCount();
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
-
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(250, 250, 300, 100)));
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- EXPECT_EQ(36, layer->fake_layer_updater()->update_count());
-}
-
-TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndVisiblityConstraints) {
- scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(
- new FakeTiledLayer(layer_settings_, resource_manager_.get()));
- RenderSurfaceLayerList render_surface_layer_list;
- TestOcclusionTracker occluded;
- occlusion_ = &occluded;
-
- layer_tree_host_->root_layer()->AddChild(layer);
-
- // The tile size is 100x100.
-
- layer_tree_host_->SetViewportSize(gfx::Size(600, 600));
- layer->SetBounds(gfx::Size(600, 600));
- CalcDrawProps(&render_surface_layer_list);
-
- // The partially occluded tiles (by the 150 occlusion height) are visible
- // beyond the occlusion, so not culled.
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(200, 200, 300, 150)));
- layer->draw_properties().drawable_content_rect = gfx::Rect(0, 0, 600, 360);
- layer->draw_properties().visible_content_rect = gfx::Rect(0, 0, 600, 360);
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
-
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- EXPECT_EQ(24 - 3, layer->fake_layer_updater()->update_count());
-
- layer->fake_layer_updater()->ClearUpdateCount();
-
- // Now the visible region stops at the edge of the occlusion so the partly
- // visible tiles become fully occluded.
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(200, 200, 300, 150)));
- layer->draw_properties().drawable_content_rect = gfx::Rect(0, 0, 600, 350);
- layer->draw_properties().visible_content_rect = gfx::Rect(0, 0, 600, 350);
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- EXPECT_EQ(24 - 6, layer->fake_layer_updater()->update_count());
-
- layer->fake_layer_updater()->ClearUpdateCount();
-
- // Now the visible region is even smaller than the occlusion, it should have
- // the same result.
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(200, 200, 300, 150)));
- layer->draw_properties().drawable_content_rect = gfx::Rect(0, 0, 600, 340);
- layer->draw_properties().visible_content_rect = gfx::Rect(0, 0, 600, 340);
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- EXPECT_EQ(24 - 6, layer->fake_layer_updater()->update_count());
-}
-
-TEST_F(TiledLayerTest, TilesNotPaintedWithoutInvalidation) {
- scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(
- new FakeTiledLayer(layer_settings_, resource_manager_.get()));
- RenderSurfaceLayerList render_surface_layer_list;
- TestOcclusionTracker occluded;
- occlusion_ = &occluded;
-
- layer_tree_host_->root_layer()->AddChild(layer);
-
- // The tile size is 100x100.
-
- layer_tree_host_->SetViewportSize(gfx::Size(600, 600));
- layer->SetBounds(gfx::Size(600, 600));
- CalcDrawProps(&render_surface_layer_list);
-
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(200, 200, 300, 100)));
- layer->draw_properties().drawable_content_rect = gfx::Rect(0, 0, 600, 600);
- layer->draw_properties().visible_content_rect = gfx::Rect(0, 0, 600, 600);
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count());
- UpdateTextures();
-
- layer->fake_layer_updater()->ClearUpdateCount();
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
- layer->SavePaintProperties();
-
- // Repaint without marking it dirty. The 3 culled tiles will be pre-painted
- // now.
- layer->Update(queue_.get(), &occluded);
- EXPECT_EQ(3, layer->fake_layer_updater()->update_count());
-}
-
-TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndTransforms) {
- scoped_refptr<FakeTiledLayer> layer = make_scoped_refptr(
- new FakeTiledLayer(layer_settings_, resource_manager_.get()));
- RenderSurfaceLayerList render_surface_layer_list;
- TestOcclusionTracker occluded;
- occlusion_ = &occluded;
-
- layer_tree_host_->root_layer()->AddChild(layer);
-
- // The tile size is 100x100.
-
- // This makes sure the painting works when the occluded region (in screen
- // space) is transformed differently than the layer.
- layer_tree_host_->SetViewportSize(gfx::Size(600, 600));
- layer->SetBounds(gfx::Size(600, 600));
- CalcDrawProps(&render_surface_layer_list);
- gfx::Transform screen_transform;
- screen_transform.Scale(0.5, 0.5);
- layer->draw_properties().screen_space_transform = screen_transform;
- layer->draw_properties().target_space_transform = screen_transform;
-
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(100, 100, 150, 50)));
- layer->draw_properties().drawable_content_rect =
- gfx::Rect(layer->content_bounds());
- layer->draw_properties().visible_content_rect =
- gfx::Rect(layer->content_bounds());
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count());
-}
-
-TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndScaling) {
- scoped_refptr<FakeTiledLayer> layer =
- new FakeTiledLayer(layer_settings_, resource_manager_.get());
- RenderSurfaceLayerList render_surface_layer_list;
- TestOcclusionTracker occluded;
- occlusion_ = &occluded;
-
- scoped_refptr<FakeTiledLayer> scale_layer =
- new FakeTiledLayer(layer_settings_, resource_manager_.get());
- gfx::Transform scale_transform;
- scale_transform.Scale(2.0, 2.0);
- scale_layer->SetTransform(scale_transform);
-
- layer_tree_host_->root_layer()->AddChild(scale_layer);
-
- // The tile size is 100x100.
-
- // This makes sure the painting works when the content space is scaled to
- // a different layer space.
- layer_tree_host_->SetViewportSize(gfx::Size(600, 600));
- layer->SetBounds(gfx::Size(300, 300));
- scale_layer->AddChild(layer);
- CalcDrawProps(&render_surface_layer_list);
- EXPECT_FLOAT_EQ(2.f, layer->contents_scale_x());
- EXPECT_FLOAT_EQ(2.f, layer->contents_scale_y());
- EXPECT_EQ(gfx::Size(600, 600).ToString(),
- layer->content_bounds().ToString());
-
- // No tiles are covered by the 300x50 occlusion.
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(200, 200, 300, 50)));
- layer->draw_properties().drawable_content_rect =
- gfx::Rect(layer->bounds());
- layer->draw_properties().visible_content_rect =
- gfx::Rect(layer->content_bounds());
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- int visible_tiles1 = 6 * 6;
- EXPECT_EQ(visible_tiles1, layer->fake_layer_updater()->update_count());
-
- layer->fake_layer_updater()->ClearUpdateCount();
-
- // The occlusion of 300x100 will be cover 3 tiles as tiles are 100x100 still.
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(200, 200, 300, 100)));
- layer->draw_properties().drawable_content_rect =
- gfx::Rect(layer->bounds());
- layer->draw_properties().visible_content_rect =
- gfx::Rect(layer->content_bounds());
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- int visible_tiles2 = 6 * 6 - 3;
- EXPECT_EQ(visible_tiles2, layer->fake_layer_updater()->update_count());
-
- layer->fake_layer_updater()->ClearUpdateCount();
-
- // This makes sure content scaling and transforms work together.
- // When the tiles are scaled down by half, they are 50x50 each in the
- // screen.
- gfx::Transform screen_transform;
- screen_transform.Scale(0.5, 0.5);
- layer->draw_properties().screen_space_transform = screen_transform;
- layer->draw_properties().target_space_transform = screen_transform;
-
- // An occlusion of 150x100 will cover 3*2 = 6 tiles.
- occluded.SetOcclusion(SimpleEnclosedRegion(gfx::Rect(100, 100, 150, 100)));
-
- gfx::Rect layer_bounds_rect(layer->bounds());
- layer->draw_properties().drawable_content_rect =
- gfx::ScaleToEnclosingRect(layer_bounds_rect, 0.5f);
- layer->draw_properties().visible_content_rect =
- gfx::Rect(layer->content_bounds());
- layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->SetTexturePriorities(priority_calculator_);
- resource_manager_->PrioritizeTextures();
- layer->SavePaintProperties();
- layer->Update(queue_.get(), &occluded);
- int visible_tiles3 = 6 * 6 - 6;
- EXPECT_EQ(visible_tiles3, layer->fake_layer_updater()->update_count());
-}
-
TEST_F(TiledLayerTest, DontAllocateContentsWhenTargetSurfaceCantBeAllocated) {
// Tile size is 100x100.
gfx::Rect root_rect(0, 0, 300, 200);
@@ -1702,7 +1355,7 @@ TEST_F(TiledLayerTest, NonIntegerContentsScaleIsNotDistortedDuringPaint) {
layer->SavePaintProperties();
// Update the whole tile.
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
layer->tracking_layer_painter()->ResetPaintedRect();
EXPECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect());
@@ -1711,7 +1364,7 @@ TEST_F(TiledLayerTest, NonIntegerContentsScaleIsNotDistortedDuringPaint) {
// Invalidate the entire layer in content space. When painting, the rect given
// to webkit should match the layer's bounds.
layer->InvalidateContentRect(content_rect);
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
// Rounding leads to an extra pixel.
gfx::Rect expanded_layer_rect(layer_rect);
@@ -1741,7 +1394,7 @@ TEST_F(TiledLayerTest,
layer->SavePaintProperties();
// Update the whole tile.
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
layer->tracking_layer_painter()->ResetPaintedRect();
EXPECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect());
@@ -1750,7 +1403,7 @@ TEST_F(TiledLayerTest,
// Invalidate the entire layer in layer space. When painting, the rect given
// to webkit should match the layer's bounds.
layer->SetNeedsDisplayRect(layer_rect);
- layer->Update(queue_.get(), nullptr);
+ layer->Update(queue_.get());
// Rounding leads to an extra pixel.
gfx::Rect expanded_layer_rect(layer_rect);
diff --git a/cc/layers/ui_resource_layer_unittest.cc b/cc/layers/ui_resource_layer_unittest.cc
index 97d855b..512c677 100644
--- a/cc/layers/ui_resource_layer_unittest.cc
+++ b/cc/layers/ui_resource_layer_unittest.cc
@@ -15,7 +15,6 @@
#include "cc/test/fake_output_surface_client.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/trees/layer_tree_host.h"
-#include "cc/trees/occlusion_tracker.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -81,10 +80,8 @@ TEST_F(UIResourceLayerTest, SetBitmap) {
EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get());
ResourceUpdateQueue queue;
- gfx::Rect screen_space_clip_rect;
- OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
test_layer->SavePaintProperties();
- test_layer->Update(&queue, &occlusion_tracker);
+ test_layer->Update(&queue);
EXPECT_FALSE(test_layer->DrawsContent());
@@ -93,7 +90,7 @@ TEST_F(UIResourceLayerTest, SetBitmap) {
bitmap.setImmutable();
test_layer->SetBitmap(bitmap);
- test_layer->Update(&queue, &occlusion_tracker);
+ test_layer->Update(&queue);
EXPECT_TRUE(test_layer->DrawsContent());
}
@@ -109,10 +106,8 @@ TEST_F(UIResourceLayerTest, SetUIResourceId) {
EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get());
ResourceUpdateQueue queue;
- gfx::Rect screen_space_clip_rect;
- OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect);
test_layer->SavePaintProperties();
- test_layer->Update(&queue, &occlusion_tracker);
+ test_layer->Update(&queue);
EXPECT_FALSE(test_layer->DrawsContent());
@@ -120,7 +115,7 @@ TEST_F(UIResourceLayerTest, SetUIResourceId) {
scoped_ptr<ScopedUIResource> resource = ScopedUIResource::Create(
layer_tree_host_.get(), UIResourceBitmap(gfx::Size(10, 10), is_opaque));
test_layer->SetUIResourceId(resource->id());
- test_layer->Update(&queue, &occlusion_tracker);
+ test_layer->Update(&queue);
EXPECT_TRUE(test_layer->DrawsContent());
diff --git a/cc/layers/video_layer.cc b/cc/layers/video_layer.cc
index 24e5524..8e0f17f 100644
--- a/cc/layers/video_layer.cc
+++ b/cc/layers/video_layer.cc
@@ -30,9 +30,8 @@ scoped_ptr<LayerImpl> VideoLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
return impl.Pass();
}
-bool VideoLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
- bool updated = Layer::Update(queue, occlusion);
+bool VideoLayer::Update(ResourceUpdateQueue* queue) {
+ bool updated = Layer::Update(queue);
// Video layer doesn't update any resources from the main thread side,
// but repaint rects need to be sent to the VideoLayerImpl via commit.
diff --git a/cc/layers/video_layer.h b/cc/layers/video_layer.h
index 298cd2c..f8e257e 100644
--- a/cc/layers/video_layer.h
+++ b/cc/layers/video_layer.h
@@ -26,8 +26,7 @@ class CC_EXPORT VideoLayer : public Layer {
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
private:
VideoLayer(const LayerSettings& settings,
diff --git a/cc/test/fake_painted_scrollbar_layer.cc b/cc/test/fake_painted_scrollbar_layer.cc
index 4d0f6cc..9811c5f 100644
--- a/cc/test/fake_painted_scrollbar_layer.cc
+++ b/cc/test/fake_painted_scrollbar_layer.cc
@@ -37,10 +37,8 @@ FakePaintedScrollbarLayer::FakePaintedScrollbarLayer(
FakePaintedScrollbarLayer::~FakePaintedScrollbarLayer() {}
-bool FakePaintedScrollbarLayer::Update(
- ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
- bool updated = PaintedScrollbarLayer::Update(queue, occlusion);
+bool FakePaintedScrollbarLayer::Update(ResourceUpdateQueue* queue) {
+ bool updated = PaintedScrollbarLayer::Update(queue);
++update_count_;
return updated;
}
diff --git a/cc/test/fake_painted_scrollbar_layer.h b/cc/test/fake_painted_scrollbar_layer.h
index 0f3b991..05d9165 100644
--- a/cc/test/fake_painted_scrollbar_layer.h
+++ b/cc/test/fake_painted_scrollbar_layer.h
@@ -23,8 +23,7 @@ class FakePaintedScrollbarLayer : public PaintedScrollbarLayer {
int update_count() const { return update_count_; }
void reset_update_count() { update_count_ = 0; }
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
void PushPropertiesTo(LayerImpl* layer) override;
diff --git a/cc/test/fake_picture_layer.cc b/cc/test/fake_picture_layer.cc
index 0b7707c..c3b5908 100644
--- a/cc/test/fake_picture_layer.cc
+++ b/cc/test/fake_picture_layer.cc
@@ -42,11 +42,10 @@ scoped_ptr<LayerImpl> FakePictureLayer::CreateLayerImpl(
return FakePictureLayerImpl::Create(tree_impl, layer_id_);
}
-bool FakePictureLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
+bool FakePictureLayer::Update(ResourceUpdateQueue* queue) {
if (disable_lcd_text_)
draw_properties().can_use_lcd_text = false;
- bool updated = PictureLayer::Update(queue, occlusion);
+ bool updated = PictureLayer::Update(queue);
update_count_++;
return updated || always_update_resources_;
}
diff --git a/cc/test/fake_picture_layer.h b/cc/test/fake_picture_layer.h
index 3801ec0..7c95fd1 100644
--- a/cc/test/fake_picture_layer.h
+++ b/cc/test/fake_picture_layer.h
@@ -40,8 +40,7 @@ class FakePictureLayer : public PictureLayer {
void disable_lcd_text() { disable_lcd_text_ = true; }
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override;
+ bool Update(ResourceUpdateQueue* queue) override;
void PushPropertiesTo(LayerImpl* layer) override;
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 9756852..9d1c366 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -43,7 +43,6 @@
#include "cc/trees/layer_tree_host_common.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "cc/trees/layer_tree_impl.h"
-#include "cc/trees/occlusion_tracker.h"
#include "cc/trees/single_thread_proxy.h"
#include "cc/trees/thread_proxy.h"
#include "cc/trees/tree_synchronizer.h"
@@ -828,7 +827,7 @@ bool LayerTreeHost::UpdateLayers(Layer* root_layer,
// TODO(enne): temporarily clobber draw properties visible rect.
layer->draw_properties().visible_content_rect =
layer->visible_rect_from_property_trees();
- did_paint_content |= layer->Update(queue, nullptr);
+ did_paint_content |= layer->Update(queue);
content_is_suitable_for_gpu_rasterization_ &=
layer->IsSuitableForGpuRasterization();
}
@@ -964,7 +963,7 @@ void LayerTreeHost::PaintMasksForRenderSurface(Layer* render_surface_layer,
Layer* mask_layer = render_surface_layer->mask_layer();
if (mask_layer) {
- *did_paint_content |= mask_layer->Update(queue, NULL);
+ *did_paint_content |= mask_layer->Update(queue);
*need_more_updates |= mask_layer->NeedMoreUpdates();
}
@@ -972,7 +971,7 @@ void LayerTreeHost::PaintMasksForRenderSurface(Layer* render_surface_layer,
render_surface_layer->replica_layer() ?
render_surface_layer->replica_layer()->mask_layer() : NULL;
if (replica_mask_layer) {
- *did_paint_content |= replica_mask_layer->Update(queue, NULL);
+ *did_paint_content |= replica_mask_layer->Update(queue);
*need_more_updates |= replica_mask_layer->NeedMoreUpdates();
}
}
@@ -982,31 +981,22 @@ void LayerTreeHost::PaintLayerContents(
ResourceUpdateQueue* queue,
bool* did_paint_content,
bool* need_more_updates) {
- OcclusionTracker<Layer> occlusion_tracker(
- root_layer_->render_surface()->content_rect());
- occlusion_tracker.set_minimum_tracking_size(
- settings_.minimum_occlusion_tracking_size);
-
PrioritizeTextures(render_surface_layer_list);
in_paint_layer_contents_ = true;
- // Iterates front-to-back to allow for testing occlusion and performing
- // culling during the tree walk.
typedef LayerIterator<Layer> LayerIteratorType;
LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list);
for (LayerIteratorType it =
LayerIteratorType::Begin(&render_surface_layer_list);
it != end;
++it) {
- occlusion_tracker.EnterLayer(it);
-
if (it.represents_target_render_surface()) {
PaintMasksForRenderSurface(
*it, queue, did_paint_content, need_more_updates);
} else if (it.represents_itself()) {
DCHECK(!it->paint_properties().bounds.IsEmpty());
- *did_paint_content |= it->Update(queue, &occlusion_tracker);
+ *did_paint_content |= it->Update(queue);
*need_more_updates |= it->NeedMoreUpdates();
// Note the '&&' with previous is-suitable state.
// This means that once the layer-tree becomes unsuitable for gpu
@@ -1018,8 +1008,6 @@ void LayerTreeHost::PaintLayerContents(
content_is_suitable_for_gpu_rasterization_ &=
it->IsSuitableForGpuRasterization();
}
-
- occlusion_tracker.LeaveLayer(it);
}
in_paint_layer_contents_ = false;
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 0aa8a28..451ec25 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -1390,9 +1390,8 @@ class ContentLayerWithUpdateTracking : public ContentLayer {
int PaintContentsCount() { return paint_contents_count_; }
void ResetPaintContentsCount() { paint_contents_count_ = 0; }
- bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) override {
- bool updated = ContentLayer::Update(queue, occlusion);
+ bool Update(ResourceUpdateQueue* queue) override {
+ bool updated = ContentLayer::Update(queue);
paint_contents_count_++;
return updated;
}
@@ -1589,7 +1588,7 @@ class EvictionTestLayer : public Layer {
return make_scoped_refptr(new EvictionTestLayer(settings));
}
- bool Update(ResourceUpdateQueue*, const OcclusionTracker<Layer>*) override;
+ bool Update(ResourceUpdateQueue* queue) override;
bool DrawsContent() const override { return true; }
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
@@ -1647,8 +1646,7 @@ void EvictionTestLayer::SetTexturePriorities(const PriorityCalculator&) {
texture_->set_request_priority(PriorityCalculator::UIPriority(true));
}
-bool EvictionTestLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) {
+bool EvictionTestLayer::Update(ResourceUpdateQueue* queue) {
CreateTextureIfNeeded();
if (!texture_)
return false;