diff options
author | danakj <danakj@chromium.org> | 2014-11-13 18:05:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-14 02:05:39 +0000 |
commit | a819c2552ffe135e2e15fb0eb64341882a7d4912 (patch) | |
tree | 7a75706f340f7d8fd069a9f43d9452ab1bfc9220 | |
parent | bf14bb992d8111b6cc6e380aa0ab3030d4ec3b05 (diff) | |
download | chromium_src-a819c2552ffe135e2e15fb0eb64341882a7d4912.zip chromium_src-a819c2552ffe135e2e15fb0eb64341882a7d4912.tar.gz chromium_src-a819c2552ffe135e2e15fb0eb64341882a7d4912.tar.bz2 |
SetNeedsRedraw directly when updating a visible tile.
Removes the UpdateVisibleTiles scheduler state, instead if the
current set of raster tasks starts with a visible tile, we
optimistically call SetNeedsRedraw() at the start of each impl
frame to cause us to try and draw. At draw time we
UpdateVisibleTiles in the tile manager to collect any completed
tasks.
To handle other cases, whenever a visible tile is completed, we
call SetNeedsRedraw() in addition to setting damage on the layer.
Last, when NotifyReadyToDraw() happens, we have a complete frame,
so we can stop optimistically calling SetNeedsRedraw() at the
start of each impl frame.
This allows us to remove the full viewport damage when ending a
pinch gesture.
This change adds 2 integration unit tests for pinch zoom. The
first ensures that when a pinch ends we don't leave blurry tiles
on the screen, but update them to ideal. The second ensures we
continuously try to draw while we have an incomplete frame.
BUG=427423
Review URL: https://codereview.chromium.org/671653005
Cr-Commit-Position: refs/heads/master@{#304147}
30 files changed, 525 insertions, 386 deletions
diff --git a/cc/BUILD.gn b/cc/BUILD.gn index 55c6c05..a296bb0 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn @@ -544,6 +544,7 @@ source_set("test_support") { "test/fake_picture_layer_impl.h", "test/fake_picture_layer_tiling_client.cc", "test/fake_picture_layer_tiling_client.h", + "test/fake_picture_pile.cc", "test/fake_picture_pile.h", "test/fake_picture_pile_impl.cc", "test/fake_picture_pile_impl.h", diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp index db58318..d4a031f 100644 --- a/cc/cc_tests.gyp +++ b/cc/cc_tests.gyp @@ -170,6 +170,7 @@ 'test/fake_picture_layer_impl.h', 'test/fake_picture_layer_tiling_client.cc', 'test/fake_picture_layer_tiling_client.h', + 'test/fake_picture_pile.cc', 'test/fake_picture_pile.h', 'test/fake_picture_pile_impl.cc', 'test/fake_picture_pile_impl.h', diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc index 5d45cae..dbfa63c 100644 --- a/cc/layers/picture_layer.cc +++ b/cc/layers/picture_layer.cc @@ -26,6 +26,12 @@ PictureLayer::PictureLayer(ContentLayerClient* client) can_use_lcd_text_last_frame_(can_use_lcd_text()) { } +PictureLayer::PictureLayer(ContentLayerClient* client, + scoped_ptr<RecordingSource> source) + : PictureLayer(client) { + recording_source_ = source.Pass(); +} + PictureLayer::~PictureLayer() { } diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h index 2969ee1..ebd6427 100644 --- a/cc/layers/picture_layer.h +++ b/cc/layers/picture_layer.h @@ -45,6 +45,8 @@ class CC_EXPORT PictureLayer : public Layer { protected: explicit PictureLayer(ContentLayerClient* client); + // Allow tests to inject a recording source. + PictureLayer(ContentLayerClient* client, scoped_ptr<RecordingSource> source); ~PictureLayer() override; bool HasDrawableContent() const override; diff --git a/cc/resources/picture_pile_impl.h b/cc/resources/picture_pile_impl.h index 6986db4..9f5b5f6 100644 --- a/cc/resources/picture_pile_impl.h +++ b/cc/resources/picture_pile_impl.h @@ -17,7 +17,14 @@ #include "cc/resources/raster_source.h" #include "skia/ext/analysis_canvas.h" #include "skia/ext/refptr.h" -#include "third_party/skia/include/core/SkPicture.h" + +class SkCanvas; +class SkPicture; +class SkPixelRef; + +namespace gfx { +class Rect; +} namespace cc { diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 1c7d4ca..d83b824 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -233,7 +233,6 @@ TileManager::TileManager( scheduled_raster_task_limit_(scheduled_raster_task_limit), all_tiles_that_need_to_be_rasterized_are_scheduled_(true), rendering_stats_instrumentation_(rendering_stats_instrumentation), - did_initialize_visible_tile_(false), did_check_for_completed_tasks_since_last_schedule_tasks_(true), did_oom_on_last_assign_(false), ready_to_activate_check_notifier_( @@ -433,7 +432,7 @@ void TileManager::ManageTiles(const GlobalStateThatImpactsTilePriority& state) { resource_pool_->acquired_memory_usage_bytes()); } -bool TileManager::UpdateVisibleTiles() { +void TileManager::UpdateVisibleTiles() { TRACE_EVENT0("cc", "TileManager::UpdateVisibleTiles"); rasterizer_->CheckForCompletedTasks(); @@ -446,10 +445,6 @@ bool TileManager::UpdateVisibleTiles() { "stats", RasterTaskCompletionStatsAsValue(update_visible_tiles_stats_)); update_visible_tiles_stats_ = RasterTaskCompletionStats(); - - bool did_initialize_visible_tile = did_initialize_visible_tile_; - did_initialize_visible_tile_ = false; - return did_initialize_visible_tile; } scoped_refptr<base::debug::ConvertableToTraceFormat> @@ -828,9 +823,6 @@ void TileManager::OnRasterTaskCompleted( mts.draw_info.resource_ = resource.Pass(); } - if (tile->priority(ACTIVE_TREE).distance_to_visible == 0.f) - did_initialize_visible_tile_ = true; - client_->NotifyTileStateChanged(tile); } diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h index 92821e0..e94fb7c 100644 --- a/cc/resources/tile_manager.h +++ b/cc/resources/tile_manager.h @@ -108,8 +108,7 @@ class CC_EXPORT TileManager : public RasterizerClient, void ManageTiles(const GlobalStateThatImpactsTilePriority& state); - // Returns true when visible tiles have been initialized. - bool UpdateVisibleTiles(); + void UpdateVisibleTiles(); scoped_refptr<Tile> CreateTile(RasterSource* raster_source, const gfx::Size& tile_size, @@ -254,7 +253,6 @@ class CC_EXPORT TileManager : public RasterizerClient, RenderingStatsInstrumentation* rendering_stats_instrumentation_; - bool did_initialize_visible_tile_; bool did_check_for_completed_tasks_since_last_schedule_tasks_; bool did_oom_on_last_assign_; diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc index 5c515b2..d36ea46 100644 --- a/cc/scheduler/scheduler.cc +++ b/cc/scheduler/scheduler.cc @@ -244,11 +244,6 @@ void Scheduler::DidSwapBuffers() { } } -void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { - state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); - ProcessScheduledActions(); -} - void Scheduler::DidSwapBuffersComplete() { state_machine_.DidSwapBuffersComplete(); ProcessScheduledActions(); @@ -669,9 +664,6 @@ void Scheduler::ProcessScheduledActions() { case SchedulerStateMachine::ACTION_COMMIT: client_->ScheduledActionCommit(); break; - case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES: - client_->ScheduledActionUpdateVisibleTiles(); - break; case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: client_->ScheduledActionActivateSyncTree(); break; diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h index 523c246..2a924f1 100644 --- a/cc/scheduler/scheduler.h +++ b/cc/scheduler/scheduler.h @@ -40,7 +40,6 @@ class SchedulerClient { virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; virtual void ScheduledActionAnimate() = 0; virtual void ScheduledActionCommit() = 0; - virtual void ScheduledActionUpdateVisibleTiles() = 0; virtual void ScheduledActionActivateSyncTree() = 0; virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; virtual void ScheduledActionManageTiles() = 0; @@ -120,7 +119,6 @@ class CC_EXPORT Scheduler : public BeginFrameObserverMixIn, void SetMaxSwapsPending(int max); void DidSwapBuffers(); - void SetSwapUsedIncompleteTile(bool used_incomplete_tile); void DidSwapBuffersComplete(); void SetImplLatencyTakesPriority(bool impl_latency_takes_priority); diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc index 94016f3..82b13d7 100644 --- a/cc/scheduler/scheduler_state_machine.cc +++ b/cc/scheduler/scheduler_state_machine.cc @@ -26,7 +26,6 @@ SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings) last_frame_number_swap_performed_(-1), last_frame_number_swap_requested_(-1), last_frame_number_begin_main_frame_sent_(-1), - last_frame_number_update_visible_tiles_was_called_(-1), manage_tiles_funnel_(0), consecutive_checkerboard_animations_(0), max_pending_swaps_(1), @@ -34,7 +33,6 @@ SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings) needs_redraw_(false), needs_animate_(false), needs_manage_tiles_(false), - swap_used_incomplete_tile_(false), needs_commit_(false), inside_poll_for_anticipated_draw_triggers_(false), visible_(false), @@ -129,8 +127,6 @@ const char* SchedulerStateMachine::ActionToString(Action action) { return "ACTION_SEND_BEGIN_MAIN_FRAME"; case ACTION_COMMIT: return "ACTION_COMMIT"; - case ACTION_UPDATE_VISIBLE_TILES: - return "ACTION_UPDATE_VISIBLE_TILES"; case ACTION_ACTIVATE_SYNC_TREE: return "ACTION_ACTIVATE_SYNC_TREE"; case ACTION_DRAW_AND_SWAP_IF_POSSIBLE: @@ -206,8 +202,6 @@ void SchedulerStateMachine::AsValueInto(base::debug::TracedValue* state, last_frame_number_swap_requested_); state->SetInteger("last_frame_number_begin_main_frame_sent", last_frame_number_begin_main_frame_sent_); - state->SetInteger("last_frame_number_update_visible_tiles_was_called", - last_frame_number_update_visible_tiles_was_called_); state->SetInteger("manage_tiles_funnel", manage_tiles_funnel_); state->SetInteger("consecutive_checkerboard_animations", @@ -217,7 +211,6 @@ void SchedulerStateMachine::AsValueInto(base::debug::TracedValue* state, state->SetBoolean("needs_redraw", needs_redraw_); state->SetBoolean("needs_animate_", needs_animate_); state->SetBoolean("needs_manage_tiles", needs_manage_tiles_); - state->SetBoolean("swap_used_incomplete_tile", swap_used_incomplete_tile_); state->SetBoolean("needs_commit", needs_commit_); state->SetBoolean("visible", visible_); state->SetBoolean("can_start", can_start_); @@ -265,11 +258,6 @@ bool SchedulerStateMachine::HasSentBeginMainFrameThisFrame() const { last_frame_number_begin_main_frame_sent_; } -bool SchedulerStateMachine::HasUpdatedVisibleTilesThisFrame() const { - return current_frame_number_ == - last_frame_number_update_visible_tiles_was_called_; -} - bool SchedulerStateMachine::HasSwappedThisFrame() const { return current_frame_number_ == last_frame_number_swap_performed_; } @@ -394,34 +382,6 @@ bool SchedulerStateMachine::ShouldActivatePendingTree() const { return pending_tree_is_ready_for_activation_; } -bool SchedulerStateMachine::ShouldUpdateVisibleTiles() const { - if (!settings_.impl_side_painting) - return false; - if (HasUpdatedVisibleTilesThisFrame()) - return false; - - // We don't want to update visible tiles right after drawing. - if (HasRequestedSwapThisFrame()) - return false; - - // There's no reason to check for tiles if we don't have an output surface. - if (!HasInitializedOutputSurface()) - return false; - - // We should not check for visible tiles until we've entered the deadline so - // we check as late as possible and give the tiles more time to initialize. - if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE) - return false; - - // If the last swap drew with checkerboard or missing tiles, we should - // poll for any new visible tiles so we can be notified to draw again - // when there are. - if (swap_used_incomplete_tile_) - return true; - - return false; -} - bool SchedulerStateMachine::ShouldAnimate() const { // If a commit occurred after our last call, we need to do animation again. if (HasAnimatedThisFrame() && !did_commit_after_animating_) @@ -534,8 +494,6 @@ bool SchedulerStateMachine::ShouldManageTiles() const { } SchedulerStateMachine::Action SchedulerStateMachine::NextAction() const { - if (ShouldUpdateVisibleTiles()) - return ACTION_UPDATE_VISIBLE_TILES; if (ShouldActivatePendingTree()) return ACTION_ACTIVATE_SYNC_TREE; if (ShouldCommit()) @@ -564,11 +522,6 @@ void SchedulerStateMachine::UpdateState(Action action) { case ACTION_NONE: return; - case ACTION_UPDATE_VISIBLE_TILES: - last_frame_number_update_visible_tiles_was_called_ = - current_frame_number_; - return; - case ACTION_ACTIVATE_SYNC_TREE: UpdateStateOnActivation(); return; @@ -767,12 +720,6 @@ bool SchedulerStateMachine::BeginFrameNeededToAnimateOrDraw() const { if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) return true; - // We need to draw a more complete frame than we did the last BeginImplFrame, - // so request another BeginImplFrame in anticipation that we will have - // additional visible tiles. - if (swap_used_incomplete_tile_) - return true; - return needs_animate_ || needs_redraw_; } @@ -963,11 +910,6 @@ void SchedulerStateMachine::DidSwapBuffers() { last_frame_number_swap_performed_ = current_frame_number_; } -void SchedulerStateMachine::SetSwapUsedIncompleteTile( - bool used_incomplete_tile) { - swap_used_incomplete_tile_ = used_incomplete_tile; -} - void SchedulerStateMachine::DidSwapBuffersComplete() { DCHECK_GT(pending_swaps_, 0); pending_swaps_--; diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h index a63a683..489ece6 100644 --- a/cc/scheduler/scheduler_state_machine.h +++ b/cc/scheduler/scheduler_state_machine.h @@ -95,7 +95,6 @@ class CC_EXPORT SchedulerStateMachine { ACTION_ANIMATE, ACTION_SEND_BEGIN_MAIN_FRAME, ACTION_COMMIT, - ACTION_UPDATE_VISIBLE_TILES, ACTION_ACTIVATE_SYNC_TREE, ACTION_DRAW_AND_SWAP_IF_POSSIBLE, ACTION_DRAW_AND_SWAP_FORCED, @@ -260,7 +259,6 @@ class CC_EXPORT SchedulerStateMachine { bool ShouldDrawForced() const; bool ShouldDraw() const; bool ShouldActivatePendingTree() const; - bool ShouldUpdateVisibleTiles() const; bool ShouldSendBeginMainFrame() const; bool ShouldCommit() const; bool ShouldManageTiles() const; @@ -268,7 +266,6 @@ class CC_EXPORT SchedulerStateMachine { void AdvanceCurrentFrameNumber(); bool HasAnimatedThisFrame() const; bool HasSentBeginMainFrameThisFrame() const; - bool HasUpdatedVisibleTilesThisFrame() const; bool HasRequestedSwapThisFrame() const; bool HasSwappedThisFrame() const; @@ -292,7 +289,6 @@ class CC_EXPORT SchedulerStateMachine { int last_frame_number_swap_performed_; int last_frame_number_swap_requested_; int last_frame_number_begin_main_frame_sent_; - int last_frame_number_update_visible_tiles_was_called_; // manage_tiles_funnel_ is "filled" each time ManageTiles is called // and "drained" on each BeginImplFrame. If the funnel gets too full, @@ -305,7 +301,6 @@ class CC_EXPORT SchedulerStateMachine { bool needs_redraw_; bool needs_animate_; bool needs_manage_tiles_; - bool swap_used_incomplete_tile_; bool needs_commit_; bool inside_poll_for_anticipated_draw_triggers_; bool visible_; diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc index 91900a2..7d61df3 100644 --- a/cc/scheduler/scheduler_unittest.cc +++ b/cc/scheduler/scheduler_unittest.cc @@ -88,8 +88,6 @@ class FakeSchedulerClient : public SchedulerClient { FakeSchedulerClient() : automatic_swap_ack_(true), - swap_contains_incomplete_tile_(false), - redraw_will_happen_if_update_visible_tiles_happens_(false), now_src_(TestNowSource::Create()), task_runner_(new OrderedSimpleTaskRunner(now_src_, true)), fake_external_begin_frame_source_(nullptr), @@ -191,10 +189,6 @@ class FakeSchedulerClient : public SchedulerClient { return -1; } - void SetSwapContainsIncompleteTile(bool contain) { - swap_contains_incomplete_tile_ = contain; - } - bool HasAction(const char* action) const { return ActionIndex(action) >= 0; } @@ -208,9 +202,6 @@ class FakeSchedulerClient : public SchedulerClient { void SetAutomaticSwapAck(bool automatic_swap_ack) { automatic_swap_ack_ = automatic_swap_ack; } - void SetRedrawWillHappenIfUpdateVisibleTilesHappens(bool redraw) { - redraw_will_happen_if_update_visible_tiles_happens_ = redraw; - } // SchedulerClient implementation. void WillBeginImplFrame(const BeginFrameArgs& args) override { actions_.push_back("WillBeginImplFrame"); @@ -234,12 +225,6 @@ class FakeSchedulerClient : public SchedulerClient { draw_will_happen_ && swap_will_happen_if_draw_happens_; if (swap_will_happen) { scheduler_->DidSwapBuffers(); - if (swap_contains_incomplete_tile_) { - scheduler_->SetSwapUsedIncompleteTile(true); - swap_contains_incomplete_tile_ = false; - } else { - scheduler_->SetSwapUsedIncompleteTile(false); - } if (automatic_swap_ack_) scheduler_->DidSwapBuffersComplete(); @@ -255,12 +240,6 @@ class FakeSchedulerClient : public SchedulerClient { actions_.push_back("ScheduledActionCommit"); states_.push_back(scheduler_->AsValue()); } - void ScheduledActionUpdateVisibleTiles() override { - actions_.push_back("ScheduledActionUpdateVisibleTiles"); - states_.push_back(scheduler_->AsValue()); - if (redraw_will_happen_if_update_visible_tiles_happens_) - scheduler_->SetNeedsRedraw(); - } void ScheduledActionActivateSyncTree() override { actions_.push_back("ScheduledActionActivateSyncTree"); states_.push_back(scheduler_->AsValue()); @@ -303,8 +282,6 @@ class FakeSchedulerClient : public SchedulerClient { bool automatic_swap_ack_; int num_draws_; bool log_anticipated_draw_time_change_; - bool swap_contains_incomplete_tile_; - bool redraw_will_happen_if_update_visible_tiles_happens_; base::TimeTicks posted_begin_impl_frame_deadline_; std::vector<const char*> actions_; std::vector<scoped_refptr<base::debug::ConvertableToTraceFormat>> states_; @@ -1012,68 +989,6 @@ TEST(SchedulerTest, ManageTilesOncePerFrame) { scheduler->DidManageTiles(); // Corresponds to ScheduledActionManageTiles } -TEST(SchedulerTest, ShouldUpdateVisibleTiles) { - FakeSchedulerClient client; - SchedulerSettings scheduler_settings; - scheduler_settings.impl_side_painting = true; - scheduler_settings.use_external_begin_frame_source = true; - TestScheduler* scheduler = client.CreateScheduler(scheduler_settings); - scheduler->SetCanStart(); - scheduler->SetVisible(true); - scheduler->SetCanDraw(true); - InitializeOutputSurfaceAndFirstCommit(scheduler, &client); - - client.SetRedrawWillHappenIfUpdateVisibleTilesHappens(true); - - // SetNeedsCommit should begin the frame. - client.Reset(); - scheduler->SetNeedsCommit(); - EXPECT_SINGLE_ACTION("SetNeedsBeginFrames(true)", client); - - client.Reset(); - client.AdvanceFrame(); - EXPECT_ACTION("WillBeginImplFrame", client, 0, 2); - EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2); - EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); - - client.Reset(); - scheduler->NotifyBeginMainFrameStarted(); - scheduler->NotifyReadyToCommit(); - EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); - - client.Reset(); - scheduler->NotifyReadyToActivate(); - EXPECT_SINGLE_ACTION("ScheduledActionActivateSyncTree", client); - - client.Reset(); - client.SetSwapContainsIncompleteTile(true); - client.task_runner().RunPendingTasks(); // Run posted deadline. - EXPECT_ACTION("ScheduledActionAnimate", client, 0, 2); - EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 1, 2); - EXPECT_FALSE(scheduler->RedrawPending()); - - client.Reset(); - client.AdvanceFrame(); - EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); - EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); - - client.Reset(); - client.task_runner().RunPendingTasks(); // Run posted deadline. - EXPECT_ACTION("ScheduledActionUpdateVisibleTiles", client, 0, 3); - EXPECT_ACTION("ScheduledActionAnimate", client, 1, 3); - EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 2, 3); - - client.Reset(); - client.AdvanceFrame(); - EXPECT_SINGLE_ACTION("WillBeginImplFrame", client); - EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); - - // No more UpdateVisibleTiles(). - client.Reset(); - client.task_runner().RunPendingTasks(); // Run posted deadline. - EXPECT_SINGLE_ACTION("SetNeedsBeginFrames(false)", client); -} - TEST(SchedulerTest, TriggerBeginFrameDeadlineEarly) { SchedulerClientNeedsManageTilesInDraw client; SchedulerSettings scheduler_settings; diff --git a/cc/test/fake_layer_tree_host_impl_client.h b/cc/test/fake_layer_tree_host_impl_client.h index 3c44994..ced02a6 100644 --- a/cc/test/fake_layer_tree_host_impl_client.h +++ b/cc/test/fake_layer_tree_host_impl_client.h @@ -27,7 +27,6 @@ class FakeLayerTreeHostImplClient : public LayerTreeHostImplClient { void SetNeedsRedrawOnImplThread() override {} void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) override {} void SetNeedsAnimateOnImplThread() override {} - void DidInitializeVisibleTileOnImplThread() override {} void SetNeedsCommitOnImplThread() override {} void SetNeedsManageTilesOnImplThread() override {} void PostAnimationEventsToMainThreadOnImplThread( diff --git a/cc/test/fake_picture_layer.cc b/cc/test/fake_picture_layer.cc index bd169ba..1a19bc7 100644 --- a/cc/test/fake_picture_layer.cc +++ b/cc/test/fake_picture_layer.cc @@ -12,8 +12,19 @@ FakePictureLayer::FakePictureLayer(ContentLayerClient* client) : PictureLayer(client), update_count_(0), push_properties_count_(0), - always_update_resources_(false), - output_surface_created_count_(0) { + output_surface_created_count_(0), + always_update_resources_(false) { + SetBounds(gfx::Size(1, 1)); + SetIsDrawable(true); +} + +FakePictureLayer::FakePictureLayer(ContentLayerClient* client, + scoped_ptr<RecordingSource> source) + : PictureLayer(client, source.Pass()), + update_count_(0), + push_properties_count_(0), + output_surface_created_count_(0), + always_update_resources_(false) { SetBounds(gfx::Size(1, 1)); SetIsDrawable(true); } diff --git a/cc/test/fake_picture_layer.h b/cc/test/fake_picture_layer.h index 7aa155e..f42a14d 100644 --- a/cc/test/fake_picture_layer.h +++ b/cc/test/fake_picture_layer.h @@ -8,15 +8,21 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "cc/layers/picture_layer.h" +#include "cc/resources/recording_source.h" namespace cc { - class FakePictureLayer : public PictureLayer { public: static scoped_refptr<FakePictureLayer> Create(ContentLayerClient* client) { return make_scoped_refptr(new FakePictureLayer(client)); } + static scoped_refptr<FakePictureLayer> CreateWithRecordingSource( + ContentLayerClient* client, + scoped_ptr<RecordingSource> source) { + return make_scoped_refptr(new FakePictureLayer(client, source.Pass())); + } + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; size_t update_count() const { return update_count_; } @@ -41,12 +47,14 @@ class FakePictureLayer : public PictureLayer { private: explicit FakePictureLayer(ContentLayerClient* client); + FakePictureLayer(ContentLayerClient* client, + scoped_ptr<RecordingSource> source); ~FakePictureLayer() override; size_t update_count_; size_t push_properties_count_; - bool always_update_resources_; size_t output_surface_created_count_; + bool always_update_resources_; }; } // namespace cc diff --git a/cc/test/fake_picture_pile.cc b/cc/test/fake_picture_pile.cc new file mode 100644 index 0000000..912ec06 --- /dev/null +++ b/cc/test/fake_picture_pile.cc @@ -0,0 +1,15 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "cc/test/fake_picture_pile.h" + +#include "cc/test/fake_picture_pile_impl.h" + +namespace cc { + +scoped_refptr<RasterSource> FakePicturePile::CreateRasterSource() const { + return FakePicturePileImpl::CreateFromPile(this, playback_allowed_event_); +} + +} // namespace cc diff --git a/cc/test/fake_picture_pile.h b/cc/test/fake_picture_pile.h index e486e3b..2d8f4bf 100644 --- a/cc/test/fake_picture_pile.h +++ b/cc/test/fake_picture_pile.h @@ -7,12 +7,20 @@ #include "cc/resources/picture_pile.h" +namespace base { +class WaitableEvent; +} + namespace cc { class FakePicturePile : public PicturePile { public: + FakePicturePile() : playback_allowed_event_(nullptr) {} ~FakePicturePile() override {} + // PicturePile overrides. + scoped_refptr<RasterSource> CreateRasterSource() const override; + using PicturePile::buffer_pixels; using PicturePile::CanRasterSlowTileCheck; using PicturePile::Clear; @@ -37,6 +45,10 @@ class FakePicturePile : public PicturePile { has_any_recordings_ = has_recordings; } + void SetPlaybackAllowedEvent(base::WaitableEvent* event) { + playback_allowed_event_ = event; + } + TilingData& tiling() { return tiling_; } bool is_solid_color() const { return is_solid_color_; } @@ -47,7 +59,11 @@ class FakePicturePile : public PicturePile { typedef PicturePile::PictureInfo PictureInfo; typedef PicturePile::PictureMapKey PictureMapKey; typedef PicturePile::PictureMap PictureMap; + + private: + base::WaitableEvent* playback_allowed_event_; }; + } // namespace cc #endif // CC_TEST_FAKE_PICTURE_PILE_H_ diff --git a/cc/test/fake_picture_pile_impl.cc b/cc/test/fake_picture_pile_impl.cc index 3d31c12..cb68e87 100644 --- a/cc/test/fake_picture_pile_impl.cc +++ b/cc/test/fake_picture_pile_impl.cc @@ -8,6 +8,7 @@ #include <limits> #include <utility> +#include "base/synchronization/waitable_event.h" #include "cc/resources/picture_pile.h" #include "cc/test/fake_picture_pile.h" #include "cc/test/impl_side_painting_settings.h" @@ -15,10 +16,14 @@ namespace cc { -FakePicturePileImpl::FakePicturePileImpl() {} +FakePicturePileImpl::FakePicturePileImpl() : playback_allowed_event_(nullptr) { +} -FakePicturePileImpl::FakePicturePileImpl(const PicturePile* other) +FakePicturePileImpl::FakePicturePileImpl( + const PicturePile* other, + base::WaitableEvent* playback_allowed_event) : PicturePileImpl(other), + playback_allowed_event_(playback_allowed_event), tile_grid_info_(other->GetTileGridInfoForTesting()) { } @@ -34,7 +39,7 @@ scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFilledPile( pile.SetRecordedViewport(gfx::Rect(layer_bounds)); pile.SetHasAnyRecordings(true); - auto pile_impl = make_scoped_refptr(new FakePicturePileImpl(&pile)); + auto pile_impl = make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr)); for (int x = 0; x < pile_impl->tiling().num_tiles_x(); ++x) { for (int y = 0; y < pile_impl->tiling().num_tiles_y(); ++y) pile_impl->AddRecordingAt(x, y); @@ -51,7 +56,7 @@ scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateEmptyPile( pile.SetTileGridSize(ImplSidePaintingSettings().default_tile_grid_size); pile.SetRecordedViewport(gfx::Rect()); pile.SetHasAnyRecordings(false); - return make_scoped_refptr(new FakePicturePileImpl(&pile)); + return make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr)); } scoped_refptr<FakePicturePileImpl> @@ -65,7 +70,7 @@ FakePicturePileImpl::CreateEmptyPileThatThinksItHasRecordings( // This simulates a false positive for this flag. pile.SetRecordedViewport(gfx::Rect()); pile.SetHasAnyRecordings(true); - return make_scoped_refptr(new FakePicturePileImpl(&pile)); + return make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr)); } scoped_refptr<FakePicturePileImpl> @@ -79,11 +84,26 @@ FakePicturePileImpl::CreateInfiniteFilledPile() { pile.SetRecordedViewport(gfx::Rect(size)); pile.SetHasAnyRecordings(true); - auto pile_impl = make_scoped_refptr(new FakePicturePileImpl(&pile)); + auto pile_impl = make_scoped_refptr(new FakePicturePileImpl(&pile, nullptr)); pile_impl->AddRecordingAt(0, 0); return pile_impl; } +scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFromPile( + const PicturePile* other, + base::WaitableEvent* playback_allowed_event) { + return make_scoped_refptr( + new FakePicturePileImpl(other, playback_allowed_event)); +} + +void FakePicturePileImpl::PlaybackToCanvas(SkCanvas* canvas, + const gfx::Rect& canvas_rect, + float contents_scale) const { + if (playback_allowed_event_) + playback_allowed_event_->Wait(); + PicturePileImpl::PlaybackToCanvas(canvas, canvas_rect, contents_scale); +} + void FakePicturePileImpl::AddRecordingAt(int x, int y) { EXPECT_GE(x, 0); EXPECT_GE(y, 0); diff --git a/cc/test/fake_picture_pile_impl.h b/cc/test/fake_picture_pile_impl.h index f1a9d31..c32684c 100644 --- a/cc/test/fake_picture_pile_impl.h +++ b/cc/test/fake_picture_pile_impl.h @@ -9,6 +9,10 @@ #include "cc/resources/picture_pile_impl.h" #include "cc/test/fake_content_layer_client.h" +namespace base { +class WaitableEvent; +} + namespace cc { class FakePicturePileImpl : public PicturePileImpl { @@ -23,6 +27,14 @@ class FakePicturePileImpl : public PicturePileImpl { CreateEmptyPileThatThinksItHasRecordings(const gfx::Size& tile_size, const gfx::Size& layer_bounds); static scoped_refptr<FakePicturePileImpl> CreateInfiniteFilledPile(); + static scoped_refptr<FakePicturePileImpl> CreateFromPile( + const PicturePile* other, + base::WaitableEvent* playback_allowed_event); + + // Hi-jack the PlaybackToCanvas method to delay its completion. + void PlaybackToCanvas(SkCanvas* canvas, + const gfx::Rect& canvas_rect, + float contents_scale) const override; TilingData& tiling() { return tiling_; } @@ -84,11 +96,13 @@ class FakePicturePileImpl : public PicturePileImpl { protected: FakePicturePileImpl(); - explicit FakePicturePileImpl(const PicturePile* other); + FakePicturePileImpl(const PicturePile* other, + base::WaitableEvent* playback_allowed_event); ~FakePicturePileImpl() override; FakeContentLayerClient client_; SkPaint default_paint_; + base::WaitableEvent* playback_allowed_event_; SkTileGridFactory::TileGridInfo tile_grid_info_; }; diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 2dd86f7..89cc554 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc @@ -259,22 +259,17 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl { LayerTreeHostImpl::ReclaimResources(ack); } - void UpdateVisibleTiles() override { - LayerTreeHostImpl::UpdateVisibleTiles(); - test_hooks_->UpdateVisibleTilesOnThread(this); - } - void NotifyReadyToActivate() override { if (block_notify_ready_to_activate_for_testing_) { notify_ready_to_activate_was_blocked_ = true; } else { - client_->NotifyReadyToActivate(); + LayerTreeHostImpl::NotifyReadyToActivate(); test_hooks_->NotifyReadyToActivateOnThread(this); } } void NotifyReadyToDraw() override { - client_->NotifyReadyToDraw(); + LayerTreeHostImpl::NotifyReadyToDraw(); test_hooks_->NotifyReadyToDrawOnThread(this); } @@ -327,6 +322,11 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl { test_hooks_->UpdateAnimationState(this, has_unfinished_animation); } + void NotifyTileStateChanged(const Tile* tile) override { + LayerTreeHostImpl::NotifyTileStateChanged(tile); + test_hooks_->NotifyTileStateChangedOnThread(this, tile); + } + private: TestHooks* test_hooks_; bool block_notify_ready_to_activate_for_testing_; @@ -513,7 +513,7 @@ void LayerTreeTest::EndTest() { } } -void LayerTreeTest::EndTestAfterDelay(int delay_milliseconds) { +void LayerTreeTest::EndTestAfterDelayMs(int delay_milliseconds) { main_task_runner_->PostDelayedTask( FROM_HERE, base::Bind(&LayerTreeTest::EndTest, main_thread_weak_ptr_), diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h index 531e28d..b801d94 100644 --- a/cc/test/layer_tree_test.h +++ b/cc/test/layer_tree_test.h @@ -57,9 +57,10 @@ class TestHooks : public AnimationDelegate { virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) {} virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) {} virtual void SwapBuffersCompleteOnThread(LayerTreeHostImpl* host_impl) {} - virtual void UpdateVisibleTilesOnThread(LayerTreeHostImpl* host_impl) {} virtual void NotifyReadyToActivateOnThread(LayerTreeHostImpl* host_impl) {} virtual void NotifyReadyToDrawOnThread(LayerTreeHostImpl* host_impl) {} + virtual void NotifyTileStateChangedOnThread(LayerTreeHostImpl* host_impl, + const Tile* tile) {} virtual void AnimateLayers(LayerTreeHostImpl* host_impl, base::TimeTicks monotonic_time) {} virtual void UpdateAnimationState(LayerTreeHostImpl* host_impl, @@ -130,7 +131,7 @@ class LayerTreeTest : public testing::Test, public TestHooks { virtual ~LayerTreeTest(); virtual void EndTest(); - void EndTestAfterDelay(int delay_milliseconds); + void EndTestAfterDelayMs(int delay_milliseconds); void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 696da7a..ffe2ddb 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -174,8 +174,8 @@ size_t GetMaxStagingResourceCount() { } // namespace -LayerTreeHostImpl::FrameData::FrameData() - : contains_incomplete_tile(false), has_no_damage(false) {} +LayerTreeHostImpl::FrameData::FrameData() : has_no_damage(false) { +} LayerTreeHostImpl::FrameData::~FrameData() {} @@ -239,11 +239,11 @@ LayerTreeHostImpl::LayerTreeHostImpl( animation_registrar_(AnimationRegistrar::Create()), rendering_stats_instrumentation_(rendering_stats_instrumentation), micro_benchmark_controller_(this), - need_to_update_visible_tiles_before_draw_(false), shared_bitmap_manager_(shared_bitmap_manager), gpu_memory_buffer_manager_(gpu_memory_buffer_manager), id_(id), - requires_high_res_to_draw_(false) { + requires_high_res_to_draw_(false), + required_for_draw_tile_is_top_of_raster_queue_(false) { DCHECK(proxy_->IsImplThread()); DidVisibilityChange(this, visible_); animation_registrar_->set_supports_scroll_animations( @@ -489,7 +489,6 @@ void LayerTreeHostImpl::TrackDamageForAllSurfaces( void LayerTreeHostImpl::FrameData::AsValueInto( base::debug::TracedValue* value) const { - value->SetBoolean("contains_incomplete_tile", contains_incomplete_tile); value->SetBoolean("has_no_damage", has_no_damage); // Quad data can be quite large, so only dump render passes if we select @@ -839,7 +838,6 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses( if (append_quads_data.num_incomplete_tiles || append_quads_data.num_missing_tiles) { - frame->contains_incomplete_tile = true; if (RequiresHighResToDraw()) draw_result = DRAW_ABORTED_MISSING_HIGH_RES_CONTENT; } @@ -1034,12 +1032,11 @@ DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) { "LayerTreeHostImpl::PrepareToDraw", "SourceFrameNumber", active_tree_->source_frame_number()); - - if (need_to_update_visible_tiles_before_draw_ && - tile_manager_ && tile_manager_->UpdateVisibleTiles()) { - DidInitializeVisibleTile(); - } - need_to_update_visible_tiles_before_draw_ = true; + // This will cause NotifyTileStateChanged() to be called for any visible tiles + // that completed, which will add damage to the frame for them so they appear + // as part of the current frame being drawn. + if (settings().impl_side_painting) + tile_manager_->UpdateVisibleTiles(); UMA_HISTOGRAM_CUSTOM_COUNTS( "Compositing.NumActiveLayers", active_tree_->NumLayers(), 1, 400, 20); @@ -1051,7 +1048,6 @@ DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) { frame->render_passes.clear(); frame->render_passes_by_id.clear(); frame->will_draw_layers.clear(); - frame->contains_incomplete_tile = false; frame->has_no_damage = false; if (active_tree_->root_layer()) { @@ -1082,13 +1078,6 @@ void LayerTreeHostImpl::BlockNotifyReadyToActivateForTesting(bool block) { NOTREACHED(); } -void LayerTreeHostImpl::DidInitializeVisibleTileForTesting() { - // Add arbitrary damage, to trigger prepare-to-draws. - // Here, setting damage as viewport size, used only for testing. - SetFullRootLayerDamage(); - DidInitializeVisibleTile(); -} - void LayerTreeHostImpl::ResetTreesForTesting() { if (active_tree_) active_tree_->DetachLayerTree(); @@ -1180,11 +1169,6 @@ void LayerTreeHostImpl::DidModifyTilePriorities() { client_->SetNeedsManageTilesOnImplThread(); } -void LayerTreeHostImpl::DidInitializeVisibleTile() { - if (client_ && !client_->IsInsideDraw()) - client_->DidInitializeVisibleTileOnImplThread(); -} - void LayerTreeHostImpl::GetPictureLayerImplPairs( std::vector<PictureLayerImpl::Pair>* layer_pairs, bool need_valid_tile_priorities) const { @@ -1225,6 +1209,20 @@ void LayerTreeHostImpl::BuildRasterQueue(RasterTilePriorityQueue* queue, picture_layer_pairs_.clear(); GetPictureLayerImplPairs(&picture_layer_pairs_, true); queue->Build(picture_layer_pairs_, tree_priority); + + if (!queue->IsEmpty()) { + // Only checking the Top() tile here isn't a definite answer that there is + // or isn't something required for draw in this raster queue. It's just a + // heuristic to let us hit the common case and proactively tell the + // scheduler that we expect to draw within each vsync until we get all the + // tiles ready to draw. If we happen to miss a required for draw tile here, + // then we will miss telling the scheduler each frame that we intend to draw + // so it may make worse scheduling decisions. + required_for_draw_tile_is_top_of_raster_queue_ = + queue->Top()->required_for_draw(); + } else { + required_for_draw_tile_is_top_of_raster_queue_ = false; + } } void LayerTreeHostImpl::BuildEvictionQueue(EvictionTilePriorityQueue* queue, @@ -1245,6 +1243,11 @@ void LayerTreeHostImpl::NotifyReadyToActivate() { } void LayerTreeHostImpl::NotifyReadyToDraw() { + // Tiles that are ready will cause NotifyTileStateChanged() to be called so we + // don't need to schedule a draw here. Just stop WillBeginImplFrame() from + // causing optimistic requests to draw a frame. + required_for_draw_tile_is_top_of_raster_queue_ = false; + client_->NotifyReadyToDraw(); } @@ -1264,6 +1267,13 @@ void LayerTreeHostImpl::NotifyTileStateChanged(const Tile* tile) { if (layer_impl) layer_impl->NotifyTileStateChanged(tile); } + + // Check for a non-null active tree to avoid doing this during shutdown. + if (active_tree_ && !client_->IsInsideDraw() && tile->required_for_draw()) { + // The LayerImpl::NotifyTileStateChanged() should damage the layer, so this + // redraw will make those tiles be displayed. + SetNeedsRedraw(); + } } void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { @@ -1602,6 +1612,13 @@ void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) { UpdateCurrentBeginFrameArgs(args); // Cache the begin impl frame interval begin_impl_frame_interval_ = args.interval; + + if (required_for_draw_tile_is_top_of_raster_queue_) { + // Optimistically schedule a draw, as a tile required for draw is at the top + // of the current raster queue. This will let us expect the tile to complete + // and draw it within the impl frame we are beginning now. + SetNeedsRedraw(); + } } void LayerTreeHostImpl::UpdateViewportContainerSizes() { @@ -1729,15 +1746,7 @@ void LayerTreeHostImpl::CreatePendingTree() { TRACE_EVENT_ASYNC_BEGIN0("cc", "PendingTree:waiting", pending_tree_.get()); } -void LayerTreeHostImpl::UpdateVisibleTiles() { - if (tile_manager_ && tile_manager_->UpdateVisibleTiles()) - DidInitializeVisibleTile(); - need_to_update_visible_tiles_before_draw_ = false; -} - void LayerTreeHostImpl::ActivateSyncTree() { - need_to_update_visible_tiles_before_draw_ = true; - if (pending_tree_) { TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get()); @@ -1940,7 +1949,6 @@ void LayerTreeHostImpl::CreateAndSetTileManager() { scheduled_raster_task_limit); UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); - need_to_update_visible_tiles_before_draw_ = false; } void LayerTreeHostImpl::CreateResourceAndRasterWorkerPool( @@ -2940,9 +2948,6 @@ void LayerTreeHostImpl::PinchGestureEnd() { // scales that we want when we're not inside a pinch. active_tree_->set_needs_update_draw_properties(); SetNeedsRedraw(); - // TODO(danakj): Don't set root damage. Just updating draw properties and - // getting new tiles rastered should be enough! crbug.com/427423 - SetFullRootLayerDamage(); } static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 24cb730..ba4fabf 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -82,7 +82,6 @@ class LayerTreeHostImplClient { virtual void SetNeedsRedrawOnImplThread() = 0; virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0; virtual void SetNeedsAnimateOnImplThread() = 0; - virtual void DidInitializeVisibleTileOnImplThread() = 0; virtual void SetNeedsCommitOnImplThread() = 0; virtual void SetNeedsManageTilesOnImplThread() = 0; virtual void PostAnimationEventsToMainThreadOnImplThread( @@ -172,7 +171,6 @@ class CC_EXPORT LayerTreeHostImpl RenderPassIdHashMap render_passes_by_id; const LayerImplList* render_surface_layer_list; LayerImplList will_draw_layers; - bool contains_incomplete_tile; bool has_no_damage; // RenderPassSink implementation. @@ -210,9 +208,6 @@ class CC_EXPORT LayerTreeHostImpl // immediately if any notifications had been blocked while blocking. virtual void BlockNotifyReadyToActivateForTesting(bool block); - // This allows us to inject DidInitializeVisibleTile events for testing. - void DidInitializeVisibleTileForTesting(); - // Resets all of the trees to an empty state. void ResetTreesForTesting(); @@ -302,7 +297,6 @@ class CC_EXPORT LayerTreeHostImpl return pending_tree_ ? pending_tree_.get() : active_tree_.get(); } virtual void CreatePendingTree(); - virtual void UpdateVisibleTiles(); virtual void ActivateSyncTree(); // Shortcuts to layers on the active tree. @@ -574,8 +568,6 @@ class CC_EXPORT LayerTreeHostImpl bool zero_budget); void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy); - void DidInitializeVisibleTile(); - void MarkUIResourceNotEvicted(UIResourceId uid); void NotifySwapPromiseMonitorsOfSetNeedsRedraw(); @@ -699,8 +691,6 @@ class CC_EXPORT LayerTreeHostImpl MicroBenchmarkControllerImpl micro_benchmark_controller_; scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; - bool need_to_update_visible_tiles_before_draw_; - // Optional callback to notify of new tree activations. base::Closure tree_activation_callback_; @@ -714,6 +704,7 @@ class CC_EXPORT LayerTreeHostImpl std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; bool requires_high_res_to_draw_; + bool required_for_draw_tile_is_top_of_raster_queue_; DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); }; diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index b49fa0f..e128013 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -91,7 +91,6 @@ class LayerTreeHostImplTest : public testing::Test, did_request_redraw_(false), did_request_animate_(false), did_request_manage_tiles_(false), - did_upload_visible_tile_(false), reduce_memory_result_(true), current_limit_bytes_(0), current_priority_cutoff_value_(0) { @@ -138,9 +137,6 @@ class LayerTreeHostImplTest : public testing::Test, void SetNeedsManageTilesOnImplThread() override { did_request_manage_tiles_ = true; } - void DidInitializeVisibleTileOnImplThread() override { - did_upload_visible_tile_ = true; - } void SetNeedsCommitOnImplThread() override { did_request_commit_ = true; } void PostAnimationEventsToMainThreadOnImplThread( scoped_ptr<AnimationEventsVector> events) override {} @@ -399,7 +395,6 @@ class LayerTreeHostImplTest : public testing::Test, bool did_request_redraw_; bool did_request_animate_; bool did_request_manage_tiles_; - bool did_upload_visible_tile_; bool reduce_memory_result_; base::Closure scrollbar_fade_start_; base::TimeDelta requested_scrollbar_animation_delay_; diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 58859ba..4e2363a 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -26,6 +26,7 @@ #include "cc/output/output_surface.h" #include "cc/quads/draw_quad.h" #include "cc/quads/io_surface_draw_quad.h" +#include "cc/quads/tile_draw_quad.h" #include "cc/resources/prioritized_resource.h" #include "cc/resources/prioritized_resource_manager.h" #include "cc/resources/resource_update_queue.h" @@ -37,6 +38,7 @@ #include "cc/test/fake_painted_scrollbar_layer.h" #include "cc/test/fake_picture_layer.h" #include "cc/test/fake_picture_layer_impl.h" +#include "cc/test/fake_picture_pile.h" #include "cc/test/fake_proxy.h" #include "cc/test/fake_scoped_ui_resource.h" #include "cc/test/fake_video_frame_provider.h" @@ -5022,7 +5024,8 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest { void SetupTree() override { LayerTreeHostTest::SetupTree(); - scoped_refptr<PictureLayer> layer = PictureLayer::Create(&layer_client_); + scoped_refptr<FakePictureLayer> layer = + FakePictureLayer::Create(&layer_client_); layer->SetBounds(gfx::Size(10, 10)); layer->SetIsDrawable(true); layer_tree_host()->root_layer()->AddChild(layer); @@ -5352,4 +5355,354 @@ class LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer }; MULTI_THREAD_TEST_F(LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer); + +class LayerTreeHostTestCrispUpAfterPinchEnds : public LayerTreeHostTest { + protected: + LayerTreeHostTestCrispUpAfterPinchEnds() + : playback_allowed_event_(true, true) {} + + void InitializeSettings(LayerTreeSettings* settings) override { + settings->impl_side_painting = true; + } + + void SetupTree() override { + frame_ = 1; + posted_ = false; + client_.set_fill_with_nonsolid_color(true); + + scoped_refptr<Layer> root = Layer::Create(); + root->SetBounds(gfx::Size(500, 500)); + + scoped_refptr<Layer> pinch = Layer::Create(); + pinch->SetBounds(gfx::Size(500, 500)); + pinch->SetScrollClipLayerId(root->id()); + pinch->SetIsContainerForFixedPositionLayers(true); + root->AddChild(pinch); + + scoped_ptr<FakePicturePile> pile(new FakePicturePile); + pile->SetPlaybackAllowedEvent(&playback_allowed_event_); + scoped_refptr<FakePictureLayer> layer = + FakePictureLayer::CreateWithRecordingSource(&client_, pile.Pass()); + layer->SetBounds(gfx::Size(500, 500)); + layer->SetContentsOpaque(true); + pinch->AddChild(layer); + + layer_tree_host()->RegisterViewportLayers(root, pinch, pinch); + layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f); + layer_tree_host()->SetRootLayer(root); + LayerTreeHostTest::SetupTree(); + } + + // Returns the delta scale of all quads in the frame's root pass from their + // ideal, or 0 if they are not all the same. + float FrameQuadScaleDeltaFromIdeal(LayerTreeHostImpl::FrameData* frame_data) { + if (frame_data->has_no_damage) + return 0.f; + float frame_scale = 0.f; + RenderPass* root_pass = frame_data->render_passes.back(); + for (const auto& draw_quad : root_pass->quad_list) { + // Checkerboards mean an incomplete frame. + if (draw_quad->material != DrawQuad::TILED_CONTENT) + return 0.f; + const TileDrawQuad* quad = TileDrawQuad::MaterialCast(draw_quad); + float quad_scale = + quad->tex_coord_rect.width() / static_cast<float>(quad->rect.width()); + float transform_scale = + SkMScalarToFloat(quad->quadTransform().matrix().get(0, 0)); + float scale = quad_scale / transform_scale; + if (frame_scale != 0.f && frame_scale != scale) + return 0.f; + frame_scale = scale; + } + return frame_scale; + } + + void BeginTest() override { PostSetNeedsCommitToMainThread(); } + + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { + float quad_scale_delta = FrameQuadScaleDeltaFromIdeal(frame_data); + switch (frame_) { + case 1: + // Drew at page scale 1 before any pinching. + EXPECT_EQ(1.f, host_impl->active_tree()->total_page_scale_factor()); + EXPECT_EQ(1.f, quad_scale_delta); + PostNextAfterDraw(host_impl); + break; + case 2: + if (quad_scale_delta != 1.f) + break; + // Drew at page scale 2.2 after pinching in. + EXPECT_EQ(2.2f, host_impl->active_tree()->total_page_scale_factor()); + EXPECT_EQ(1.f, quad_scale_delta); + PostNextAfterDraw(host_impl); + break; + case 3: + if (quad_scale_delta != 2.2f) + break; + // Drew at page scale 1 with the 2.2 tiling while pinching out. + EXPECT_EQ(1.f, host_impl->active_tree()->total_page_scale_factor()); + EXPECT_EQ(2.2f, quad_scale_delta); + PostNextAfterDraw(host_impl); + break; + case 4: + // Drew at page scale 1 with the 2.2 tiling after pinching out completed + // while waiting for texture uploads to complete. + EXPECT_EQ(1.f, host_impl->active_tree()->total_page_scale_factor()); + // This frame will not have any damage, since it's actually the same as + // the last frame, and should contain no incomplete tiles. We just want + // to make sure we drew here at least once after the pinch ended to be + // sure that drawing after pinch doesn't leave us at the wrong scale + // forever. + EXPECT_TRUE(frame_data->has_no_damage); + PostNextAfterDraw(host_impl); + break; + case 5: + if (quad_scale_delta != 1.f) + break; + // Drew at scale 1 after texture uploads are done. + EXPECT_EQ(1.f, host_impl->active_tree()->total_page_scale_factor()); + EXPECT_EQ(1.f, quad_scale_delta); + EndTest(); + break; + } + return draw_result; + } + + void PostNextAfterDraw(LayerTreeHostImpl* host_impl) { + if (posted_) + return; + posted_ = true; + ImplThreadTaskRunner()->PostDelayedTask( + FROM_HERE, base::Bind(&LayerTreeHostTestCrispUpAfterPinchEnds::Next, + base::Unretained(this), host_impl), + // Use a delay to allow raster/upload to happen in between frames. This + // should cause flakiness if we fail to block raster/upload when + // desired. + base::TimeDelta::FromMilliseconds(16 * 6)); + } + + void Next(LayerTreeHostImpl* host_impl) { + ++frame_; + posted_ = false; + switch (frame_) { + case 2: + // Pinch zoom in. + host_impl->PinchGestureBegin(); + host_impl->PinchGestureUpdate(2.2f, gfx::Point(100, 100)); + host_impl->PinchGestureEnd(); + break; + case 3: + // Pinch zoom back to 1.f but don't end it. + host_impl->PinchGestureBegin(); + host_impl->PinchGestureUpdate(1.f / 2.2f, gfx::Point(100, 100)); + break; + case 4: + // End the pinch, but delay tile production. + playback_allowed_event_.Reset(); + host_impl->PinchGestureEnd(); + break; + case 5: + // Let tiles complete. + playback_allowed_event_.Signal(); + break; + } + } + + void NotifyTileStateChangedOnThread(LayerTreeHostImpl* host_impl, + const Tile* tile) override { + // On frame_ == 4, we are preventing texture uploads from completing, + // so this verifies they are not completing before frame_ == 5. + // Flaky failures here indicate we're failing to prevent uploads from + // completing. + EXPECT_NE(4, frame_); + } + + void AfterTest() override {} + + FakeContentLayerClient client_; + int frame_; + bool posted_; + base::WaitableEvent playback_allowed_event_; +}; + +MULTI_THREAD_TEST_F(LayerTreeHostTestCrispUpAfterPinchEnds); + +class LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy + : public LayerTreeHostTestCrispUpAfterPinchEnds { + protected: + void InitializeSettings(LayerTreeSettings* settings) override { + settings->impl_side_painting = true; + settings->use_one_copy = true; + } + + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { + scoped_ptr<TestWebGraphicsContext3D> context3d = + TestWebGraphicsContext3D::Create(); + context3d->set_support_image(true); + context3d->set_support_sync_query(true); + + if (delegating_renderer()) + return FakeOutputSurface::CreateDelegating3d(context3d.Pass()); + else + return FakeOutputSurface::Create3d(context3d.Pass()); + } +}; + +MULTI_THREAD_TEST_F(LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy); + +class LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles + : public LayerTreeHostTest { + protected: + LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles() + : playback_allowed_event_(true, true) {} + + void InitializeSettings(LayerTreeSettings* settings) override { + settings->impl_side_painting = true; + } + + void SetupTree() override { + step_ = 1; + continuous_draws_ = 0; + client_.set_fill_with_nonsolid_color(true); + + scoped_refptr<Layer> root = Layer::Create(); + root->SetBounds(gfx::Size(500, 500)); + + scoped_refptr<Layer> pinch = Layer::Create(); + pinch->SetBounds(gfx::Size(500, 500)); + pinch->SetScrollClipLayerId(root->id()); + pinch->SetIsContainerForFixedPositionLayers(true); + root->AddChild(pinch); + + scoped_ptr<FakePicturePile> pile(new FakePicturePile); + pile->SetPlaybackAllowedEvent(&playback_allowed_event_); + scoped_refptr<FakePictureLayer> layer = + FakePictureLayer::CreateWithRecordingSource(&client_, pile.Pass()); + layer->SetBounds(gfx::Size(500, 500)); + layer->SetContentsOpaque(true); + pinch->AddChild(layer); + + layer_tree_host()->RegisterViewportLayers(root, pinch, pinch); + layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f); + layer_tree_host()->SetRootLayer(root); + LayerTreeHostTest::SetupTree(); + } + + // Returns the delta scale of all quads in the frame's root pass from their + // ideal, or 0 if they are not all the same. + float FrameQuadScaleDeltaFromIdeal(LayerTreeHostImpl::FrameData* frame_data) { + if (frame_data->has_no_damage) + return 0.f; + float frame_scale = 0.f; + RenderPass* root_pass = frame_data->render_passes.back(); + for (const auto& draw_quad : root_pass->quad_list) { + const TileDrawQuad* quad = TileDrawQuad::MaterialCast(draw_quad); + float quad_scale = + quad->tex_coord_rect.width() / static_cast<float>(quad->rect.width()); + float transform_scale = + SkMScalarToFloat(quad->quadTransform().matrix().get(0, 0)); + float scale = quad_scale / transform_scale; + if (frame_scale != 0.f && frame_scale != scale) + return 0.f; + frame_scale = scale; + } + return frame_scale; + } + + void BeginTest() override { PostSetNeedsCommitToMainThread(); } + + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { + float quad_scale_delta = FrameQuadScaleDeltaFromIdeal(frame_data); + switch (step_) { + case 1: + // Drew at scale 1 before any pinching. + EXPECT_EQ(1.f, host_impl->active_tree()->total_page_scale_factor()); + EXPECT_EQ(1.f, quad_scale_delta); + break; + case 2: + if (quad_scale_delta != 1.f / 1.5f) + break; + // Drew at scale 1 still though the ideal is 1.5. + EXPECT_EQ(1.5f, host_impl->active_tree()->total_page_scale_factor()); + EXPECT_EQ(1.f / 1.5f, quad_scale_delta); + break; + case 3: + // Continuous draws are attempted. + EXPECT_EQ(1.5f, host_impl->active_tree()->total_page_scale_factor()); + if (!frame_data->has_no_damage) + EXPECT_EQ(1.f / 1.5f, quad_scale_delta); + break; + case 4: + if (quad_scale_delta != 1.f) + break; + // Drew at scale 1.5 when all the tiles completed. + EXPECT_EQ(1.5f, host_impl->active_tree()->total_page_scale_factor()); + EXPECT_EQ(1.f, quad_scale_delta); + + // We should not continue to draw any more. End the test after a timeout + // to watch for any extraneous draws. + // TODO(brianderson): We could remove this delay and instead wait until + // the BeginFrameSource decides it doesn't need to send frames anymore, + // or test that it already doesn't here. + EndTestAfterDelayMs(16 * 4); + ++step_; + break; + case 5: + ADD_FAILURE() + << "No draws should happen once we have a complete frame."; + break; + } + return draw_result; + } + + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + switch (step_) { + case 1: + // Delay tile production. + playback_allowed_event_.Reset(); + // Pinch zoom in to cause new tiles to be required. + host_impl->PinchGestureBegin(); + host_impl->PinchGestureUpdate(1.5f, gfx::Point(100, 100)); + host_impl->PinchGestureEnd(); + ++step_; + break; + case 2: + ++step_; + break; + case 3: + // We should continue to try draw while there are incomplete visible + // tiles. + if (++continuous_draws_ > 5) { + // Allow the tiles to complete. + playback_allowed_event_.Signal(); + ++step_; + } + break; + } + } + + void NotifyTileStateChangedOnThread(LayerTreeHostImpl* host_impl, + const Tile* tile) override { + // On step_ == 2, we are preventing texture uploads from completing, + // so this verifies they are not completing before step_ == 3. + // Flaky failures here indicate we're failing to prevent uploads from + // completing. + EXPECT_NE(2, step_); + } + + void AfterTest() override { EXPECT_GT(continuous_draws_, 5); } + + FakeContentLayerClient client_; + int step_; + int continuous_draws_; + base::WaitableEvent playback_allowed_event_; +}; + +MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles); + } // namespace cc diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc index d541751..d34cd4d 100644 --- a/cc/trees/layer_tree_host_unittest_damage.cc +++ b/cc/trees/layer_tree_host_unittest_damage.cc @@ -529,98 +529,5 @@ class LayerTreeHostDamageTestScrollbarCommitDoesNoDamage MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarCommitDoesNoDamage); -class LayerTreeHostDamageTestVisibleTilesStillTriggerDraws - : public LayerTreeHostDamageTest { - void InitializeSettings(LayerTreeSettings* settings) override { - settings->impl_side_painting = true; - } - - void BeginTest() override { PostSetNeedsCommitToMainThread(); } - - void SetupTree() override { - scoped_refptr<FakePictureLayer> root = FakePictureLayer::Create(&client_); - root->SetBounds(gfx::Size(500, 500)); - layer_tree_host()->SetRootLayer(root); - LayerTreeHostDamageTest::SetupTree(); - - swap_count_ = 0; - prepare_to_draw_count_ = 0; - update_visible_tile_count_ = 0; - } - - DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { - EXPECT_EQ(DRAW_SUCCESS, draw_result); - prepare_to_draw_count_++; - switch (prepare_to_draw_count_) { - case 1: - // Detect that we have an incomplete tile, during the first frame. - // The first frame should have damage. - frame_data->contains_incomplete_tile = true; - DCHECK(!frame_data->has_no_damage); - break; - case 2: - // Make a no-damage frame. We early out and can't detect - // incomplete tiles, even if they still exist. - frame_data->contains_incomplete_tile = false; - frame_data->has_no_damage = true; - break; - case 3: - // Trigger the last swap for the completed tile. - frame_data->contains_incomplete_tile = false; - frame_data->has_no_damage = false; - EndTest(); - break; - default: - NOTREACHED(); - break; - } - - return draw_result; - } - - void UpdateVisibleTilesOnThread(LayerTreeHostImpl* host_impl) override { - // Simulate creating some visible tiles (that trigger prepare-to-draws). - // The first we make into a no-damage-frame during prepare-to-draw (see - // above). This is to ensure we still get UpdateVisibleTiles calls after - // a no-damage or aborted frame. - update_visible_tile_count_++; - switch (update_visible_tile_count_) { - case 3: - case 6: - host_impl->DidInitializeVisibleTileForTesting(); - break; - case 7: - NOTREACHED(); - break; - } - } - - void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool didSwap) override { - if (!didSwap) - return; - ++swap_count_; - } - - void AfterTest() override { - // We should keep getting update-visible-tiles calls - // until we report there are no more incomplete-tiles. - EXPECT_EQ(update_visible_tile_count_, 6); - // First frame, plus two triggered by DidInitializeVisibleTile() - EXPECT_EQ(prepare_to_draw_count_, 3); - // First swap, plus final swap (contained damage). - EXPECT_EQ(swap_count_, 2); - } - - FakeContentLayerClient client_; - int swap_count_; - int prepare_to_draw_count_; - int update_visible_tile_count_; -}; - -MULTI_THREAD_TEST_F(LayerTreeHostDamageTestVisibleTilesStillTriggerDraws); - } // namespace } // namespace cc diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index f15c7ec..4cb0a9e 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc @@ -383,12 +383,6 @@ void SingleThreadProxy::SetNeedsRedrawRectOnImplThread( SetNeedsRedrawOnImplThread(); } -void SingleThreadProxy::DidInitializeVisibleTileOnImplThread() { - TRACE_EVENT0("cc", "SingleThreadProxy::DidInitializeVisibleTileOnImplThread"); - if (scheduler_on_impl_thread_) - scheduler_on_impl_thread_->SetNeedsRedraw(); -} - void SingleThreadProxy::SetNeedsCommitOnImplThread() { client_->ScheduleComposite(); if (scheduler_on_impl_thread_) @@ -753,11 +747,6 @@ void SingleThreadProxy::ScheduledActionAnimate() { DoAnimate(); } -void SingleThreadProxy::ScheduledActionUpdateVisibleTiles() { - DebugScopedSetImplThread impl(this); - layer_tree_host_impl_->UpdateVisibleTiles(); -} - void SingleThreadProxy::ScheduledActionActivateSyncTree() { DebugScopedSetImplThread impl(this); layer_tree_host_impl_->ActivateSyncTree(); diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h index fa300de..e4cf793 100644 --- a/cc/trees/single_thread_proxy.h +++ b/cc/trees/single_thread_proxy.h @@ -67,7 +67,6 @@ class CC_EXPORT SingleThreadProxy : public Proxy, DrawResult ScheduledActionDrawAndSwapForced() override; void ScheduledActionCommit() override; void ScheduledActionAnimate() override; - void ScheduledActionUpdateVisibleTiles() override; void ScheduledActionActivateSyncTree() override; void ScheduledActionBeginOutputSurfaceCreation() override; void ScheduledActionManageTiles() override; @@ -93,7 +92,6 @@ class CC_EXPORT SingleThreadProxy : public Proxy, void SetNeedsRedrawRectOnImplThread(const gfx::Rect& dirty_rect) override; void SetNeedsAnimateOnImplThread() override; void SetNeedsManageTilesOnImplThread() override; - void DidInitializeVisibleTileOnImplThread() override; void SetNeedsCommitOnImplThread() override; void PostAnimationEventsToMainThreadOnImplThread( scoped_ptr<AnimationEventsVector> events) override; diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc index 0f7a2a3..bd85f01 100644 --- a/cc/trees/thread_proxy.cc +++ b/cc/trees/thread_proxy.cc @@ -479,23 +479,6 @@ void ThreadProxy::SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) { SetNeedsRedrawOnImplThread(); } -void ThreadProxy::SetSwapUsedIncompleteTileOnImplThread( - bool used_incomplete_tile) { - DCHECK(IsImplThread()); - if (used_incomplete_tile) { - TRACE_EVENT_INSTANT0("cc", - "ThreadProxy::SetSwapUsedIncompleteTileOnImplThread", - TRACE_EVENT_SCOPE_THREAD); - } - impl().scheduler->SetSwapUsedIncompleteTile(used_incomplete_tile); -} - -void ThreadProxy::DidInitializeVisibleTileOnImplThread() { - TRACE_EVENT0("cc", "ThreadProxy::DidInitializeVisibleTileOnImplThread"); - DCHECK(IsImplThread()); - impl().scheduler->SetNeedsRedraw(); -} - void ThreadProxy::MainThreadHasStoppedFlinging() { DCHECK(IsMainThread()); Proxy::ImplThreadTaskRunner()->PostTask( @@ -989,12 +972,6 @@ void ThreadProxy::ScheduledActionCommit() { impl().timing_history.DidCommit(); } -void ThreadProxy::ScheduledActionUpdateVisibleTiles() { - TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionUpdateVisibleTiles"); - DCHECK(IsImplThread()); - impl().layer_tree_host_impl->UpdateVisibleTiles(); -} - void ThreadProxy::ScheduledActionActivateSyncTree() { TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionActivateSyncTree"); DCHECK(IsImplThread()); @@ -1055,15 +1032,8 @@ DrawResult ThreadProxy::DrawSwapInternal(bool forced_draw) { bool start_ready_animations = draw_frame; impl().layer_tree_host_impl->UpdateAnimationState(start_ready_animations); - if (draw_frame) { - bool did_request_swap = impl().layer_tree_host_impl->SwapBuffers(frame); - - // We don't know if we have incomplete tiles if we didn't actually swap. - if (did_request_swap) { - DCHECK(!frame.has_no_damage); - SetSwapUsedIncompleteTileOnImplThread(frame.contains_incomplete_tile); - } - } + if (draw_frame) + impl().layer_tree_host_impl->SwapBuffers(frame); // Tell the main thread that the the newly-commited frame was drawn. if (impl().next_frame_is_newly_committed_frame) { diff --git a/cc/trees/thread_proxy.h b/cc/trees/thread_proxy.h index adccf72..a1064ab 100644 --- a/cc/trees/thread_proxy.h +++ b/cc/trees/thread_proxy.h @@ -195,7 +195,6 @@ class CC_EXPORT ThreadProxy : public Proxy, void SetNeedsRedrawRectOnImplThread(const gfx::Rect& dirty_rect) override; void SetNeedsAnimateOnImplThread() override; void SetNeedsManageTilesOnImplThread() override; - void DidInitializeVisibleTileOnImplThread() override; void SetNeedsCommitOnImplThread() override; void PostAnimationEventsToMainThreadOnImplThread( scoped_ptr<AnimationEventsVector> queue) override; @@ -215,7 +214,6 @@ class CC_EXPORT ThreadProxy : public Proxy, DrawResult ScheduledActionDrawAndSwapForced() override; void ScheduledActionAnimate() override; void ScheduledActionCommit() override; - void ScheduledActionUpdateVisibleTiles() override; void ScheduledActionActivateSyncTree() override; void ScheduledActionBeginOutputSurfaceCreation() override; void ScheduledActionManageTiles() override; |