diff options
author | danakj <danakj@chromium.org> | 2015-06-18 17:01:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-19 00:03:21 +0000 |
commit | 5f46636a8a12805c766fb5b9b448f0061d7e2454 (patch) | |
tree | 4a0070d96806c3bfdff5ff59d29650eaecdd53a6 | |
parent | 2fc587ca7953483ebd9e8d71636d2a1b28a59c06 (diff) | |
download | chromium_src-5f46636a8a12805c766fb5b9b448f0061d7e2454.zip chromium_src-5f46636a8a12805c766fb5b9b448f0061d7e2454.tar.gz chromium_src-5f46636a8a12805c766fb5b9b448f0061d7e2454.tar.bz2 |
cc: Stop passing a ResourceUpdateQueue to Layer::Update().
The queue is unused so there's no need to pass it around.
This is a minimal change to just stop passing the queue, it doesn't
change the proxies yet. They can stop making a queue entirely in the
future.
R=enne, vmpstr
BUG=413479
Review URL: https://codereview.chromium.org/1177223008
Cr-Commit-Position: refs/heads/master@{#335168}
28 files changed, 61 insertions, 85 deletions
diff --git a/cc/debug/micro_benchmark_controller_unittest.cc b/cc/debug/micro_benchmark_controller_unittest.cc index 92cfc46..b9f953c 100644 --- a/cc/debug/micro_benchmark_controller_unittest.cc +++ b/cc/debug/micro_benchmark_controller_unittest.cc @@ -76,9 +76,8 @@ TEST_F(MicroBenchmarkControllerTest, BenchmarkRan) { base::Bind(&IncrementCallCount, base::Unretained(&run_count))); EXPECT_GT(id, 0); - scoped_ptr<ResourceUpdateQueue> queue(new ResourceUpdateQueue); layer_tree_host_->SetOutputSurfaceLostForTesting(false); - layer_tree_host_->UpdateLayers(queue.get()); + layer_tree_host_->UpdateLayers(); EXPECT_EQ(1, run_count); } @@ -96,9 +95,8 @@ TEST_F(MicroBenchmarkControllerTest, MultipleBenchmarkRan) { base::Bind(&IncrementCallCount, base::Unretained(&run_count))); EXPECT_GT(id, 0); - scoped_ptr<ResourceUpdateQueue> queue(new ResourceUpdateQueue); layer_tree_host_->SetOutputSurfaceLostForTesting(false); - layer_tree_host_->UpdateLayers(queue.get()); + layer_tree_host_->UpdateLayers(); EXPECT_EQ(2, run_count); @@ -113,10 +111,10 @@ TEST_F(MicroBenchmarkControllerTest, MultipleBenchmarkRan) { base::Bind(&IncrementCallCount, base::Unretained(&run_count))); EXPECT_GT(id, 0); - layer_tree_host_->UpdateLayers(queue.get()); + layer_tree_host_->UpdateLayers(); EXPECT_EQ(4, run_count); - layer_tree_host_->UpdateLayers(queue.get()); + layer_tree_host_->UpdateLayers(); EXPECT_EQ(4, run_count); } diff --git a/cc/layers/delegated_renderer_layer.cc b/cc/layers/delegated_renderer_layer.cc index cf2c787..b48d1ea 100644 --- a/cc/layers/delegated_renderer_layer.cc +++ b/cc/layers/delegated_renderer_layer.cc @@ -83,8 +83,8 @@ void DelegatedRendererLayer::ProviderHasNewFrame() { SetNextCommitWaitsForActivation(); } -bool DelegatedRendererLayer::Update(ResourceUpdateQueue* queue) { - bool updated = Layer::Update(queue); +bool DelegatedRendererLayer::Update() { + bool updated = Layer::Update(); if (!should_collect_new_frame_) return updated; diff --git a/cc/layers/delegated_renderer_layer.h b/cc/layers/delegated_renderer_layer.h index 4182289..124b389 100644 --- a/cc/layers/delegated_renderer_layer.h +++ b/cc/layers/delegated_renderer_layer.h @@ -24,7 +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) override; + bool Update() 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 ffcb0e2..c2e3530 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) { - bool updated = Layer::Update(queue); - +bool IOSurfaceLayer::Update() { + bool updated = Layer::Update(); // 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. return updated || !update_rect_.IsEmpty(); diff --git a/cc/layers/io_surface_layer.h b/cc/layers/io_surface_layer.h index 56823f3..14eabd9 100644 --- a/cc/layers/io_surface_layer.h +++ b/cc/layers/io_surface_layer.h @@ -18,7 +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) override; + bool Update() override; protected: bool HasDrawableContent() const override; diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index ebff2c2..a74c75f 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc @@ -1347,7 +1347,7 @@ void Layer::SavePaintProperties() { layer_tree_host_->source_frame_number(); } -bool Layer::Update(ResourceUpdateQueue* queue) { +bool Layer::Update() { 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 701db9c..211ea7c 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h @@ -374,8 +374,8 @@ 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); + // Returns true iff anything was updated that needs to be committed. + virtual bool Update(); 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 579808b..20082a0 100644 --- a/cc/layers/nine_patch_layer_unittest.cc +++ b/cc/layers/nine_patch_layer_unittest.cc @@ -6,7 +6,6 @@ #include "cc/resources/prioritized_resource_manager.h" #include "cc/resources/resource_provider.h" -#include "cc/resources/resource_update_queue.h" #include "cc/resources/scoped_ui_resource.h" #include "cc/test/fake_layer_tree_host.h" #include "cc/test/fake_layer_tree_host_client.h" @@ -58,10 +57,9 @@ TEST_F(NinePatchLayerTest, SetLayerProperties) { Mock::VerifyAndClearExpectations(layer_tree_host_.get()); EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get()); - ResourceUpdateQueue queue; gfx::Rect screen_space_clip_rect; test_layer->SavePaintProperties(); - test_layer->Update(&queue); + test_layer->Update(); 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); + test_layer->Update(); EXPECT_TRUE(test_layer->DrawsContent()); } diff --git a/cc/layers/painted_scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc index 53b45c6..f537ffc 100644 --- a/cc/layers/painted_scrollbar_layer.cc +++ b/cc/layers/painted_scrollbar_layer.cc @@ -227,11 +227,11 @@ void PaintedScrollbarLayer::UpdateInternalContentScale() { } } -bool PaintedScrollbarLayer::Update(ResourceUpdateQueue* queue) { +bool PaintedScrollbarLayer::Update() { { base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_, true); - Layer::Update(queue); + Layer::Update(); UpdateInternalContentScale(); } diff --git a/cc/layers/painted_scrollbar_layer.h b/cc/layers/painted_scrollbar_layer.h index 2b5c263..1c85a55 100644 --- a/cc/layers/painted_scrollbar_layer.h +++ b/cc/layers/painted_scrollbar_layer.h @@ -37,7 +37,7 @@ class CC_EXPORT PaintedScrollbarLayer : public ScrollbarLayerInterface, ScrollbarOrientation orientation() const override; // Layer interface - bool Update(ResourceUpdateQueue* queue) override; + bool Update() 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 17b1499..aa366d5 100644 --- a/cc/layers/picture_layer.cc +++ b/cc/layers/picture_layer.cc @@ -113,9 +113,9 @@ void PictureLayer::SetNeedsDisplayRect(const gfx::Rect& layer_rect) { Layer::SetNeedsDisplayRect(layer_rect); } -bool PictureLayer::Update(ResourceUpdateQueue* queue) { +bool PictureLayer::Update() { update_source_frame_number_ = layer_tree_host()->source_frame_number(); - bool updated = Layer::Update(queue); + bool updated = Layer::Update(); gfx::Rect visible_layer_rect = visible_content_rect(); gfx::Size layer_size = paint_properties().bounds; diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h index 8c7e2e8..4a94d9d 100644 --- a/cc/layers/picture_layer.h +++ b/cc/layers/picture_layer.h @@ -30,7 +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) override; + bool Update() 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 7bea6d8c..0133952 100644 --- a/cc/layers/picture_layer_unittest.cc +++ b/cc/layers/picture_layer_unittest.cc @@ -47,9 +47,7 @@ TEST(PictureLayerTest, NoTilesIfEmptyBounds) { host->SetRootLayer(layer); layer->SetIsDrawable(true); layer->SavePaintProperties(); - - scoped_ptr<ResourceUpdateQueue> queue(new ResourceUpdateQueue); - layer->Update(queue.get()); + layer->Update(); 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 5e9e3fd2..d6c86cc 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -12,7 +12,6 @@ #include "cc/layers/solid_color_scrollbar_layer.h" #include "cc/layers/solid_color_scrollbar_layer_impl.h" #include "cc/quads/solid_color_draw_quad.h" -#include "cc/resources/resource_update_queue.h" #include "cc/test/fake_impl_proxy.h" #include "cc/test/fake_layer_tree_host.h" #include "cc/test/fake_layer_tree_host_client.h" @@ -722,11 +721,9 @@ class ScrollbarLayerTestResourceCreationAndRelease : public ScrollbarLayerTest { testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get()); EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get()); - ResourceUpdateQueue queue; - scrollbar_layer->SavePaintProperties(); for (int update_counter = 0; update_counter < num_updates; update_counter++) - scrollbar_layer->Update(&queue); + scrollbar_layer->Update(); // A non-solid-color scrollbar should have requested two textures. EXPECT_EQ(expected_resources, layer_tree_host_->UIResourceCount()); @@ -788,7 +785,6 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) { testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get()); EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get()); - ResourceUpdateQueue queue; size_t resource_count; int expected_created, expected_deleted; scrollbar_layer->SavePaintProperties(); @@ -796,7 +792,7 @@ TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) { resource_count = 2; expected_created = 2; expected_deleted = 0; - EXPECT_TRUE(scrollbar_layer->Update(&queue)); + EXPECT_TRUE(scrollbar_layer->Update()); EXPECT_NE(0, scrollbar_layer->track_resource_id()); EXPECT_NE(0, scrollbar_layer->thumb_resource_id()); EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount()); @@ -807,7 +803,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)); + EXPECT_TRUE(scrollbar_layer->Update()); EXPECT_EQ(0, scrollbar_layer->track_resource_id()); EXPECT_EQ(0, scrollbar_layer->thumb_resource_id()); EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount()); @@ -818,7 +814,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)); + EXPECT_FALSE(scrollbar_layer->Update()); EXPECT_EQ(0, scrollbar_layer->track_resource_id()); EXPECT_EQ(0, scrollbar_layer->thumb_resource_id()); EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount()); @@ -829,7 +825,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)); + EXPECT_TRUE(scrollbar_layer->Update()); EXPECT_NE(0, scrollbar_layer->track_resource_id()); EXPECT_NE(0, scrollbar_layer->thumb_resource_id()); EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount()); @@ -840,7 +836,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)); + EXPECT_TRUE(scrollbar_layer->Update()); EXPECT_NE(0, scrollbar_layer->track_resource_id()); EXPECT_EQ(0, scrollbar_layer->thumb_resource_id()); EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount()); @@ -851,7 +847,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)); + EXPECT_TRUE(scrollbar_layer->Update()); EXPECT_EQ(0, scrollbar_layer->track_resource_id()); EXPECT_EQ(0, scrollbar_layer->thumb_resource_id()); EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount()); @@ -863,7 +859,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)); + EXPECT_TRUE(scrollbar_layer->Update()); EXPECT_NE(0, scrollbar_layer->track_resource_id()); EXPECT_NE(0, scrollbar_layer->thumb_resource_id()); @@ -873,7 +869,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)); + EXPECT_TRUE(scrollbar_layer->Update()); EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount()); EXPECT_EQ(expected_created, layer_tree_host_->TotalUIResourceCreated()); EXPECT_EQ(expected_deleted, layer_tree_host_->TotalUIResourceDeleted()); @@ -882,7 +878,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)); + EXPECT_FALSE(scrollbar_layer->Update()); EXPECT_NE(0, scrollbar_layer->track_resource_id()); EXPECT_EQ(0, scrollbar_layer->thumb_resource_id()); EXPECT_EQ(resource_count, layer_tree_host_->UIResourceCount()); @@ -923,9 +919,8 @@ class ScaledScrollbarLayerTestResourceCreation : public ScrollbarLayerTest { layer_tree_host_->SetDeviceScaleFactor(test_scale); - ResourceUpdateQueue queue; scrollbar_layer->SavePaintProperties(); - scrollbar_layer->Update(&queue); + scrollbar_layer->Update(); // Verify that we have not generated any content uploads that are larger // than their destination textures. @@ -980,11 +975,10 @@ class ScaledScrollbarLayerTestScaledRasterization : public ScrollbarLayerTest { layer_tree_host_->SetDeviceScaleFactor(test_scale); - ResourceUpdateQueue queue; gfx::Rect screen_space_clip_rect; scrollbar_layer->SavePaintProperties(); - scrollbar_layer->Update(&queue); + scrollbar_layer->Update(); 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 965b2f3..2704cf8 100644 --- a/cc/layers/texture_layer.cc +++ b/cc/layers/texture_layer.cc @@ -216,8 +216,8 @@ bool TextureLayer::HasDrawableContent() const { return (client_ || holder_ref_) && Layer::HasDrawableContent(); } -bool TextureLayer::Update(ResourceUpdateQueue* queue) { - bool updated = Layer::Update(queue); +bool TextureLayer::Update() { + bool updated = Layer::Update(); if (client_) { TextureMailbox mailbox; scoped_ptr<SingleReleaseCallback> release_callback; diff --git a/cc/layers/texture_layer.h b/cc/layers/texture_layer.h index e9276b3..09d703b 100644 --- a/cc/layers/texture_layer.h +++ b/cc/layers/texture_layer.h @@ -142,7 +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) override; + bool Update() override; void PushPropertiesTo(LayerImpl* layer) override; SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; diff --git a/cc/layers/ui_resource_layer_unittest.cc b/cc/layers/ui_resource_layer_unittest.cc index d650687..3a45eaf 100644 --- a/cc/layers/ui_resource_layer_unittest.cc +++ b/cc/layers/ui_resource_layer_unittest.cc @@ -7,7 +7,6 @@ #include "base/thread_task_runner_handle.h" #include "cc/resources/prioritized_resource_manager.h" #include "cc/resources/resource_provider.h" -#include "cc/resources/resource_update_queue.h" #include "cc/resources/scoped_ui_resource.h" #include "cc/test/fake_layer_tree_host.h" #include "cc/test/fake_layer_tree_host_client.h" @@ -82,9 +81,8 @@ TEST_F(UIResourceLayerTest, SetBitmap) { Mock::VerifyAndClearExpectations(layer_tree_host_.get()); EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get()); - ResourceUpdateQueue queue; test_layer->SavePaintProperties(); - test_layer->Update(&queue); + test_layer->Update(); EXPECT_FALSE(test_layer->DrawsContent()); @@ -93,7 +91,7 @@ TEST_F(UIResourceLayerTest, SetBitmap) { bitmap.setImmutable(); test_layer->SetBitmap(bitmap); - test_layer->Update(&queue); + test_layer->Update(); EXPECT_TRUE(test_layer->DrawsContent()); } @@ -108,9 +106,8 @@ TEST_F(UIResourceLayerTest, SetUIResourceId) { Mock::VerifyAndClearExpectations(layer_tree_host_.get()); EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get()); - ResourceUpdateQueue queue; test_layer->SavePaintProperties(); - test_layer->Update(&queue); + test_layer->Update(); EXPECT_FALSE(test_layer->DrawsContent()); @@ -118,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); + test_layer->Update(); EXPECT_TRUE(test_layer->DrawsContent()); diff --git a/cc/layers/video_layer.cc b/cc/layers/video_layer.cc index 8e0f17f..cae00aa 100644 --- a/cc/layers/video_layer.cc +++ b/cc/layers/video_layer.cc @@ -30,8 +30,8 @@ scoped_ptr<LayerImpl> VideoLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { return impl.Pass(); } -bool VideoLayer::Update(ResourceUpdateQueue* queue) { - bool updated = Layer::Update(queue); +bool VideoLayer::Update() { + bool updated = Layer::Update(); // 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 f8e257e..575de46 100644 --- a/cc/layers/video_layer.h +++ b/cc/layers/video_layer.h @@ -26,7 +26,7 @@ class CC_EXPORT VideoLayer : public Layer { scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; - bool Update(ResourceUpdateQueue* queue) override; + bool Update() override; private: VideoLayer(const LayerSettings& settings, diff --git a/cc/test/fake_layer_tree_host.h b/cc/test/fake_layer_tree_host.h index f1dbb63..180e144 100644 --- a/cc/test/fake_layer_tree_host.h +++ b/cc/test/fake_layer_tree_host.h @@ -45,9 +45,7 @@ class FakeLayerTreeHost : public LayerTreeHost { using LayerTreeHost::SetOutputSurfaceLostForTesting; using LayerTreeHost::InitializeSingleThreaded; using LayerTreeHost::InitializeForTesting; - void UpdateLayers(ResourceUpdateQueue* queue) { - LayerTreeHost::UpdateLayers(queue); - } + void UpdateLayers() { LayerTreeHost::UpdateLayers(); } MicroBenchmarkController* GetMicroBenchmarkController() { return µ_benchmark_controller_; diff --git a/cc/test/fake_painted_scrollbar_layer.cc b/cc/test/fake_painted_scrollbar_layer.cc index 9811c5f..97736a8 100644 --- a/cc/test/fake_painted_scrollbar_layer.cc +++ b/cc/test/fake_painted_scrollbar_layer.cc @@ -37,8 +37,8 @@ FakePaintedScrollbarLayer::FakePaintedScrollbarLayer( FakePaintedScrollbarLayer::~FakePaintedScrollbarLayer() {} -bool FakePaintedScrollbarLayer::Update(ResourceUpdateQueue* queue) { - bool updated = PaintedScrollbarLayer::Update(queue); +bool FakePaintedScrollbarLayer::Update() { + bool updated = PaintedScrollbarLayer::Update(); ++update_count_; return updated; } diff --git a/cc/test/fake_painted_scrollbar_layer.h b/cc/test/fake_painted_scrollbar_layer.h index 05d9165..72ea250 100644 --- a/cc/test/fake_painted_scrollbar_layer.h +++ b/cc/test/fake_painted_scrollbar_layer.h @@ -23,7 +23,7 @@ class FakePaintedScrollbarLayer : public PaintedScrollbarLayer { int update_count() const { return update_count_; } void reset_update_count() { update_count_ = 0; } - bool Update(ResourceUpdateQueue* queue) override; + bool Update() override; void PushPropertiesTo(LayerImpl* layer) override; diff --git a/cc/test/fake_picture_layer.cc b/cc/test/fake_picture_layer.cc index c3b5908..0732b30 100644 --- a/cc/test/fake_picture_layer.cc +++ b/cc/test/fake_picture_layer.cc @@ -42,10 +42,10 @@ scoped_ptr<LayerImpl> FakePictureLayer::CreateLayerImpl( return FakePictureLayerImpl::Create(tree_impl, layer_id_); } -bool FakePictureLayer::Update(ResourceUpdateQueue* queue) { +bool FakePictureLayer::Update() { if (disable_lcd_text_) draw_properties().can_use_lcd_text = false; - bool updated = PictureLayer::Update(queue); + bool updated = PictureLayer::Update(); update_count_++; return updated || always_update_resources_; } diff --git a/cc/test/fake_picture_layer.h b/cc/test/fake_picture_layer.h index 7c95fd1..7093816 100644 --- a/cc/test/fake_picture_layer.h +++ b/cc/test/fake_picture_layer.h @@ -40,7 +40,7 @@ class FakePictureLayer : public PictureLayer { void disable_lcd_text() { disable_lcd_text_ = true; } - bool Update(ResourceUpdateQueue* queue) override; + bool Update() override; void PushPropertiesTo(LayerImpl* layer) override; diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index b423728..46ed4fa 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -694,18 +694,13 @@ void LayerTreeHost::Composite(base::TimeTicks frame_begin_time) { proxy->CompositeImmediately(frame_begin_time); } -bool LayerTreeHost::UpdateLayers(ResourceUpdateQueue* queue) { +bool LayerTreeHost::UpdateLayers() { DCHECK(!output_surface_lost_); - if (!root_layer()) return false; - DCHECK(!root_layer()->parent()); - - bool result = UpdateLayers(root_layer(), queue); - + bool result = DoUpdateLayers(root_layer()); micro_benchmark_controller_.DidUpdateLayers(); - return result || next_commit_forces_redraw_; } @@ -758,10 +753,9 @@ bool LayerTreeHost::UsingSharedMemoryResources() { return GetRendererCapabilities().using_shared_memory_resources; } -bool LayerTreeHost::UpdateLayers(Layer* root_layer, - ResourceUpdateQueue* queue) { - TRACE_EVENT1("cc", "LayerTreeHost::UpdateLayers", - "source_frame_number", source_frame_number()); +bool LayerTreeHost::DoUpdateLayers(Layer* root_layer) { + TRACE_EVENT1("cc", "LayerTreeHost::DoUpdateLayers", "source_frame_number", + source_frame_number()); RenderSurfaceLayerList render_surface_layer_list; @@ -822,7 +816,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); + did_paint_content |= layer->Update(); content_is_suitable_for_gpu_rasterization_ &= layer->IsSuitableForGpuRasterization(); } diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index 2d29d9f..36b06b7 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h @@ -122,7 +122,7 @@ class CC_EXPORT LayerTreeHost { void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); } void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); } void DeleteContentsTexturesOnImplThread(ResourceProvider* resource_provider); - bool UpdateLayers(ResourceUpdateQueue* queue); + bool UpdateLayers(); // Called when the compositor completed page scale animation. void DidCompletePageScaleAnimation(); @@ -361,7 +361,7 @@ class CC_EXPORT LayerTreeHost { private: void InitializeProxy(scoped_ptr<Proxy> proxy); - bool UpdateLayers(Layer* root_layer, ResourceUpdateQueue* queue); + bool DoUpdateLayers(Layer* root_layer); void UpdateHudLayer(); void ReduceMemoryUsage(); diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index 91816b9..90bd8d8 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc @@ -904,7 +904,7 @@ void SingleThreadProxy::DoBeginMainFrame( // New commits requested inside UpdateLayers should be respected. commit_requested_ = false; - layer_tree_host_->UpdateLayers(queue_for_commit_.get()); + layer_tree_host_->UpdateLayers(); timing_history_.DidBeginMainFrame(); diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc index 94e8d89..c9bd06f 100644 --- a/cc/trees/thread_proxy.cc +++ b/cc/trees/thread_proxy.cc @@ -827,7 +827,7 @@ void ThreadProxy::BeginMainFrame( scoped_ptr<ResourceUpdateQueue> queue = make_scoped_ptr(new ResourceUpdateQueue); - bool updated = layer_tree_host()->UpdateLayers(queue.get()); + bool updated = layer_tree_host()->UpdateLayers(); layer_tree_host()->WillCommit(); devtools_instrumentation::ScopedCommitTrace commit_task( |