diff options
author | dcheng <dcheng@chromium.org> | 2014-10-21 02:51:08 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-21 09:51:37 +0000 |
commit | 716bedf160f4c4c1945cab54c3f490424a0eb779 (patch) | |
tree | c9592751a48527e3278a8a1e001b0569c97ff1d5 /cc/trees | |
parent | 6c879fbd35d14af9ca4fe53bc622edac2d3fd5f1 (diff) | |
download | chromium_src-716bedf160f4c4c1945cab54c3f490424a0eb779.zip chromium_src-716bedf160f4c4c1945cab54c3f490424a0eb779.tar.gz chromium_src-716bedf160f4c4c1945cab54c3f490424a0eb779.tar.bz2 |
Standardize usage of virtual/override/final in cc/
BUG=417463
TBR=enne@chromium.org
Review URL: https://codereview.chromium.org/645853008
Cr-Commit-Position: refs/heads/master@{#300439}
Diffstat (limited to 'cc/trees')
27 files changed, 1238 insertions, 1406 deletions
diff --git a/cc/trees/layer_tree_host_common_perftest.cc b/cc/trees/layer_tree_host_common_perftest.cc index e378561..12e7a5e 100644 --- a/cc/trees/layer_tree_host_common_perftest.cc +++ b/cc/trees/layer_tree_host_common_perftest.cc @@ -50,7 +50,7 @@ class LayerTreeHostCommonPerfTest : public LayerTreeTest { ASSERT_TRUE(base::ReadFileToString(json_file, &json_)); } - virtual void SetupTree() override { + void SetupTree() override { gfx::Size viewport = gfx::Size(720, 1038); layer_tree_host()->SetViewportSize(viewport); scoped_refptr<Layer> root = @@ -61,7 +61,7 @@ class LayerTreeHostCommonPerfTest : public LayerTreeTest { void SetTestName(const std::string& name) { test_name_ = name; } - virtual void AfterTest() override { + void AfterTest() override { CHECK(!test_name_.empty()) << "Must SetTestName() before TearDown()."; perf_test::PrintResult("calc_draw_props_time", "", @@ -84,7 +84,7 @@ class CalcDrawPropsMainTest : public LayerTreeHostCommonPerfTest { RunTest(false, false, false); } - virtual void BeginTest() override { + void BeginTest() override { timer_.Reset(); do { @@ -121,11 +121,9 @@ class CalcDrawPropsImplTest : public LayerTreeHostCommonPerfTest { RunTestWithImplSidePainting(); } - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { timer_.Reset(); LayerTreeImpl* active_tree = host_impl->active_tree(); @@ -169,9 +167,9 @@ class LayerSorterMainTest : public CalcDrawPropsImplTest { public: void RunSortLayers() { RunTest(false, false, false); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { LayerTreeImpl* active_tree = host_impl->active_tree(); // First build the tree and then we'll start running tests on layersorter // itself @@ -221,9 +219,9 @@ class BspTreePerfTest : public LayerSorterMainTest { num_duplicates_ = num_duplicates; } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { LayerTreeImpl* active_tree = host_impl->active_tree(); // First build the tree and then we'll start running tests on layersorter // itself diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index 83e6800..99e479a 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc @@ -43,10 +43,10 @@ class LayerWithForcedDrawsContent : public Layer { public: LayerWithForcedDrawsContent() {} - virtual bool DrawsContent() const override; + bool DrawsContent() const override; private: - virtual ~LayerWithForcedDrawsContent() {} + ~LayerWithForcedDrawsContent() override {} }; bool LayerWithForcedDrawsContent::DrawsContent() const { return true; } @@ -54,13 +54,13 @@ bool LayerWithForcedDrawsContent::DrawsContent() const { return true; } class MockContentLayerClient : public ContentLayerClient { public: MockContentLayerClient() {} - virtual ~MockContentLayerClient() {} - virtual void PaintContents( + ~MockContentLayerClient() override {} + void PaintContents( SkCanvas* canvas, const gfx::Rect& clip, ContentLayerClient::GraphicsContextStatus gc_status) override {} - virtual void DidChangeLayerCanUseLCDText() override {} - virtual bool FillsBoundsCompletely() const override { return false; } + void DidChangeLayerCanUseLCDText() override {} + bool FillsBoundsCompletely() const override { return false; } }; scoped_refptr<FakePictureLayer> CreateDrawablePictureLayer( @@ -4031,10 +4031,10 @@ class NoScaleContentLayer : public ContentLayer { return make_scoped_refptr(new NoScaleContentLayer(client)); } - virtual void CalculateContentsScale(float ideal_contents_scale, - float* contents_scale_x, - float* contents_scale_y, - gfx::Size* content_bounds) override { + void CalculateContentsScale(float ideal_contents_scale, + float* contents_scale_x, + float* contents_scale_y, + gfx::Size* content_bounds) override { // Skip over the ContentLayer to the base Layer class. Layer::CalculateContentsScale(ideal_contents_scale, contents_scale_x, @@ -4045,7 +4045,7 @@ class NoScaleContentLayer : public ContentLayer { protected: explicit NoScaleContentLayer(ContentLayerClient* client) : ContentLayer(client) {} - virtual ~NoScaleContentLayer() {} + ~NoScaleContentLayer() override {} }; scoped_refptr<NoScaleContentLayer> CreateNoScaleDrawableContentLayer( @@ -7771,7 +7771,7 @@ class AnimationScaleFactorTrackingLayerImpl : public LayerImpl { new AnimationScaleFactorTrackingLayerImpl(tree_impl, id)); } - virtual ~AnimationScaleFactorTrackingLayerImpl() {} + ~AnimationScaleFactorTrackingLayerImpl() override {} private: explicit AnimationScaleFactorTrackingLayerImpl(LayerTreeImpl* tree_impl, diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 6380647..ddb315f 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -176,12 +176,12 @@ class LayerTreeHostImplTimeSourceAdapter : public TimeSourceClient { new LayerTreeHostImplTimeSourceAdapter(layer_tree_host_impl, time_source)); } - virtual ~LayerTreeHostImplTimeSourceAdapter() { + ~LayerTreeHostImplTimeSourceAdapter() override { time_source_->SetClient(NULL); time_source_->SetActive(false); } - virtual void OnTimerTick() override { + void OnTimerTick() override { // In single threaded mode we attempt to simulate changing the current // thread by maintaining a fake thread id. When we switch from one // thread to another, we construct DebugScopedSetXXXThread objects that diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 51ef8b0..a6448c1 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -123,51 +123,49 @@ class CC_EXPORT LayerTreeHostImpl SharedBitmapManager* shared_bitmap_manager, GpuMemoryBufferManager* gpu_memory_buffer_manager, int id); - virtual ~LayerTreeHostImpl(); + ~LayerTreeHostImpl() override; // BeginFrameSourceMixIn implementation - virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override; + void OnNeedsBeginFramesChange(bool needs_begin_frames) override; // InputHandler implementation - virtual void BindToClient(InputHandlerClient* client) override; - virtual InputHandler::ScrollStatus ScrollBegin( + void BindToClient(InputHandlerClient* client) override; + InputHandler::ScrollStatus ScrollBegin( const gfx::Point& viewport_point, InputHandler::ScrollInputType type) override; - virtual InputHandler::ScrollStatus ScrollAnimated( + InputHandler::ScrollStatus ScrollAnimated( const gfx::Point& viewport_point, const gfx::Vector2dF& scroll_delta) override; - virtual bool ScrollBy(const gfx::Point& viewport_point, - const gfx::Vector2dF& scroll_delta) override; - virtual bool ScrollVerticallyByPage(const gfx::Point& viewport_point, - ScrollDirection direction) override; - virtual void SetRootLayerScrollOffsetDelegate( + bool ScrollBy(const gfx::Point& viewport_point, + const gfx::Vector2dF& scroll_delta) override; + bool ScrollVerticallyByPage(const gfx::Point& viewport_point, + ScrollDirection direction) override; + void SetRootLayerScrollOffsetDelegate( LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) override; - virtual void OnRootLayerDelegatedScrollOffsetChanged() override; - virtual void ScrollEnd() override; - virtual InputHandler::ScrollStatus FlingScrollBegin() override; - virtual void MouseMoveAt(const gfx::Point& viewport_point) override; - virtual void PinchGestureBegin() override; - virtual void PinchGestureUpdate(float magnify_delta, - const gfx::Point& anchor) override; - virtual void PinchGestureEnd() override; - virtual void SetNeedsAnimate() override; - virtual bool IsCurrentlyScrollingLayerAt( - const gfx::Point& viewport_point, - InputHandler::ScrollInputType type) override; - virtual bool HaveTouchEventHandlersAt( - const gfx::Point& viewport_port) override; - virtual scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( + void OnRootLayerDelegatedScrollOffsetChanged() override; + void ScrollEnd() override; + InputHandler::ScrollStatus FlingScrollBegin() override; + void MouseMoveAt(const gfx::Point& viewport_point) override; + void PinchGestureBegin() override; + void PinchGestureUpdate(float magnify_delta, + const gfx::Point& anchor) override; + void PinchGestureEnd() override; + void SetNeedsAnimate() override; + bool IsCurrentlyScrollingLayerAt(const gfx::Point& viewport_point, + InputHandler::ScrollInputType type) override; + bool HaveTouchEventHandlersAt(const gfx::Point& viewport_port) override; + scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( ui::LatencyInfo* latency) override; // TopControlsManagerClient implementation. - virtual void SetControlsTopOffset(float offset) override; - virtual float ControlsTopOffset() const override; - virtual void DidChangeTopControlsPosition() override; - virtual bool HaveRootScrollLayer() const override; + void SetControlsTopOffset(float offset) override; + float ControlsTopOffset() const override; + void DidChangeTopControlsPosition() override; + bool HaveRootScrollLayer() const override; struct CC_EXPORT FrameData : public RenderPassSink { FrameData(); - virtual ~FrameData(); + ~FrameData() override; void AsValueInto(base::debug::TracedValue* value) const; std::vector<gfx::Rect> occluding_screen_space_rects; @@ -180,7 +178,7 @@ class CC_EXPORT LayerTreeHostImpl bool has_no_damage; // RenderPassSink implementation. - virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; + void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; }; virtual void BeginMainFrameAborted(bool did_handle); @@ -232,45 +230,43 @@ class CC_EXPORT LayerTreeHostImpl const gfx::Rect ViewportRectForTilePriority() const; // RendererClient implementation. - virtual void SetFullRootLayerDamage() override; + void SetFullRootLayerDamage() override; // TileManagerClient implementation. - virtual const std::vector<PictureLayerImpl*>& GetPictureLayers() - const override; - virtual void NotifyReadyToActivate() override; - virtual void NotifyTileStateChanged(const Tile* tile) override; - virtual void BuildRasterQueue(RasterTilePriorityQueue* queue, - TreePriority tree_priority) override; - virtual void BuildEvictionQueue(EvictionTilePriorityQueue* queue, - TreePriority tree_priority) override; + const std::vector<PictureLayerImpl*>& GetPictureLayers() const override; + void NotifyReadyToActivate() override; + void NotifyTileStateChanged(const Tile* tile) override; + void BuildRasterQueue(RasterTilePriorityQueue* queue, + TreePriority tree_priority) override; + void BuildEvictionQueue(EvictionTilePriorityQueue* queue, + TreePriority tree_priority) override; // ScrollbarAnimationControllerClient implementation. - virtual void PostDelayedScrollbarFade(const base::Closure& start_fade, - base::TimeDelta delay) override; - virtual void SetNeedsScrollbarAnimationFrame() override; + void PostDelayedScrollbarFade(const base::Closure& start_fade, + base::TimeDelta delay) override; + void SetNeedsScrollbarAnimationFrame() override; // OutputSurfaceClient implementation. - virtual void DeferredInitialize() override; - virtual void ReleaseGL() override; - virtual void CommitVSyncParameters(base::TimeTicks timebase, - base::TimeDelta interval) override; - virtual void SetNeedsRedrawRect(const gfx::Rect& rect) override; - virtual void BeginFrame(const BeginFrameArgs& args) override; - - virtual void SetExternalDrawConstraints( + void DeferredInitialize() override; + void ReleaseGL() override; + void CommitVSyncParameters(base::TimeTicks timebase, + base::TimeDelta interval) override; + void SetNeedsRedrawRect(const gfx::Rect& rect) override; + void BeginFrame(const BeginFrameArgs& args) override; + + void SetExternalDrawConstraints( const gfx::Transform& transform, const gfx::Rect& viewport, const gfx::Rect& clip, const gfx::Rect& viewport_rect_for_tile_priority, const gfx::Transform& transform_for_tile_priority, bool resourceless_software_draw) override; - virtual void DidLoseOutputSurface() override; - virtual void DidSwapBuffers() override; - virtual void DidSwapBuffersComplete() override; - virtual void ReclaimResources(const CompositorFrameAck* ack) override; - virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; - virtual void SetTreeActivationCallback(const base::Closure& callback) - override; + void DidLoseOutputSurface() override; + void DidSwapBuffers() override; + void DidSwapBuffersComplete() override; + void ReclaimResources(const CompositorFrameAck* ack) override; + void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; + void SetTreeActivationCallback(const base::Closure& callback) override; // Called from LayerTreeImpl. void OnCanDrawStateChangedForTree(); @@ -429,7 +425,7 @@ class CC_EXPORT LayerTreeHostImpl return begin_impl_frame_interval_; } - virtual void AsValueInto(base::debug::TracedValue* value) const override; + void AsValueInto(base::debug::TracedValue* value) const override; void AsValueWithFrameInto(FrameData* frame, base::debug::TracedValue* value) const; scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index a7f902c..ec1100f 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -114,58 +114,50 @@ class LayerTreeHostImplTest : public testing::Test, virtual void TearDown() override {} - virtual void UpdateRendererCapabilitiesOnImplThread() override {} - virtual void DidLoseOutputSurfaceOnImplThread() override {} - virtual void CommitVSyncParameters(base::TimeTicks timebase, - base::TimeDelta interval) override {} - virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override {} - virtual void SetMaxSwapsPendingOnImplThread(int max) override {} - virtual void DidSwapBuffersOnImplThread() override {} - virtual void DidSwapBuffersCompleteOnImplThread() override {} - virtual void OnCanDrawStateChanged(bool can_draw) override { + void UpdateRendererCapabilitiesOnImplThread() override {} + void DidLoseOutputSurfaceOnImplThread() override {} + void CommitVSyncParameters(base::TimeTicks timebase, + base::TimeDelta interval) override {} + void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override {} + void SetMaxSwapsPendingOnImplThread(int max) override {} + void DidSwapBuffersOnImplThread() override {} + void DidSwapBuffersCompleteOnImplThread() override {} + void OnCanDrawStateChanged(bool can_draw) override { on_can_draw_state_changed_called_ = true; } - virtual void NotifyReadyToActivate() override { + void NotifyReadyToActivate() override { did_notify_ready_to_activate_ = true; host_impl_->ActivateSyncTree(); } - virtual void SetNeedsRedrawOnImplThread() override { + void SetNeedsRedrawOnImplThread() override { did_request_redraw_ = true; } + void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) override { did_request_redraw_ = true; } - virtual void SetNeedsRedrawRectOnImplThread( - const gfx::Rect& damage_rect) override { - did_request_redraw_ = true; - } - virtual void SetNeedsAnimateOnImplThread() override { - did_request_animate_ = true; - } - virtual void SetNeedsManageTilesOnImplThread() override { + void SetNeedsAnimateOnImplThread() override { did_request_animate_ = true; } + void SetNeedsManageTilesOnImplThread() override { did_request_manage_tiles_ = true; } - virtual void DidInitializeVisibleTileOnImplThread() override { + void DidInitializeVisibleTileOnImplThread() override { did_upload_visible_tile_ = true; } - virtual void SetNeedsCommitOnImplThread() override { - did_request_commit_ = true; - } - virtual void PostAnimationEventsToMainThreadOnImplThread( + void SetNeedsCommitOnImplThread() override { did_request_commit_ = true; } + void PostAnimationEventsToMainThreadOnImplThread( scoped_ptr<AnimationEventsVector> events) override {} - virtual bool ReduceContentsTextureMemoryOnImplThread( - size_t limit_bytes, int priority_cutoff) override { + bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, + int priority_cutoff) override { current_limit_bytes_ = limit_bytes; current_priority_cutoff_value_ = priority_cutoff; return reduce_memory_result_; } - virtual bool IsInsideDraw() override { return false; } - virtual void RenewTreePriority() override {} - virtual void PostDelayedScrollbarFadeOnImplThread( - const base::Closure& start_fade, - base::TimeDelta delay) override { + bool IsInsideDraw() override { return false; } + void RenewTreePriority() override {} + void PostDelayedScrollbarFadeOnImplThread(const base::Closure& start_fade, + base::TimeDelta delay) override { scrollbar_fade_start_ = start_fade; requested_scrollbar_animation_delay_ = delay; } - virtual void DidActivateSyncTree() override {} - virtual void DidManageTiles() override {} + void DidActivateSyncTree() override {} + void DidManageTiles() override {} void set_reduce_memory_result(bool reduce_memory_result) { reduce_memory_result_ = reduce_memory_result; @@ -1382,7 +1374,7 @@ class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl { NULL, 0) {} - virtual BeginFrameArgs CurrentBeginFrameArgs() const override { + BeginFrameArgs CurrentBeginFrameArgs() const override { return CreateBeginFrameArgsForTesting(fake_current_physical_time_); } @@ -1721,23 +1713,22 @@ class DidDrawCheckLayer : public LayerImpl { return make_scoped_ptr(new DidDrawCheckLayer(tree_impl, id)); } - virtual bool WillDraw(DrawMode draw_mode, ResourceProvider* provider) - override { + bool WillDraw(DrawMode draw_mode, ResourceProvider* provider) override { will_draw_called_ = true; if (will_draw_returns_false_) return false; return LayerImpl::WillDraw(draw_mode, provider); } - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override { + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override { append_quads_called_ = true; LayerImpl::AppendQuads( render_pass, occlusion_in_content_space, append_quads_data); } - virtual void DidDraw(ResourceProvider* provider) override { + void DidDraw(ResourceProvider* provider) override { did_draw_called_ = true; LayerImpl::DidDraw(provider); } @@ -1953,9 +1944,9 @@ class MissingTextureAnimatingLayer : public DidDrawCheckLayer { resource_provider)); } - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override { + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override { LayerImpl::AppendQuads( render_pass, occlusion_in_content_space, append_quads_data); if (had_incomplete_tile_) @@ -3526,21 +3517,20 @@ class TestScrollOffsetDelegate : public LayerScrollOffsetDelegate { min_page_scale_factor_(-1.f), max_page_scale_factor_(-1.f) {} - virtual ~TestScrollOffsetDelegate() {} + ~TestScrollOffsetDelegate() override {} - virtual gfx::ScrollOffset GetTotalScrollOffset() override { + gfx::ScrollOffset GetTotalScrollOffset() override { return getter_return_value_; } - virtual bool IsExternalFlingActive() const override { return false; } + bool IsExternalFlingActive() const override { return false; } - virtual void UpdateRootLayerState( - const gfx::ScrollOffset& total_scroll_offset, - const gfx::ScrollOffset& max_scroll_offset, - const gfx::SizeF& scrollable_size, - float page_scale_factor, - float min_page_scale_factor, - float max_page_scale_factor) override { + void UpdateRootLayerState(const gfx::ScrollOffset& total_scroll_offset, + const gfx::ScrollOffset& max_scroll_offset, + const gfx::SizeF& scrollable_size, + float page_scale_factor, + float min_page_scale_factor, + float max_page_scale_factor) override { DCHECK(total_scroll_offset.x() <= max_scroll_offset.x()); DCHECK(total_scroll_offset.y() <= max_scroll_offset.y()); last_set_scroll_offset_ = total_scroll_offset; @@ -3986,9 +3976,9 @@ class BlendStateCheckLayer : public LayerImpl { new BlendStateCheckLayer(tree_impl, id, resource_provider)); } - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override { + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override { quads_appended_ = true; gfx::Rect opaque_rect; @@ -4398,9 +4388,7 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest { host_impl_->DidDrawAllLayers(frame); } - virtual void DidActivateSyncTree() override { - did_activate_pending_tree_ = true; - } + void DidActivateSyncTree() override { did_activate_pending_tree_ = true; } void set_gutter_quad_material(DrawQuad::Material material) { gutter_quad_material_ = material; @@ -4750,9 +4738,9 @@ class FakeLayerWithQuads : public LayerImpl { return make_scoped_ptr(new FakeLayerWithQuads(tree_impl, id)); } - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override { + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override { SharedQuadState* shared_quad_state = render_pass->CreateAndAppendSharedQuadState(); PopulateSharedQuadState(shared_quad_state); @@ -5200,7 +5188,7 @@ TEST_F(LayerTreeHostImplTest, ReleaseContentsTextureShouldTriggerCommit) { class LayerTreeHostImplTestWithDelegatingRenderer : public LayerTreeHostImplTest { protected: - virtual scoped_ptr<OutputSurface> CreateOutputSurface() override { + scoped_ptr<OutputSurface> CreateOutputSurface() override { return FakeOutputSurface::CreateDelegating3d(); } @@ -5290,8 +5278,8 @@ class FakeMaskLayerImpl : public LayerImpl { return make_scoped_ptr(new FakeMaskLayerImpl(tree_impl, id)); } - virtual void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, - gfx::Size* resource_size) const override { + void GetContentsResourceId(ResourceProvider::ResourceId* resource_id, + gfx::Size* resource_size) const override { *resource_id = 0; } @@ -6048,7 +6036,7 @@ class CompositorFrameMetadataTest : public LayerTreeHostImplTest { CompositorFrameMetadataTest() : swap_buffers_complete_(0) {} - virtual void DidSwapBuffersCompleteOnImplThread() override { + void DidSwapBuffersCompleteOnImplThread() override { swap_buffers_complete_++; } @@ -6073,11 +6061,11 @@ class CountingSoftwareDevice : public SoftwareOutputDevice { public: CountingSoftwareDevice() : frames_began_(0), frames_ended_(0) {} - virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override { + SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override { ++frames_began_; return SoftwareOutputDevice::BeginPaint(damage_rect); } - virtual void EndPaint(SoftwareFrameData* frame_data) override { + void EndPaint(SoftwareFrameData* frame_data) override { ++frames_ended_; SoftwareOutputDevice::EndPaint(frame_data); } @@ -6192,7 +6180,7 @@ class LayerTreeHostImplTestDeferredInitialize : public LayerTreeHostImplTest { onscreen_context_provider_ = TestContextProvider::Create(); } - virtual void UpdateRendererCapabilitiesOnImplThread() override { + void UpdateRendererCapabilitiesOnImplThread() override { did_update_renderer_capabilities_ = true; } @@ -6910,17 +6898,13 @@ class SimpleSwapPromiseMonitor : public SwapPromiseMonitor { set_needs_redraw_count_(set_needs_redraw_count), forward_to_main_count_(forward_to_main_count) {} - virtual ~SimpleSwapPromiseMonitor() {} + ~SimpleSwapPromiseMonitor() override {} - virtual void OnSetNeedsCommitOnMain() override { - (*set_needs_commit_count_)++; - } + void OnSetNeedsCommitOnMain() override { (*set_needs_commit_count_)++; } - virtual void OnSetNeedsRedrawOnImpl() override { - (*set_needs_redraw_count_)++; - } + void OnSetNeedsRedrawOnImpl() override { (*set_needs_redraw_count_)++; } - virtual void OnForwardScrollUpdateToMainThreadOnImpl() override { + void OnForwardScrollUpdateToMainThreadOnImpl() override { (*forward_to_main_count_)++; } @@ -7530,9 +7514,7 @@ TEST_F(LayerTreeHostImplTest, DidBecomeActive) { class LayerTreeHostImplCountingLostSurfaces : public LayerTreeHostImplTest { public: LayerTreeHostImplCountingLostSurfaces() : num_lost_surfaces_(0) {} - virtual void DidLoseOutputSurfaceOnImplThread() override { - num_lost_surfaces_++; - } + void DidLoseOutputSurfaceOnImplThread() override { num_lost_surfaces_++; } protected: int num_lost_surfaces_; diff --git a/cc/trees/layer_tree_host_perftest.cc b/cc/trees/layer_tree_host_perftest.cc index 47d7789..b368c55 100644 --- a/cc/trees/layer_tree_host_perftest.cc +++ b/cc/trees/layer_tree_host_perftest.cc @@ -44,34 +44,34 @@ class LayerTreeHostPerfTest : public LayerTreeTest { measure_commit_cost_(false) { } - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->throttle_frame_production = false; } - virtual void BeginTest() override { + void BeginTest() override { BuildTree(); PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) override { + void BeginMainFrame(const BeginFrameArgs& args) override { if (begin_frame_driven_drawing_ && !TestEnded()) { layer_tree_host()->SetNeedsAnimate(); layer_tree_host()->SetNextCommitForcesRedraw(); } } - virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { + void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { if (measure_commit_cost_) commit_timer_.Start(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { if (measure_commit_cost_ && draw_timer_.IsWarmedUp()) { commit_timer_.NextLap(); } } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { if (TestEnded() || CleanUpStarted()) return; draw_timer_.NextLap(); @@ -91,7 +91,7 @@ class LayerTreeHostPerfTest : public LayerTreeTest { virtual void BuildTree() {} - virtual void AfterTest() override { + void AfterTest() override { CHECK(!test_name_.empty()) << "Must SetTestName() before AfterTest()."; perf_test::PrintResult("layer_tree_host_frame_time", "", test_name_, 1000 * draw_timer_.MsPerLap(), "us", true); @@ -131,7 +131,7 @@ class LayerTreeHostPerfTestJsonReader : public LayerTreeHostPerfTest { ASSERT_TRUE(base::ReadFileToString(json_file, &json_)); } - virtual void BuildTree() override { + void BuildTree() override { gfx::Size viewport = gfx::Size(720, 1038); layer_tree_host()->SetViewportSize(viewport); scoped_refptr<Layer> root = ParseTreeFromJson(json_, @@ -178,7 +178,7 @@ TEST_F(LayerTreeHostPerfTestJsonReader, class LayerTreeHostPerfTestLeafInvalidates : public LayerTreeHostPerfTestJsonReader { public: - virtual void BuildTree() override { + void BuildTree() override { LayerTreeHostPerfTestJsonReader::BuildTree(); // Find a leaf layer. @@ -188,7 +188,7 @@ class LayerTreeHostPerfTestLeafInvalidates } } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { if (TestEnded()) return; @@ -221,13 +221,13 @@ class ScrollingLayerTreePerfTest : public LayerTreeHostPerfTestJsonReader { : LayerTreeHostPerfTestJsonReader() { } - virtual void BuildTree() override { + void BuildTree() override { LayerTreeHostPerfTestJsonReader::BuildTree(); scrollable_ = layer_tree_host()->root_layer()->children()[1]; ASSERT_TRUE(scrollable_.get()); } - virtual void Layout() override { + void Layout() override { if (TestEnded()) return; static const gfx::Vector2d delta = gfx::Vector2d(0, 10); @@ -262,7 +262,7 @@ class BrowserCompositorInvalidateLayerTreePerfTest next_sync_point_(1), clean_up_started_(false) {} - virtual void BuildTree() override { + void BuildTree() override { LayerTreeHostPerfTestJsonReader::BuildTree(); tab_contents_ = static_cast<TextureLayer*>( @@ -273,7 +273,7 @@ class BrowserCompositorInvalidateLayerTreePerfTest ASSERT_TRUE(tab_contents_.get()); } - virtual void WillCommit() override { + void WillCommit() override { if (CleanUpStarted()) return; gpu::Mailbox gpu_mailbox; @@ -289,13 +289,13 @@ class BrowserCompositorInvalidateLayerTreePerfTest tab_contents_->SetTextureMailbox(mailbox, callback.Pass()); } - virtual void DidCommit() override { + void DidCommit() override { if (CleanUpStarted()) return; layer_tree_host()->SetNeedsCommit(); } - virtual void CleanUpAndEndTest(LayerTreeHostImpl* host_impl) override { + void CleanUpAndEndTest(LayerTreeHostImpl* host_impl) override { clean_up_started_ = true; MainThreadTaskRunner()->PostTask( FROM_HERE, @@ -309,7 +309,7 @@ class BrowserCompositorInvalidateLayerTreePerfTest EndTest(); } - virtual bool CleanUpStarted() override { return clean_up_started_; } + bool CleanUpStarted() override { return clean_up_started_; } private: scoped_refptr<TextureLayer> tab_contents_; diff --git a/cc/trees/layer_tree_host_pixeltest_filters.cc b/cc/trees/layer_tree_host_pixeltest_filters.cc index 4afc4ec..c0438ec 100644 --- a/cc/trees/layer_tree_host_pixeltest_filters.cc +++ b/cc/trees/layer_tree_host_pixeltest_filters.cc @@ -159,12 +159,12 @@ TEST_F(LayerTreeHostFiltersPixelTest, BackgroundFilterBlurOffAxis) { class LayerTreeHostFiltersScaledPixelTest : public LayerTreeHostFiltersPixelTest { - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { // Required so that device scale is inherited by content scale. settings->layer_transforms_should_scale_layer_contents = true; } - virtual void SetupTree() override { + void SetupTree() override { layer_tree_host()->SetDeviceScaleFactor(device_scale_factor_); LayerTreePixelTest::SetupTree(); } diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc index e1ab00e..5aef5e3e 100644 --- a/cc/trees/layer_tree_host_pixeltest_masks.cc +++ b/cc/trees/layer_tree_host_pixeltest_masks.cc @@ -20,13 +20,13 @@ class LayerTreeHostMasksPixelTest : public LayerTreePixelTest {}; class MaskContentLayerClient : public ContentLayerClient { public: explicit MaskContentLayerClient(const gfx::Size& bounds) : bounds_(bounds) {} - virtual ~MaskContentLayerClient() {} + ~MaskContentLayerClient() override {} - virtual void DidChangeLayerCanUseLCDText() override {} + void DidChangeLayerCanUseLCDText() override {} - virtual bool FillsBoundsCompletely() const override { return false; } + bool FillsBoundsCompletely() const override { return false; } - virtual void PaintContents( + void PaintContents( SkCanvas* canvas, const gfx::Rect& rect, ContentLayerClient::GraphicsContextStatus gc_status) override { diff --git a/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc b/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc index fa94b0e..0689a27 100644 --- a/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc +++ b/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc @@ -21,19 +21,18 @@ namespace { class LayerTreeHostOnDemandRasterPixelTest : public LayerTreePixelTest { public: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; } - virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override { + void BeginCommitOnThread(LayerTreeHostImpl* impl) override { // Not enough memory available. Enforce on-demand rasterization. impl->SetMemoryPolicy( ManagedMemoryPolicy(1, gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, 1000)); } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { // Find the PictureLayerImpl ask it to append quads to check their material. // The PictureLayerImpl is assumed to be the first child of the root layer // in the active tree. @@ -60,11 +59,11 @@ class BlueYellowLayerClient : public ContentLayerClient { explicit BlueYellowLayerClient(gfx::Rect layer_rect) : layer_rect_(layer_rect) {} - virtual void DidChangeLayerCanUseLCDText() override { } + void DidChangeLayerCanUseLCDText() override {} - virtual bool FillsBoundsCompletely() const override { return false; } + bool FillsBoundsCompletely() const override { return false; } - virtual void PaintContents( + void PaintContents( SkCanvas* canvas, const gfx::Rect& clip, ContentLayerClient::GraphicsContextStatus gc_status) override { @@ -109,7 +108,7 @@ TEST_F(LayerTreeHostOnDemandRasterPixelTest, RasterPictureLayer) { class LayerTreeHostOnDemandRasterPixelTestWithGpuRasterizationForced : public LayerTreeHostOnDemandRasterPixelTest { - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { LayerTreeHostOnDemandRasterPixelTest::InitializeSettings(settings); settings->gpu_rasterization_forced = true; } diff --git a/cc/trees/layer_tree_host_pixeltest_readback.cc b/cc/trees/layer_tree_host_pixeltest_readback.cc index 1b7679b..6b67e50 100644 --- a/cc/trees/layer_tree_host_pixeltest_readback.cc +++ b/cc/trees/layer_tree_host_pixeltest_readback.cc @@ -24,7 +24,7 @@ class LayerTreeHostReadbackPixelTest : public LayerTreePixelTest { LayerTreeHostReadbackPixelTest() : insert_copy_request_after_frame_count_(0) {} - virtual scoped_ptr<CopyOutputRequest> CreateCopyOutputRequest() override { + scoped_ptr<CopyOutputRequest> CreateCopyOutputRequest() override { scoped_ptr<CopyOutputRequest> request; switch (test_type_) { @@ -51,7 +51,7 @@ class LayerTreeHostReadbackPixelTest : public LayerTreePixelTest { return request.Pass(); } - virtual void BeginTest() override { + void BeginTest() override { if (insert_copy_request_after_frame_count_ == 0) { Layer* const target = readback_target_ ? readback_target_ : layer_tree_host()->root_layer(); @@ -60,7 +60,7 @@ class LayerTreeHostReadbackPixelTest : public LayerTreePixelTest { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { if (insert_copy_request_after_frame_count_ == layer_tree_host()->source_frame_number()) { Layer* const target = @@ -920,17 +920,17 @@ class LayerTreeHostReadbackDeviceScalePixelTest green_client_(SK_ColorGREEN), blue_client_(SK_ColorBLUE) {} - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { // Cause the device scale factor to be inherited by contents scales. settings->layer_transforms_should_scale_layer_contents = true; } - virtual void SetupTree() override { + void SetupTree() override { layer_tree_host()->SetDeviceScaleFactor(device_scale_factor_); LayerTreePixelTest::SetupTree(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_EQ(device_scale_factor_, host_impl->active_tree()->device_scale_factor()); } diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index c5dbe0d..8fb9b8c 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -75,22 +75,22 @@ class LayerTreeHostTestSetNeedsCommit1 : public LayerTreeHostTest { public: LayerTreeHostTestSetNeedsCommit1() : num_commits_(0), num_draws_(0) {} - virtual void BeginTest() override { + void BeginTest() override { PostSetNeedsCommitToMainThread(); PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { num_draws_++; if (!impl->active_tree()->source_frame_number()) EndTest(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { num_commits_++; } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_LE(1, num_commits_); EXPECT_LE(1, num_draws_); } @@ -108,13 +108,11 @@ class LayerTreeHostTestSetNeedsCommit2 : public LayerTreeHostTest { public: LayerTreeHostTestSetNeedsCommit2() : num_commits_(0), num_draws_(0) {} - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { - ++num_draws_; - } + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { ++num_draws_; } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { ++num_commits_; switch (num_commits_) { case 1: @@ -128,7 +126,7 @@ class LayerTreeHostTestSetNeedsCommit2 : public LayerTreeHostTest { } } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_EQ(2, num_commits_); EXPECT_LE(1, num_draws_); } @@ -143,7 +141,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsCommit2); // Verify that we pass property values in PushPropertiesTo. class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest { protected: - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<Layer> root = Layer::Create(); root->SetBounds(gfx::Size(10, 10)); layer_tree_host()->SetRootLayer(root); @@ -158,16 +156,16 @@ class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest { DONE, }; - virtual void BeginTest() override { + void BeginTest() override { index_ = STARTUP; PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { VerifyAfterValues(impl->active_tree()->root_layer()); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { SetBeforeValues(layer_tree_host()->root_layer()); VerifyBeforeValues(layer_tree_host()->root_layer()); @@ -180,7 +178,7 @@ class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest { SetAfterValues(layer_tree_host()->root_layer()); } - virtual void AfterTest() override {} + void AfterTest() override {} void VerifyBeforeValues(Layer* layer) { EXPECT_EQ(gfx::Size(10, 10).ToString(), layer->bounds().ToString()); @@ -239,9 +237,9 @@ class LayerTreeHostTestSetNeedsRedraw : public LayerTreeHostTest { public: LayerTreeHostTestSetNeedsRedraw() : num_commits_(0), num_draws_(0) {} - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { EXPECT_EQ(0, impl->active_tree()->source_frame_number()); if (!num_draws_) { // Redraw again to verify that the second redraw doesn't commit. @@ -252,12 +250,12 @@ class LayerTreeHostTestSetNeedsRedraw : public LayerTreeHostTest { num_draws_++; } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { EXPECT_EQ(0, num_draws_); num_commits_++; } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_GE(2, num_draws_); EXPECT_EQ(1, num_commits_); } @@ -279,7 +277,7 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest { invalid_rect_(10, 10, 20, 20), root_layer_(ContentLayer::Create(&client_)) {} - virtual void BeginTest() override { + void BeginTest() override { root_layer_->SetIsDrawable(true); root_layer_->SetBounds(bounds_); layer_tree_host()->SetRootLayer(root_layer_); @@ -287,10 +285,9 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest { PostSetNeedsCommitToMainThread(); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { EXPECT_EQ(DRAW_SUCCESS, draw_result); gfx::RectF root_damage_rect; @@ -308,7 +305,7 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest { return draw_result; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { if (!num_draws_) { PostSetNeedsRedrawRectToMainThread(invalid_rect_); } else { @@ -317,7 +314,7 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest { num_draws_++; } - virtual void AfterTest() override { EXPECT_EQ(2, num_draws_); } + void AfterTest() override { EXPECT_EQ(2, num_draws_); } private: int num_draws_; @@ -331,11 +328,11 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsRedrawRect); class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest { public: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->layer_transforms_should_scale_layer_contents = true; } - virtual void SetupTree() override { + void SetupTree() override { root_layer_ = Layer::Create(); root_layer_->SetBounds(gfx::Size(10, 20)); @@ -347,14 +344,14 @@ class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->active_tree()->source_frame_number() == 1) EndTest(); } - virtual void DidCommit() override { + void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 1: // Changing the device scale factor causes a commit. It also changes @@ -368,7 +365,7 @@ class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest { } } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_EQ(gfx::Size(4, 4).ToString(), scaled_layer_->content_bounds().ToString()); } @@ -384,11 +381,11 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoExtraCommitFromInvalidate); class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate : public LayerTreeHostTest { public: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->layer_transforms_should_scale_layer_contents = true; } - virtual void SetupTree() override { + void SetupTree() override { root_layer_ = Layer::Create(); root_layer_->SetBounds(gfx::Size(10, 20)); @@ -405,14 +402,14 @@ class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->active_tree()->source_frame_number() == 1) EndTest(); } - virtual void DidCommit() override { + void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 1: // Changing the device scale factor causes a commit. It also changes @@ -426,7 +423,7 @@ class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate } } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_EQ(gfx::Size(40, 40).ToString(), scrollbar_->content_bounds().ToString()); } @@ -448,7 +445,7 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest { invalid_rect_(10, 10, 20, 20), root_layer_(ContentLayer::Create(&client_)) {} - virtual void BeginTest() override { + void BeginTest() override { root_layer_->SetIsDrawable(true); root_layer_->SetBounds(bounds_); layer_tree_host()->SetRootLayer(root_layer_); @@ -456,15 +453,14 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest { PostSetNeedsCommitToMainThread(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { if (num_draws_ == 3 && host_impl->settings().impl_side_painting) host_impl->SetNeedsRedrawRect(invalid_rect_); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { EXPECT_EQ(DRAW_SUCCESS, draw_result); gfx::RectF root_damage_rect; @@ -492,7 +488,7 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest { return draw_result; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { switch (num_draws_) { case 0: case 1: @@ -519,7 +515,7 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest { num_draws_++; } - virtual void AfterTest() override { EXPECT_EQ(5, num_draws_); } + void AfterTest() override { EXPECT_EQ(5, num_draws_); } private: int num_draws_; @@ -539,7 +535,7 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest { LayerTreeHostTestUndrawnLayersDamageLater() : root_layer_(ContentLayer::Create(&client_)) {} - virtual void SetupTree() override { + void SetupTree() override { root_layer_->SetIsDrawable(true); root_layer_->SetBounds(gfx::Size(50, 50)); layer_tree_host()->SetRootLayer(root_layer_); @@ -558,12 +554,11 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { EXPECT_EQ(DRAW_SUCCESS, draw_result); gfx::RectF root_damage_rect; @@ -591,7 +586,7 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest { return draw_result; } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: // Test not owning the surface. @@ -613,7 +608,7 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} private: FakeContentLayerClient client_; @@ -633,7 +628,7 @@ class LayerTreeHostTestUndrawnLayersPushContentBoundsLater LayerTreeHostTestUndrawnLayersPushContentBoundsLater() : root_layer_(Layer::Create()) {} - virtual void SetupTree() override { + void SetupTree() override { root_layer_->SetIsDrawable(true); root_layer_->SetBounds(gfx::Size(20, 20)); layer_tree_host()->SetRootLayer(root_layer_); @@ -650,9 +645,9 @@ class LayerTreeHostTestUndrawnLayersPushContentBoundsLater LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { LayerImpl* root = host_impl->active_tree()->root_layer(); LayerImpl* parent = root->children()[0]; LayerImpl* child = parent->children()[0]; @@ -672,7 +667,7 @@ class LayerTreeHostTestUndrawnLayersPushContentBoundsLater } } - virtual void DidCommit() override { + void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 1: parent_layer_->SetOpacity(1.0f); @@ -684,7 +679,7 @@ class LayerTreeHostTestUndrawnLayersPushContentBoundsLater } } - virtual void AfterTest() override {} + void AfterTest() override {} private: scoped_refptr<Layer> root_layer_; @@ -701,21 +696,21 @@ class LayerTreeHostTestCommit : public LayerTreeHostTest { public: LayerTreeHostTestCommit() {} - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); layer_tree_host()->set_background_color(SK_ColorGRAY); PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize()); EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color()); EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} }; MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); @@ -729,21 +724,21 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails LayerTreeHostTestFrameTimeUpdatesAfterActivationFails() : frame_count_with_pending_tree_(0) {} - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); layer_tree_host()->set_background_color(SK_ColorGRAY); PostSetNeedsCommitToMainThread(); } - virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override { + void BeginCommitOnThread(LayerTreeHostImpl* impl) override { EXPECT_EQ(frame_count_with_pending_tree_, 0); if (impl->settings().impl_side_painting) impl->BlockNotifyReadyToActivateForTesting(true); } - virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* impl, - const BeginFrameArgs& args) override { + void WillBeginImplFrameOnThread(LayerTreeHostImpl* impl, + const BeginFrameArgs& args) override { if (impl->pending_tree()) frame_count_with_pending_tree_++; @@ -756,7 +751,7 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails } } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { if (frame_count_with_pending_tree_ > 1) { EXPECT_NE(first_frame_time_.ToInternalValue(), 0); EXPECT_NE(first_frame_time_.ToInternalValue(), @@ -768,12 +763,12 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails EXPECT_FALSE(impl->settings().impl_side_painting); EndTest(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { if (impl->settings().impl_side_painting) EXPECT_NE(frame_count_with_pending_tree_, 1); } - virtual void AfterTest() override {} + void AfterTest() override {} private: int frame_count_with_pending_tree_; @@ -789,14 +784,14 @@ class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest { public: LayerTreeHostTestFrameTimeUpdatesAfterDraw() : frame_(0) {} - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); layer_tree_host()->set_background_color(SK_ColorGRAY); PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { frame_++; if (frame_ == 1) { first_frame_time_ = impl->CurrentBeginFrameArgs().frame_time; @@ -814,7 +809,7 @@ class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest { EndTest(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { // Ensure there isn't a commit between the two draws, to ensure that a // commit isn't required for updating the current frame time. We can // only check for this in the multi-threaded case, since in the single- @@ -823,7 +818,7 @@ class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest { EXPECT_EQ(0, frame_); } - virtual void AfterTest() override {} + void AfterTest() override {} private: int frame_; @@ -838,7 +833,7 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest { public: LayerTreeHostTestStartPageScaleAnimation() {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostTest::SetupTree(); if (layer_tree_host()->settings().impl_side_painting) { @@ -864,18 +859,18 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest { layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, - float scale, - float) override { + void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, + float scale, + float) override { gfx::ScrollOffset offset = scroll_layer_->scroll_offset(); scroll_layer_->SetScrollOffset(ScrollOffsetWithDelta(offset, scroll_delta)); layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { // We get one commit before the first draw, and the animation doesn't happen // until the second draw. switch (impl->active_tree()->source_frame_number()) { @@ -895,7 +890,7 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest { } } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: layer_tree_host()->StartPageScaleAnimation( @@ -904,7 +899,7 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient client_; scoped_refptr<Layer> scroll_layer_; @@ -916,7 +911,7 @@ class LayerTreeHostTestSetVisible : public LayerTreeHostTest { public: LayerTreeHostTestSetVisible() : num_draws_(0) {} - virtual void BeginTest() override { + void BeginTest() override { PostSetNeedsCommitToMainThread(); PostSetVisibleToMainThread(false); // This is suppressed while we're invisible. @@ -925,13 +920,13 @@ class LayerTreeHostTestSetVisible : public LayerTreeHostTest { PostSetVisibleToMainThread(true); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { EXPECT_TRUE(impl->visible()); ++num_draws_; EndTest(); } - virtual void AfterTest() override { EXPECT_EQ(1, num_draws_); } + void AfterTest() override { EXPECT_EQ(1, num_draws_); } private: int num_draws_; @@ -945,7 +940,7 @@ class TestOpacityChangeLayerDelegate : public ContentLayerClient { void SetTestLayer(Layer* test_layer) { test_layer_ = test_layer; } - virtual void PaintContents( + void PaintContents( SkCanvas* canvas, const gfx::Rect& clip, ContentLayerClient::GraphicsContextStatus gc_status) override { @@ -953,8 +948,8 @@ class TestOpacityChangeLayerDelegate : public ContentLayerClient { if (test_layer_) test_layer_->SetOpacity(0.f); } - virtual void DidChangeLayerCanUseLCDText() override {} - virtual bool FillsBoundsCompletely() const override { return false; } + void DidChangeLayerCanUseLCDText() override {} + bool FillsBoundsCompletely() const override { return false; } private: Layer* test_layer_; @@ -970,8 +965,8 @@ class ContentLayerWithUpdateTracking : public ContentLayer { int PaintContentsCount() { return paint_contents_count_; } void ResetPaintContentsCount() { paint_contents_count_ = 0; } - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override { + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override { bool updated = ContentLayer::Update(queue, occlusion); paint_contents_count_++; return updated; @@ -983,7 +978,7 @@ class ContentLayerWithUpdateTracking : public ContentLayer { SetBounds(gfx::Size(10, 10)); SetIsDrawable(true); } - virtual ~ContentLayerWithUpdateTracking() {} + ~ContentLayerWithUpdateTracking() override {} int paint_contents_count_; }; @@ -999,18 +994,16 @@ class LayerTreeHostTestOpacityChange : public LayerTreeHostTest { test_opacity_change_delegate_.SetTestLayer(update_check_layer_.get()); } - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->SetViewportSize(gfx::Size(10, 10)); layer_tree_host()->root_layer()->AddChild(update_check_layer_); PostSetNeedsCommitToMainThread(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { - EndTest(); - } + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { EndTest(); } - virtual void AfterTest() override { + void AfterTest() override { // Update() should have been called once. EXPECT_EQ(1, update_check_layer_->PaintContentsCount()); } @@ -1028,10 +1021,10 @@ class NoScaleContentLayer : public ContentLayer { return make_scoped_refptr(new NoScaleContentLayer(client)); } - virtual void CalculateContentsScale(float ideal_contents_scale, - float* contents_scale_x, - float* contents_scale_y, - gfx::Size* contentBounds) override { + void CalculateContentsScale(float ideal_contents_scale, + float* contents_scale_x, + float* contents_scale_y, + gfx::Size* contentBounds) override { // Skip over the ContentLayer's method to the base Layer class. Layer::CalculateContentsScale(ideal_contents_scale, contents_scale_x, @@ -1042,7 +1035,7 @@ class NoScaleContentLayer : public ContentLayer { private: explicit NoScaleContentLayer(ContentLayerClient* client) : ContentLayer(client) {} - virtual ~NoScaleContentLayer() {} + ~NoScaleContentLayer() override {} }; class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers @@ -1052,7 +1045,7 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers : root_layer_(NoScaleContentLayer::Create(&client_)), child_layer_(ContentLayer::Create(&client_)) {} - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->SetViewportSize(gfx::Size(60, 60)); layer_tree_host()->SetDeviceScaleFactor(1.5); EXPECT_EQ(gfx::Size(60, 60), layer_tree_host()->device_viewport_size()); @@ -1071,7 +1064,7 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { // Should only do one commit. EXPECT_EQ(0, impl->active_tree()->source_frame_number()); // Device scale factor should come over to impl. @@ -1137,7 +1130,7 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} private: FakeContentLayerClient client_; @@ -1150,7 +1143,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers); // Verify atomicity of commits and reuse of textures. class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { public: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->texture_id_allocation_chunk_size = 1; // Make sure partial texture updates are turned off. settings->max_partial_texture_updates = 0; @@ -1158,7 +1151,7 @@ class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { settings->scrollbar_animator = LayerTreeSettings::NoAnimator; } - virtual void SetupTree() override { + void SetupTree() override { layer_ = FakeContentLayer::Create(&client_); layer_->SetBounds(gfx::Size(10, 20)); @@ -1175,12 +1168,12 @@ class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { drew_frame_ = -1; PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { ASSERT_EQ(0u, layer_tree_host()->settings().max_partial_texture_updates); TestWebGraphicsContext3D* context = TestContext(); @@ -1221,7 +1214,7 @@ class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { } } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { TestWebGraphicsContext3D* context = TestContext(); if (drew_frame_ == impl->active_tree()->source_frame_number()) { @@ -1238,12 +1231,12 @@ class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { PostSetNeedsCommitToMainThread(); } - virtual void Layout() override { + void Layout() override { layer_->SetNeedsDisplay(); scrollbar_->SetNeedsDisplay(); } - virtual void AfterTest() override {} + void AfterTest() override {} protected: FakeContentLayerClient client_; @@ -1258,7 +1251,7 @@ MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F( class LayerTreeHostTestDelegatingRendererAtomicCommit : public LayerTreeHostTestDirectRendererAtomicCommit { public: - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { ASSERT_EQ(0u, layer_tree_host()->settings().max_partial_texture_updates); TestWebGraphicsContext3D* context = TestContext(); @@ -1325,7 +1318,7 @@ static void SetLayerPropertiesForTesting(Layer* layer, class LayerTreeHostTestAtomicCommitWithPartialUpdate : public LayerTreeHostTest { public: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->texture_id_allocation_chunk_size = 1; // Allow one partial texture update. settings->max_partial_texture_updates = 1; @@ -1333,7 +1326,7 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate settings->impl_side_painting = false; } - virtual void SetupTree() override { + void SetupTree() override { parent_ = FakeContentLayer::Create(&client_); parent_->SetBounds(gfx::Size(10, 20)); @@ -1347,9 +1340,9 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: parent_->SetNeedsDisplay(); @@ -1376,7 +1369,7 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate } } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { ASSERT_EQ(1u, layer_tree_host()->settings().max_partial_texture_updates); TestWebGraphicsContext3D* context = TestContext(); @@ -1466,7 +1459,7 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate } } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { EXPECT_LT(impl->active_tree()->source_frame_number(), 5); TestWebGraphicsContext3D* context = TestContext(); @@ -1483,7 +1476,7 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate context->ResetUsedTextures(); } - virtual void AfterTest() override {} + void AfterTest() override {} private: FakeContentLayerClient client_; @@ -1498,7 +1491,7 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit : public LayerTreeHostTest { protected: - virtual void SetupTree() override { + void SetupTree() override { root_layer_ = FakeContentLayer::Create(&client_); root_layer_->SetBounds(gfx::Size(100, 100)); @@ -1524,9 +1517,9 @@ class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { Renderer* renderer = host_impl->renderer(); RenderPassId surface1_render_pass_id = host_impl->active_tree() ->root_layer() @@ -1563,12 +1556,12 @@ class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit } } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { if (layer_tree_host()->source_frame_number() < 2) root_layer_->SetNeedsDisplay(); } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_LE(2u, root_layer_->update_count()); EXPECT_LE(2u, surface_layer1_->update_count()); EXPECT_LE(2u, surface_layer2_->update_count()); @@ -1592,14 +1585,12 @@ class EvictionTestLayer : public Layer { return make_scoped_refptr(new EvictionTestLayer()); } - virtual bool Update(ResourceUpdateQueue*, - const OcclusionTracker<Layer>*) override; - virtual bool DrawsContent() const override { return true; } + bool Update(ResourceUpdateQueue*, const OcclusionTracker<Layer>*) override; + bool DrawsContent() const override { return true; } - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* impl) override; - virtual void SetTexturePriorities(const PriorityCalculator&) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* impl) override; + void SetTexturePriorities(const PriorityCalculator&) override; bool HaveBackingTexture() const { return texture_.get() ? texture_->have_backing_texture() : false; @@ -1607,7 +1598,7 @@ class EvictionTestLayer : public Layer { private: EvictionTestLayer() : Layer() {} - virtual ~EvictionTestLayer() {} + ~EvictionTestLayer() override {} void CreateTextureIfNeeded() { if (texture_) @@ -1628,11 +1619,11 @@ class EvictionTestLayerImpl : public LayerImpl { int id) { return make_scoped_ptr(new EvictionTestLayerImpl(tree_impl, id)); } - virtual ~EvictionTestLayerImpl() {} + ~EvictionTestLayerImpl() override {} - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override { + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override { ASSERT_TRUE(has_texture_); ASSERT_NE(0u, layer_tree_impl()->resource_provider()->num_resources()); } @@ -1686,7 +1677,7 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest { impl_for_evict_textures_(0), num_commits_(0) {} - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->SetRootLayer(layer_); layer_tree_host()->SetViewportSize(gfx::Size(10, 20)); @@ -1736,7 +1727,7 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest { // the beginFrame/commit pair. // Commits 5+6 test the path where an eviction happens during the eviction // recovery path. - virtual void DidCommit() override { + void DidCommit() override { switch (num_commits_) { case 1: EXPECT_TRUE(layer_->HaveBackingTexture()); @@ -1764,11 +1755,11 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest { } } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { impl_for_evict_textures_ = impl; } - virtual void Layout() override { + void Layout() override { ++num_commits_; switch (num_commits_) { case 1: @@ -1797,7 +1788,7 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} private: FakeContentLayerClient client_; @@ -1813,7 +1804,7 @@ class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest { LayerTreeHostTestContinuousInvalidate() : num_commit_complete_(0), num_draw_layers_(0) {} - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->SetViewportSize(gfx::Size(10, 10)); layer_tree_host()->root_layer()->SetBounds(gfx::Size(10, 10)); @@ -1826,24 +1817,24 @@ class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { if (num_draw_layers_ == 2) return; content_layer_->SetNeedsDisplay(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { if (num_draw_layers_ == 1) num_commit_complete_++; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { num_draw_layers_++; if (num_draw_layers_ == 2) EndTest(); } - virtual void AfterTest() override { + void AfterTest() override { // Check that we didn't commit twice between first and second draw. EXPECT_EQ(1, num_commit_complete_); } @@ -1862,14 +1853,14 @@ class LayerTreeHostTestDeferCommits : public LayerTreeHostTest { LayerTreeHostTestDeferCommits() : num_commits_deferred_(0), num_complete_commits_(0) {} - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidDeferCommit() override { + void DidDeferCommit() override { num_commits_deferred_++; layer_tree_host()->SetDeferCommits(false); } - virtual void DidCommit() override { + void DidCommit() override { num_complete_commits_++; switch (num_complete_commits_) { case 1: @@ -1886,7 +1877,7 @@ class LayerTreeHostTestDeferCommits : public LayerTreeHostTest { } } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_EQ(1, num_commits_deferred_); EXPECT_EQ(2, num_complete_commits_); } @@ -2063,7 +2054,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted child_layer2_(FakeContentLayer::Create(&client_)), num_commits_(0) {} - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->SetViewportSize(gfx::Size(100, 100)); root_layer_->SetBounds(gfx::Size(100, 100)); child_layer1_->SetBounds(gfx::Size(100, 100)); @@ -2074,8 +2065,8 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted PostSetNeedsCommitToMainThread(); } - virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, - bool visible) override { + void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, + bool visible) override { if (visible) { // One backing should remain unevicted. EXPECT_EQ( @@ -2093,7 +2084,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted EndTest(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { ++num_commits_; switch (num_commits_) { case 1: @@ -2125,7 +2116,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted } } - virtual void AfterTest() override {} + void AfterTest() override {} private: FakeContentLayerClient client_; @@ -2149,17 +2140,17 @@ class LayerTreeHostTestLCDNotification : public LayerTreeHostTest { int paint_count() const { return paint_count_; } int lcd_notification_count() const { return lcd_notification_count_; } - virtual void PaintContents( + void PaintContents( SkCanvas* canvas, const gfx::Rect& clip, ContentLayerClient::GraphicsContextStatus gc_status) override { ++paint_count_; } - virtual void DidChangeLayerCanUseLCDText() override { + void DidChangeLayerCanUseLCDText() override { ++lcd_notification_count_; layer_->SetNeedsDisplay(); } - virtual bool FillsBoundsCompletely() const override { return false; } + bool FillsBoundsCompletely() const override { return false; } private: Layer* layer_; @@ -2167,7 +2158,7 @@ class LayerTreeHostTestLCDNotification : public LayerTreeHostTest { int lcd_notification_count_; }; - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<Layer> root_layer; if (layer_tree_host()->settings().impl_side_painting) root_layer = PictureLayer::Create(&client_); @@ -2187,10 +2178,10 @@ class LayerTreeHostTestLCDNotification : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void AfterTest() override {} + void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void AfterTest() override {} - virtual void DidCommit() override { + void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 1: // The first update consists of one LCD notification and one paint. @@ -2235,25 +2226,24 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestLCDNotification); // Verify that the BeginFrame notification is used to initiate rendering. class LayerTreeHostTestBeginFrameNotification : public LayerTreeHostTest { public: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->begin_frame_scheduling_enabled = true; } - virtual void BeginTest() override { + void BeginTest() override { // This will trigger a SetNeedsBeginFrame which will trigger a // BeginFrame. PostSetNeedsCommitToMainThread(); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame, + DrawResult draw_result) override { EndTest(); return DRAW_SUCCESS; } - virtual void AfterTest() override {} + void AfterTest() override {} private: base::TimeTicks frame_time_; @@ -2264,14 +2254,14 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestBeginFrameNotification); class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled : public LayerTreeHostTest { public: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->begin_frame_scheduling_enabled = true; settings->using_synchronous_renderer_compositor = true; } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { // The BeginFrame notification is turned off now but will get enabled // once we return. End test while it's enabled. ImplThreadTaskRunner()->PostTask( @@ -2280,7 +2270,7 @@ class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled base::Unretained(this))); } - virtual void AfterTest() override {} + void AfterTest() override {} }; MULTI_THREAD_TEST_F( @@ -2291,13 +2281,13 @@ class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest { LayerTreeHostTestAbortedCommitDoesntStall() : commit_count_(0), commit_abort_count_(0), commit_complete_count_(0) {} - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->begin_frame_scheduling_enabled = true; } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { commit_count_++; if (commit_count_ == 4) { // After two aborted commits, request a real commit now to make sure a @@ -2307,14 +2297,14 @@ class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest { } } - virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl, - bool did_handle) override { + void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl, + bool did_handle) override { commit_abort_count_++; // Initiate another abortable commit. host_impl->SetNeedsCommit(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { commit_complete_count_++; if (commit_complete_count_ == 1) { // Initiate an abortable commit after the first commit. @@ -2324,7 +2314,7 @@ class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest { } } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_EQ(commit_count_, 5); EXPECT_EQ(commit_abort_count_, 3); EXPECT_EQ(commit_complete_count_, 2); @@ -2337,7 +2327,7 @@ class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest { class LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor : public LayerTreeHostTestAbortedCommitDoesntStall { - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings); settings->using_synchronous_renderer_compositor = true; } @@ -2348,7 +2338,7 @@ MULTI_THREAD_TEST_F( class LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync : public LayerTreeHostTestAbortedCommitDoesntStall { - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings); settings->throttle_frame_production = false; } @@ -2359,11 +2349,11 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync); class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation : public LayerTreeHostTest { protected: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; } - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostTest::SetupTree(); scoped_refptr<Layer> layer = PictureLayer::Create(&client_); @@ -2372,13 +2362,13 @@ class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation layer_tree_host()->root_layer()->AddChild(layer); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient client_; }; @@ -2395,16 +2385,16 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents void set_layer(Layer* layer) { layer_ = layer; } - virtual void PaintContents( + void PaintContents( SkCanvas* canvas, const gfx::Rect& clip, ContentLayerClient::GraphicsContextStatus gc_status) override { layer_->SetBounds(gfx::Size(2, 2)); } - virtual void DidChangeLayerCanUseLCDText() override {} + void DidChangeLayerCanUseLCDText() override {} - virtual bool FillsBoundsCompletely() const override { return false; } + bool FillsBoundsCompletely() const override { return false; } private: Layer* layer_; @@ -2412,7 +2402,7 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents LayerTreeHostTestChangeLayerPropertiesInPaintContents() : num_commits_(0) {} - virtual void SetupTree() override { + void SetupTree() override { if (layer_tree_host()->settings().impl_side_painting) { scoped_refptr<PictureLayer> root_layer = PictureLayer::Create(&client_); layer_tree_host()->SetRootLayer(root_layer); @@ -2429,10 +2419,10 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void AfterTest() override {} + void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void AfterTest() override {} - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { num_commits_++; if (num_commits_ == 1) { LayerImpl* root_layer = host_impl->active_tree()->root_layer(); @@ -2484,8 +2474,8 @@ class MockIOSurfaceWebGraphicsContext3D : public TestWebGraphicsContext3D { class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest { protected: - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback) - override { + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { scoped_ptr<MockIOSurfaceWebGraphicsContext3D> mock_context_owned( new MockIOSurfaceWebGraphicsContext3D); mock_context_ = mock_context_owned.get(); @@ -2496,7 +2486,7 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest { return FakeOutputSurface::Create3d(mock_context_owned.Pass()); } - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostTest::SetupTree(); layer_tree_host()->root_layer()->SetIsDrawable(false); @@ -2512,9 +2502,9 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest { layer_tree_host()->root_layer()->AddChild(io_surface_layer); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_EQ(0u, host_impl->resource_provider()->num_resources()); // In WillDraw, the IOSurfaceLayer sets up the io surface texture. @@ -2552,10 +2542,9 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest { EXPECT_CALL(*mock_context_, bindTexture(_, 0)).Times(AnyNumber()); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame, + DrawResult draw_result) override { Mock::VerifyAndClearExpectations(&mock_context_); ResourceProvider* resource_provider = host_impl->resource_provider(); EXPECT_EQ(1u, resource_provider->num_resources()); @@ -2587,14 +2576,14 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest { return draw_result; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { Mock::VerifyAndClearExpectations(&mock_context_); EXPECT_CALL(*mock_context_, deleteTexture(1)).Times(AtLeast(1)); EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} int io_surface_id_; MockIOSurfaceWebGraphicsContext3D* mock_context_; @@ -2605,7 +2594,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestIOSurfaceDrawing); class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest { public: - virtual void BeginTest() override { + void BeginTest() override { frame_ = 0; PostSetNeedsCommitToMainThread(); } @@ -2614,7 +2603,7 @@ class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest { // Round 2: commit only (no draw/swap) // Round 3: draw only (no commit) - virtual void DidCommit() override { + void DidCommit() override { int commit = layer_tree_host()->source_frame_number(); switch (commit) { case 2: @@ -2625,7 +2614,7 @@ class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest { } } - virtual void DidCompleteSwapBuffers() override { + void DidCompleteSwapBuffers() override { int commit = layer_tree_host()->source_frame_number(); ++frame_; switch (frame_) { @@ -2642,7 +2631,7 @@ class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} protected: int frame_; @@ -2659,12 +2648,12 @@ TEST_F(LayerTreeHostTestNumFramesPending, DISABLED_GLRenderer) { class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { public: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { // PictureLayer can only be used with impl side painting enabled. settings->impl_side_painting = true; } - virtual void SetupTree() override { + void SetupTree() override { layer_ = FakePictureLayer::Create(&client_); // Force commits to not be aborted so new frames get drawn, otherwise // the renderer gets deferred initialized but nothing new needs drawing. @@ -2673,15 +2662,15 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { did_initialize_gl_ = false; did_release_gl_ = false; last_source_frame_number_drawn_ = -1; // Never drawn. PostSetNeedsCommitToMainThread(); } - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback) - override { + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { scoped_ptr<TestWebGraphicsContext3D> context3d( TestWebGraphicsContext3D::Create()); @@ -2690,7 +2679,7 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { delegating_renderer()); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { ASSERT_TRUE(host_impl->RootLayer()); FakePictureLayerImpl* layer_impl = static_cast<FakePictureLayerImpl*>(host_impl->RootLayer()); @@ -2746,8 +2735,7 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { did_release_gl_ = true; } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ASSERT_TRUE(result); DelegatedFrameData* delegated_frame_data = output_surface()->last_sent_frame().delegated_frame_data.get(); @@ -2764,7 +2752,7 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { host_impl->ReclaimResources(&ack); } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_TRUE(did_initialize_gl_); EXPECT_TRUE(did_release_gl_); } @@ -2781,7 +2769,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize); class LayerTreeHostTestDeferredInitializeWithGpuRasterization : public LayerTreeHostTestDeferredInitialize { - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { // PictureLayer can only be used with impl side painting enabled. settings->impl_side_painting = true; settings->gpu_rasterization_enabled = true; @@ -2796,13 +2784,13 @@ class LayerTreeHostTestUIResource : public LayerTreeHostTest { public: LayerTreeHostTestUIResource() : num_ui_resources_(0) {} - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->texture_id_allocation_chunk_size = 1; } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { int frame = layer_tree_host()->source_frame_number(); switch (frame) { case 1: @@ -2863,17 +2851,17 @@ class LayerTreeHostTestUIResource : public LayerTreeHostTest { } } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { if (!layer_tree_host()->settings().impl_side_painting) PerformTest(impl); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { if (layer_tree_host()->settings().impl_side_painting) PerformTest(impl); } - virtual void AfterTest() override {} + void AfterTest() override {} private: // Must clear all resources before exiting. @@ -2900,9 +2888,9 @@ class PushPropertiesCountingLayerImpl : public LayerImpl { return make_scoped_ptr(new PushPropertiesCountingLayerImpl(tree_impl, id)); } - virtual ~PushPropertiesCountingLayerImpl() {} + ~PushPropertiesCountingLayerImpl() override {} - virtual void PushPropertiesTo(LayerImpl* layer) override { + void PushPropertiesTo(LayerImpl* layer) override { LayerImpl::PushPropertiesTo(layer); push_properties_count_++; // Push state to the active tree because we can only access it from there. @@ -2910,8 +2898,7 @@ class PushPropertiesCountingLayerImpl : public LayerImpl { layer)->push_properties_count_ = push_properties_count_; } - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override { + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override { return PushPropertiesCountingLayerImpl::Create(tree_impl, id()); } @@ -2934,15 +2921,14 @@ class PushPropertiesCountingLayer : public Layer { return new PushPropertiesCountingLayer(); } - virtual void PushPropertiesTo(LayerImpl* layer) override { + void PushPropertiesTo(LayerImpl* layer) override { Layer::PushPropertiesTo(layer); push_properties_count_++; if (persist_needs_push_properties_) needs_push_properties_ = true; } - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override { + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override { return PushPropertiesCountingLayerImpl::Create(tree_impl, id()); } @@ -2960,7 +2946,7 @@ class PushPropertiesCountingLayer : public Layer { : push_properties_count_(0), persist_needs_push_properties_(false) { SetBounds(gfx::Size(1, 1)); } - virtual ~PushPropertiesCountingLayer() {} + ~PushPropertiesCountingLayer() override {} size_t push_properties_count_; bool persist_needs_push_properties_; @@ -2968,7 +2954,7 @@ class PushPropertiesCountingLayer : public Layer { class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest { protected: - virtual void BeginTest() override { + void BeginTest() override { num_commits_ = 0; expected_push_properties_root_ = 0; expected_push_properties_child_ = 0; @@ -2979,7 +2965,7 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest { PostSetNeedsCommitToMainThread(); } - virtual void SetupTree() override { + void SetupTree() override { root_ = PushPropertiesCountingLayer::Create(); child_ = PushPropertiesCountingLayer::Create(); child2_ = PushPropertiesCountingLayer::Create(); @@ -2998,7 +2984,7 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { ++num_commits_; EXPECT_EQ(expected_push_properties_root_, root_->push_properties_count()); @@ -3138,7 +3124,7 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest { ++expected_push_properties_leaf_layer_; } - virtual void AfterTest() override {} + void AfterTest() override {} int num_commits_; FakeContentLayerClient client_; @@ -3161,7 +3147,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestLayersPushProperties); class LayerTreeHostTestImplLayersPushProperties : public LayerTreeHostTestLayersPushProperties { protected: - virtual void BeginTest() override { + void BeginTest() override { expected_push_properties_root_impl_ = 0; expected_push_properties_child_impl_ = 0; expected_push_properties_grandchild_impl_ = 0; @@ -3170,7 +3156,7 @@ class LayerTreeHostTestImplLayersPushProperties LayerTreeHostTestLayersPushProperties::BeginTest(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { // These commits are in response to the changes made in // LayerTreeHostTestLayersPushProperties::DidCommitAndDrawFrame() switch (num_commits_) { @@ -3361,9 +3347,9 @@ TEST_F(LayerTreeHostTestImplLayersPushProperties, DelegatingRenderer) { class LayerTreeHostTestPropertyChangesDuringUpdateArePushed : public LayerTreeHostTest { protected: - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void SetupTree() override { + void SetupTree() override { root_ = Layer::Create(); root_->SetBounds(gfx::Size(1, 1)); @@ -3378,7 +3364,7 @@ class LayerTreeHostTestPropertyChangesDuringUpdateArePushed LayerTreeHostTest::SetupTree(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 0: break; @@ -3407,7 +3393,7 @@ class LayerTreeHostTestPropertyChangesDuringUpdateArePushed } } - virtual void AfterTest() override {} + void AfterTest() override {} scoped_refptr<Layer> root_; scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer_; @@ -3417,9 +3403,9 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestPropertyChangesDuringUpdateArePushed); class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest { protected: - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void SetupTree() override { + void SetupTree() override { root_ = PushPropertiesCountingLayer::Create(); child_ = PushPropertiesCountingLayer::Create(); root_->AddChild(child_); @@ -3428,7 +3414,7 @@ class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 0: break; @@ -3460,7 +3446,7 @@ class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} scoped_refptr<PushPropertiesCountingLayer> root_; scoped_refptr<PushPropertiesCountingLayer> child_; @@ -3471,7 +3457,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestSetDrawableCausesCommit); class LayerTreeHostTestCasePushPropertiesThreeGrandChildren : public LayerTreeHostTest { protected: - virtual void BeginTest() override { + void BeginTest() override { expected_push_properties_root_ = 0; expected_push_properties_child_ = 0; expected_push_properties_grandchild1_ = 0; @@ -3480,7 +3466,7 @@ class LayerTreeHostTestCasePushPropertiesThreeGrandChildren PostSetNeedsCommitToMainThread(); } - virtual void SetupTree() override { + void SetupTree() override { root_ = PushPropertiesCountingLayer::Create(); child_ = PushPropertiesCountingLayer::Create(); grandchild1_ = PushPropertiesCountingLayer::Create(); @@ -3496,7 +3482,7 @@ class LayerTreeHostTestCasePushPropertiesThreeGrandChildren LayerTreeHostTest::SetupTree(); } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient client_; scoped_refptr<PushPropertiesCountingLayer> root_; @@ -3514,7 +3500,7 @@ class LayerTreeHostTestCasePushPropertiesThreeGrandChildren class LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { protected: - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; switch (last_source_frame_number) { case 0: @@ -3554,7 +3540,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush); class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { protected: - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; switch (last_source_frame_number) { case 0: @@ -3637,7 +3623,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion); class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { protected: - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; switch (last_source_frame_number) { case 0: @@ -3685,7 +3671,7 @@ MULTI_THREAD_TEST_F( class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { protected: - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; switch (last_source_frame_number) { case 0: @@ -3753,7 +3739,7 @@ MULTI_THREAD_TEST_F( class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { protected: - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; switch (last_source_frame_number) { case 0: @@ -3817,7 +3803,7 @@ MULTI_THREAD_TEST_F( class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { protected: - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { int last_source_frame_number = layer_tree_host()->source_frame_number() - 1; switch (last_source_frame_number) { case 0: @@ -3884,15 +3870,14 @@ class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest { LayerTreeHostTestTreeActivationCallback() : num_commits_(0), callback_count_(0) {} - virtual void BeginTest() override { + void BeginTest() override { EXPECT_TRUE(HasImplThread()); PostSetNeedsCommitToMainThread(); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { ++num_commits_; switch (num_commits_) { case 1: @@ -3921,7 +3906,7 @@ class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest { host_impl, frame_data, draw_result); } - virtual void AfterTest() override { EXPECT_EQ(3, num_commits_); } + void AfterTest() override { EXPECT_EQ(3, num_commits_); } void SetCallback(bool enable) { output_surface()->SetTreeActivationCallback( @@ -3950,7 +3935,7 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest { public: LayerInvalidateCausesDraw() : num_commits_(0), num_draws_(0) {} - virtual void BeginTest() override { + void BeginTest() override { ASSERT_TRUE(!!invalidate_layer_.get()) << "Derived tests must set this in SetupTree"; @@ -3958,23 +3943,23 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { // After commit, invalidate the layer. This should cause a commit. if (layer_tree_host()->source_frame_number() == 1) invalidate_layer_->SetNeedsDisplay(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { num_draws_++; if (impl->active_tree()->source_frame_number() == 1) EndTest(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { num_commits_++; } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_GE(2, num_commits_); EXPECT_GE(2, num_draws_); } @@ -3992,7 +3977,7 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest { // response to that invalidation. class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw { public: - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostTest::SetupTree(); scoped_refptr<VideoLayer> video_layer = VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0); @@ -4015,7 +4000,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate); class LayerTreeHostTestIOSurfaceLayerInvalidate : public LayerInvalidateCausesDraw { public: - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostTest::SetupTree(); scoped_refptr<IOSurfaceLayer> layer = IOSurfaceLayer::Create(); layer->SetBounds(gfx::Size(10, 10)); @@ -4034,7 +4019,7 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest { protected: - virtual void SetupTree() override { + void SetupTree() override { root_layer_ = Layer::Create(); root_layer_->SetPosition(gfx::Point()); root_layer_->SetBounds(gfx::Size(10, 10)); @@ -4055,9 +4040,9 @@ class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: // The layer type used does not need to push properties every frame. @@ -4077,7 +4062,7 @@ class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest { } } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { LayerImpl* root = impl->active_tree()->root_layer(); LayerImpl* parent = root->children()[0]; LayerImpl* child = parent->children()[0]; @@ -4089,7 +4074,7 @@ class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} scoped_refptr<Layer> root_layer_; scoped_refptr<SolidColorLayer> parent_layer_; @@ -4100,11 +4085,11 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPushHiddenLayer); class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest { protected: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; } - virtual void SetupTree() override { + void SetupTree() override { root_layer_ = FakePictureLayer::Create(&client_); root_layer_->SetBounds(gfx::Size(10, 10)); @@ -4112,21 +4097,21 @@ class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { // The viewport is empty, but we still need to update layers on the main // thread. layer_tree_host()->SetViewportSize(gfx::Size(0, 0)); PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { // The layer should be updated even though the viewport is empty, so we // are capable of drawing it on the impl tree. EXPECT_GT(root_layer_->update_count(), 0u); EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient client_; scoped_refptr<FakePictureLayer> root_layer_; @@ -4140,7 +4125,7 @@ class LayerTreeHostTestAbortEvictedTextures : public LayerTreeHostTest { : num_will_begin_main_frames_(0), num_impl_commits_(0) {} protected: - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<SolidColorLayer> root_layer = SolidColorLayer::Create(); root_layer->SetBounds(gfx::Size(200, 200)); root_layer->SetIsDrawable(true); @@ -4149,9 +4134,9 @@ class LayerTreeHostTestAbortEvictedTextures : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void WillBeginMainFrame() override { + void WillBeginMainFrame() override { num_will_begin_main_frames_++; switch (num_will_begin_main_frames_) { case 2: @@ -4162,11 +4147,11 @@ class LayerTreeHostTestAbortEvictedTextures : public LayerTreeHostTest { } } - virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override { + void BeginCommitOnThread(LayerTreeHostImpl* impl) override { num_impl_commits_++; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { switch (impl->SourceAnimationFrameNumber()) { case 1: // Prevent draws until commit. @@ -4181,7 +4166,7 @@ class LayerTreeHostTestAbortEvictedTextures : public LayerTreeHostTest { } } - virtual void AfterTest() override { + void AfterTest() override { // Ensure that the commit was truly aborted. EXPECT_EQ(2, num_will_begin_main_frames_); EXPECT_EQ(1, num_impl_commits_); @@ -4197,12 +4182,12 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestAbortEvictedTextures); class LayerTreeHostTestMaxTransferBufferUsageBytes : public LayerTreeHostTest { protected: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; } - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback) - override { + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { scoped_refptr<TestContextProvider> context_provider = TestContextProvider::Create(); context_provider->SetMaxTransferBufferUsageBytes(1024 * 1024); @@ -4212,7 +4197,7 @@ class LayerTreeHostTestMaxTransferBufferUsageBytes : public LayerTreeHostTest { return FakeOutputSurface::Create3d(context_provider); } - virtual void SetupTree() override { + void SetupTree() override { client_.set_fill_with_nonsolid_color(true); scoped_refptr<FakePictureLayer> root_layer = FakePictureLayer::Create(&client_); @@ -4223,9 +4208,9 @@ class LayerTreeHostTestMaxTransferBufferUsageBytes : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { TestWebGraphicsContext3D* context = TestContext(); // Expect that the transfer buffer memory used is equal to the @@ -4234,7 +4219,7 @@ class LayerTreeHostTestMaxTransferBufferUsageBytes : public LayerTreeHostTest { EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} private: FakeContentLayerClient client_; @@ -4249,14 +4234,14 @@ class LayerTreeHostTestMemoryLimits : public LayerTreeHostTest { public: LayerTreeHostTestMemoryLimits() : num_commits_(0) {} - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void WillCommit() override { + void WillCommit() override { // Some commits are aborted, so increment number of attempted commits here. num_commits_++; } - virtual void DidCommit() override { + void DidCommit() override { switch (num_commits_) { case 1: // Verify default values. @@ -4301,7 +4286,7 @@ class LayerTreeHostTestMemoryLimits : public LayerTreeHostTest { } } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { switch (num_commits_) { case 1: break; @@ -4326,7 +4311,7 @@ class LayerTreeHostTestMemoryLimits : public LayerTreeHostTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} private: int num_commits_; @@ -4343,8 +4328,8 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface : first_output_surface_memory_limit_(4321234), second_output_surface_memory_limit_(1234321) {} - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback) - override { + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { if (!first_context_provider_.get()) { first_context_provider_ = TestContextProvider::Create(); } else { @@ -4369,16 +4354,16 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface return output_surface.Pass(); } - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); root_->SetBounds(gfx::Size(20, 20)); layer_tree_host()->SetRootLayer(root_); LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { // Lost context sometimes takes two frames to recreate. The third frame // is sometimes aborted, so wait until the fourth frame to verify that // the memory has been set, and the fifth frame to end the test. @@ -4389,8 +4374,7 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* impl, bool result) override { switch (impl->active_tree()->source_frame_number()) { case 1: EXPECT_EQ(first_output_surface_memory_limit_, @@ -4406,7 +4390,7 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface } } - virtual void AfterTest() override {} + void AfterTest() override {} scoped_refptr<TestContextProvider> first_context_provider_; scoped_refptr<TestContextProvider> second_context_provider_; @@ -4438,19 +4422,19 @@ class TestSwapPromise : public SwapPromise { public: explicit TestSwapPromise(TestSwapPromiseResult* result) : result_(result) {} - virtual ~TestSwapPromise() { + ~TestSwapPromise() override { base::AutoLock lock(result_->lock); result_->dtor_called = true; } - virtual void DidSwap(CompositorFrameMetadata* metadata) override { + void DidSwap(CompositorFrameMetadata* metadata) override { base::AutoLock lock(result_->lock); EXPECT_FALSE(result_->did_swap_called); EXPECT_FALSE(result_->did_not_swap_called); result_->did_swap_called = true; } - virtual void DidNotSwap(DidNotSwapReason reason) override { + void DidNotSwap(DidNotSwapReason reason) override { base::AutoLock lock(result_->lock); EXPECT_FALSE(result_->did_swap_called); EXPECT_FALSE(result_->did_not_swap_called); @@ -4458,7 +4442,7 @@ class TestSwapPromise : public SwapPromise { result_->reason = reason; } - virtual int64 TraceId() const override { return 0; } + int64 TraceId() const override { return 0; } private: // Not owned. @@ -4470,16 +4454,16 @@ class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest { LayerTreeHostTestBreakSwapPromise() : commit_count_(0), commit_complete_count_(0) {} - virtual void WillBeginMainFrame() override { + void WillBeginMainFrame() override { ASSERT_LE(commit_count_, 2); scoped_ptr<SwapPromise> swap_promise( new TestSwapPromise(&swap_promise_result_[commit_count_])); layer_tree_host()->QueueSwapPromise(swap_promise.Pass()); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { commit_count_++; if (commit_count_ == 2) { // This commit will finish. @@ -4487,7 +4471,7 @@ class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest { } } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { commit_complete_count_++; if (commit_complete_count_ == 1) { // This commit will be aborted because no actual update. @@ -4497,7 +4481,7 @@ class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest { } } - virtual void AfterTest() override { + void AfterTest() override { // 3 commits are scheduled. 2 completes. 1 is aborted. EXPECT_EQ(commit_count_, 3); EXPECT_EQ(commit_complete_count_, 2); @@ -4541,14 +4525,14 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise); class LayerTreeHostTestBreakSwapPromiseForVisibilityAbortedCommit : public LayerTreeHostTest { protected: - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { layer_tree_host()->SetDeferCommits(true); layer_tree_host()->SetNeedsCommit(); } - virtual void DidDeferCommit() override { + void DidDeferCommit() override { layer_tree_host()->SetVisible(false); scoped_ptr<SwapPromise> swap_promise( new TestSwapPromise(&swap_promise_result_)); @@ -4556,12 +4540,12 @@ class LayerTreeHostTestBreakSwapPromiseForVisibilityAbortedCommit layer_tree_host()->SetDeferCommits(false); } - virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl, - bool did_handle) override { + void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl, + bool did_handle) override { EndTest(); } - virtual void AfterTest() override { + void AfterTest() override { { base::AutoLock lock(swap_promise_result_.lock); EXPECT_FALSE(swap_promise_result_.did_swap_called); @@ -4580,16 +4564,16 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostTestBreakSwapPromiseForContextAbortedCommit : public LayerTreeHostTest { protected: - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { if (TestEnded()) return; layer_tree_host()->SetDeferCommits(true); layer_tree_host()->SetNeedsCommit(); } - virtual void DidDeferCommit() override { + void DidDeferCommit() override { layer_tree_host()->DidLoseOutputSurface(); scoped_ptr<SwapPromise> swap_promise( new TestSwapPromise(&swap_promise_result_)); @@ -4597,8 +4581,8 @@ class LayerTreeHostTestBreakSwapPromiseForContextAbortedCommit layer_tree_host()->SetDeferCommits(false); } - virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl, - bool did_handle) override { + void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl, + bool did_handle) override { EndTest(); // This lets the test finally commit and exit. MainThreadTaskRunner()->PostTask( @@ -4612,7 +4596,7 @@ class LayerTreeHostTestBreakSwapPromiseForContextAbortedCommit layer_tree_host()->OnCreateAndInitializeOutputSurfaceAttempted(true); } - virtual void AfterTest() override { + void AfterTest() override { { base::AutoLock lock(swap_promise_result_.lock); EXPECT_FALSE(swap_promise_result_.did_swap_called); @@ -4637,17 +4621,15 @@ class SimpleSwapPromiseMonitor : public SwapPromiseMonitor { : SwapPromiseMonitor(layer_tree_host, layer_tree_host_impl), set_needs_commit_count_(set_needs_commit_count) {} - virtual ~SimpleSwapPromiseMonitor() {} + ~SimpleSwapPromiseMonitor() override {} - virtual void OnSetNeedsCommitOnMain() override { - (*set_needs_commit_count_)++; - } + void OnSetNeedsCommitOnMain() override { (*set_needs_commit_count_)++; } - virtual void OnSetNeedsRedrawOnImpl() override { + void OnSetNeedsRedrawOnImpl() override { ADD_FAILURE() << "Should not get called on main thread."; } - virtual void OnForwardScrollUpdateToMainThreadOnImpl() override { + void OnForwardScrollUpdateToMainThreadOnImpl() override { ADD_FAILURE() << "Should not get called on main thread."; } @@ -4657,9 +4639,9 @@ class SimpleSwapPromiseMonitor : public SwapPromiseMonitor { class LayerTreeHostTestSimpleSwapPromiseMonitor : public LayerTreeHostTest { public: - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void WillBeginMainFrame() override { + void WillBeginMainFrame() override { if (TestEnded()) return; @@ -4708,7 +4690,7 @@ class LayerTreeHostTestSimpleSwapPromiseMonitor : public LayerTreeHostTest { EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} }; SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); @@ -4716,18 +4698,18 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); class LayerTreeHostTestHighResRequiredAfterEvictingUIResources : public LayerTreeHostTest { protected: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; } - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostTest::SetupTree(); ui_resource_ = FakeScopedUIResource::Create(layer_tree_host()); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { host_impl->EvictAllUIResources(); // Existence of evicted UI resources will trigger NEW_CONTENT_TAKES_PRIORITY // mode. Active tree should require high-res to draw after entering this @@ -4736,7 +4718,7 @@ class LayerTreeHostTestHighResRequiredAfterEvictingUIResources EXPECT_TRUE(host_impl->RequiresHighResToDraw()); } - virtual void DidCommit() override { + void DidCommit() override { int frame = layer_tree_host()->source_frame_number(); switch (frame) { case 1: @@ -4749,7 +4731,7 @@ class LayerTreeHostTestHighResRequiredAfterEvictingUIResources } } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient client_; scoped_ptr<FakeScopedUIResource> ui_resource_; @@ -4760,14 +4742,14 @@ class LayerTreeHostTestHighResRequiredAfterEvictingUIResources class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest { protected: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; EXPECT_FALSE(settings->gpu_rasterization_enabled); EXPECT_FALSE(settings->gpu_rasterization_forced); } - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostTest::SetupTree(); scoped_refptr<PictureLayer> layer = PictureLayer::Create(&layer_client_); @@ -4776,7 +4758,7 @@ class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest { layer_tree_host()->root_layer()->AddChild(layer); } - virtual void BeginTest() override { + void BeginTest() override { Layer* root = layer_tree_host()->root_layer(); PictureLayer* layer = static_cast<PictureLayer*>(root->child_at(0)); PicturePile* pile = layer->GetPicturePileForTesting(); @@ -4796,18 +4778,18 @@ class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest { PostSetNeedsCommitToMainThread(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_FALSE(host_impl->pending_tree()->use_gpu_rasterization()); EXPECT_FALSE(host_impl->use_gpu_rasterization()); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_FALSE(host_impl->active_tree()->use_gpu_rasterization()); EXPECT_FALSE(host_impl->use_gpu_rasterization()); EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient layer_client_; }; @@ -4816,14 +4798,14 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationDefault); class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest { protected: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; EXPECT_FALSE(settings->gpu_rasterization_enabled); settings->gpu_rasterization_enabled = true; } - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostTest::SetupTree(); scoped_refptr<PictureLayer> layer = PictureLayer::Create(&layer_client_); @@ -4832,7 +4814,7 @@ class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest { layer_tree_host()->root_layer()->AddChild(layer); } - virtual void BeginTest() override { + void BeginTest() override { Layer* root = layer_tree_host()->root_layer(); PictureLayer* layer = static_cast<PictureLayer*>(root->child_at(0)); PicturePile* pile = layer->GetPicturePileForTesting(); @@ -4861,18 +4843,18 @@ class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest { PostSetNeedsCommitToMainThread(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_FALSE(host_impl->pending_tree()->use_gpu_rasterization()); EXPECT_FALSE(host_impl->use_gpu_rasterization()); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_FALSE(host_impl->active_tree()->use_gpu_rasterization()); EXPECT_FALSE(host_impl->use_gpu_rasterization()); EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient layer_client_; }; @@ -4881,14 +4863,14 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationEnabled); class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest { protected: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; EXPECT_FALSE(settings->gpu_rasterization_forced); settings->gpu_rasterization_forced = true; } - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostTest::SetupTree(); scoped_refptr<PictureLayer> layer = PictureLayer::Create(&layer_client_); @@ -4897,7 +4879,7 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest { layer_tree_host()->root_layer()->AddChild(layer); } - virtual void BeginTest() override { + void BeginTest() override { Layer* root = layer_tree_host()->root_layer(); PictureLayer* layer = static_cast<PictureLayer*>(root->child_at(0)); PicturePile* pile = layer->GetPicturePileForTesting(); @@ -4926,18 +4908,18 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest { PostSetNeedsCommitToMainThread(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_TRUE(host_impl->pending_tree()->use_gpu_rasterization()); EXPECT_TRUE(host_impl->use_gpu_rasterization()); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_TRUE(host_impl->active_tree()->use_gpu_rasterization()); EXPECT_TRUE(host_impl->use_gpu_rasterization()); EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient layer_client_; }; @@ -4952,7 +4934,7 @@ class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest { protected: enum { kExpectedNumCommits = 10 }; - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<Layer> root_layer = Layer::Create(); root_layer->SetBounds(bounds_); @@ -4972,7 +4954,7 @@ class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest { LayerTreeHostTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { MainThreadTaskRunner()->PostTask( FROM_HERE, base::Bind( @@ -4990,11 +4972,11 @@ class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest { milliseconds_per_frame)); } - virtual void BeginMainFrame(const BeginFrameArgs& args) override { + void BeginMainFrame(const BeginFrameArgs& args) override { child_layer_->SetNeedsDisplay(); } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_LE(kExpectedNumCommits, num_commits_); EXPECT_LE(kExpectedNumCommits, num_draws_); int update_count = content_layer_.get() @@ -5003,12 +4985,12 @@ class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest { EXPECT_LE(kExpectedNumCommits, update_count); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { if (++num_draws_ == kExpectedNumCommits) EndTest(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { ++num_commits_; } @@ -5042,24 +5024,24 @@ class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest { LayerTreeHostTestActivateOnInvisible() : activation_count_(0), visible_(true) {} - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; } - virtual void BeginTest() override { + void BeginTest() override { // Kick off the test with a commit. PostSetNeedsCommitToMainThread(); } - virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { + void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { // Make sure we don't activate using the notify signal from tile manager. host_impl->BlockNotifyReadyToActivateForTesting(true); } - virtual void DidCommit() override { layer_tree_host()->SetVisible(false); } + void DidCommit() override { layer_tree_host()->SetVisible(false); } - virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, - bool visible) override { + void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, + bool visible) override { visible_ = visible; // Once invisible, we can go visible again. @@ -5071,12 +5053,12 @@ class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest { } } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { ++activation_count_; EXPECT_FALSE(visible_); } - virtual void AfterTest() override { + void AfterTest() override { // Ensure we activated even though the signal was blocked. EXPECT_EQ(1, activation_count_); EXPECT_TRUE(visible_); @@ -5099,11 +5081,11 @@ class LayerTreeHostTestSynchronousCompositeSwapPromise public: LayerTreeHostTestSynchronousCompositeSwapPromise() : commit_count_(0) {} - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->single_thread_proxy_scheduler = false; } - virtual void BeginTest() override { + void BeginTest() override { // Successful composite. scoped_ptr<SwapPromise> swap_promise0( new TestSwapPromise(&swap_promise_result_[0])); @@ -5128,12 +5110,12 @@ class LayerTreeHostTestSynchronousCompositeSwapPromise EndTest(); } - virtual void DidCommit() override { + void DidCommit() override { commit_count_++; ASSERT_LE(commit_count_, 3); } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_EQ(3, commit_count_); // Initial swap promise should have succeded. diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index 67fb6f81..cfd8a14 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -21,7 +21,7 @@ namespace { class LayerTreeHostAnimationTest : public LayerTreeTest { public: - virtual void SetupTree() override { + void SetupTree() override { LayerTreeTest::SetupTree(); layer_tree_host()->root_layer()->set_layer_animation_delegate(this); } @@ -35,11 +35,9 @@ class LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested() : num_commits_(0) {} - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) override { + void BeginMainFrame(const BeginFrameArgs& args) override { // We skip the first commit because its the commit that populates the // impl thread with a tree. After the second commit, the test is done. if (num_commits_ != 1) @@ -52,7 +50,7 @@ class LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested // verify that CommitRequested has gone back to false. } - virtual void DidCommit() override { + void DidCommit() override { if (!num_commits_) { EXPECT_FALSE(layer_tree_host()->CommitRequested()); layer_tree_host()->SetNeedsAnimate(); @@ -66,7 +64,7 @@ class LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested num_commits_++; } - virtual void AfterTest() override {} + void AfterTest() override {} private: int num_commits_; @@ -86,11 +84,9 @@ class LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback() : num_begin_frames_(0) {} - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) override { + void BeginMainFrame(const BeginFrameArgs& args) override { if (!num_begin_frames_) { layer_tree_host()->SetNeedsAnimate(); num_begin_frames_++; @@ -99,7 +95,7 @@ class LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} private: int num_begin_frames_; @@ -117,13 +113,12 @@ class LayerTreeHostAnimationTestAddAnimation LayerTreeHostAnimationTestAddAnimation() : num_begin_frames_(0), received_animation_started_notification_(false) {} - virtual void BeginTest() override { + void BeginTest() override { PostAddInstantAnimationToMainThread(layer_tree_host()->root_layer()); } - virtual void UpdateAnimationState( - LayerTreeHostImpl* host_impl, - bool has_unfinished_animation) override { + void UpdateAnimationState(LayerTreeHostImpl* host_impl, + bool has_unfinished_animation) override { if (!num_begin_frames_) { // The animation had zero duration so LayerTreeHostImpl should no // longer need to animate its layers. @@ -146,9 +141,9 @@ class LayerTreeHostAnimationTestAddAnimation } } - virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationStarted(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { received_animation_started_notification_ = true; start_time_ = monotonic_time; if (num_begin_frames_) { @@ -165,7 +160,7 @@ class LayerTreeHostAnimationTestAddAnimation } } - virtual void AfterTest() override {} + void AfterTest() override {} private: int num_begin_frames_; @@ -183,29 +178,27 @@ class LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws() : started_animating_(false) {} - virtual void BeginTest() override { + void BeginTest() override { PostAddAnimationToMainThread(layer_tree_host()->root_layer()); } - virtual void AnimateLayers( - LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) override { + void AnimateLayers(LayerTreeHostImpl* host_impl, + base::TimeTicks monotonic_time) override { started_animating_ = true; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { if (started_animating_) EndTest(); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame, + DrawResult draw_result) override { return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; } - virtual void AfterTest() override { } + void AfterTest() override {} private: bool started_animating_; @@ -221,13 +214,12 @@ class LayerTreeHostAnimationTestAnimationsGetDeleted LayerTreeHostAnimationTestAnimationsGetDeleted() : started_animating_(false) {} - virtual void BeginTest() override { + void BeginTest() override { PostAddAnimationToMainThread(layer_tree_host()->root_layer()); } - virtual void AnimateLayers( - LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) override { + void AnimateLayers(LayerTreeHostImpl* host_impl, + base::TimeTicks monotonic_time) override { bool have_animations = !host_impl->animation_registrar()-> active_animation_controllers().empty(); if (!started_animating_ && have_animations) { @@ -239,16 +231,15 @@ class LayerTreeHostAnimationTestAnimationsGetDeleted EndTest(); } - virtual void NotifyAnimationFinished( - base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationFinished(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { // Animations on the impl-side controller only get deleted during a commit, // so we need to schedule a commit. layer_tree_host()->SetNeedsCommit(); } - virtual void AfterTest() override {} + void AfterTest() override {} private: bool started_animating_; @@ -263,16 +254,15 @@ class LayerTreeHostAnimationTestTickAnimationWhileBackgrounded LayerTreeHostAnimationTestTickAnimationWhileBackgrounded() : num_begin_frames_(0) {} - virtual void BeginTest() override { + void BeginTest() override { PostAddLongAnimationToMainThread(layer_tree_host()->root_layer()); } // Use WillAnimateLayers to set visible false before the animation runs and // causes a commit, so we block the second visible animate in single-thread // mode. - virtual void WillAnimateLayers( - LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) override { + void WillAnimateLayers(LayerTreeHostImpl* host_impl, + base::TimeTicks monotonic_time) override { // Verify that the host can draw, it's just not visible. EXPECT_TRUE(host_impl->CanDraw()); if (num_begin_frames_ < 2) { @@ -287,7 +277,7 @@ class LayerTreeHostAnimationTestTickAnimationWhileBackgrounded EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} private: int num_begin_frames_; @@ -305,18 +295,18 @@ class LayerTreeHostAnimationTestAnimationTickTimeIsMonotonic LayerTreeHostAnimationTestAnimationTickTimeIsMonotonic() : has_background_ticked_(false), num_foreground_animates_(0) {} - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { // Make sure that drawing many times doesn't cause a checkerboarded // animation to start so we avoid flake in this test. settings->timeout_and_draw_when_animation_checkerboards = false; } - virtual void BeginTest() override { + void BeginTest() override { PostAddLongAnimationToMainThread(layer_tree_host()->root_layer()); } - virtual void AnimateLayers(LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) override { + void AnimateLayers(LayerTreeHostImpl* host_impl, + base::TimeTicks monotonic_time) override { EXPECT_GE(monotonic_time, last_tick_time_); last_tick_time_ = monotonic_time; if (host_impl->visible()) { @@ -331,16 +321,15 @@ class LayerTreeHostAnimationTestAnimationTickTimeIsMonotonic } } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame, + DrawResult draw_result) override { if (TestEnded()) return draw_result; return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; } - virtual void AfterTest() override {} + void AfterTest() override {} private: bool has_background_ticked_; @@ -359,23 +348,22 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree() : active_tree_was_animated_(false) {} - virtual base::TimeDelta LowFrequencyAnimationInterval() const override { + base::TimeDelta LowFrequencyAnimationInterval() const override { return base::TimeDelta::FromMilliseconds(4); } - virtual void BeginTest() override { + void BeginTest() override { PostAddAnimationToMainThread(layer_tree_host()->root_layer()); } - virtual void NotifyAnimationFinished( - base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationFinished(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { // Replace animated commits with an empty tree. layer_tree_host()->SetRootLayer(make_scoped_refptr<Layer>(NULL)); } - virtual void DidCommit() override { + void DidCommit() override { // This alternates setting an empty tree and a non-empty tree with an // animation. switch (layer_tree_host()->source_frame_number()) { @@ -396,7 +384,7 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree } } - virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { + void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { // At the start of every commit, block activations and make sure // we are backgrounded. if (host_impl->settings().impl_side_painting) @@ -404,7 +392,7 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree PostSetVisibleToMainThread(false); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { if (!host_impl->settings().impl_side_painting) { // There are no activations to block if we're not impl-side-painting, // so just advance the test immediately. @@ -433,7 +421,7 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree host_impl->BlockNotifyReadyToActivateForTesting(false); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { active_tree_was_animated_ = false; // Verify that commits are actually alternating with empty / non-empty @@ -466,8 +454,8 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree } } - virtual void WillAnimateLayers(LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) override { + void WillAnimateLayers(LayerTreeHostImpl* host_impl, + base::TimeTicks monotonic_time) override { EXPECT_TRUE(host_impl->active_tree()->root_layer()); active_tree_was_animated_ = true; } @@ -481,7 +469,7 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree PostSetVisibleToMainThread(true); } - virtual void AfterTest() override {} + void AfterTest() override {} bool active_tree_was_animated_; }; @@ -495,20 +483,17 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction public: LayerTreeHostAnimationTestAddAnimationWithTimingFunction() {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); layer_tree_host()->root_layer()->AddChild(content_); } - virtual void BeginTest() override { - PostAddAnimationToMainThread(content_.get()); - } + void BeginTest() override { PostAddAnimationToMainThread(content_.get()); } - virtual void AnimateLayers( - LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) override { + void AnimateLayers(LayerTreeHostImpl* host_impl, + base::TimeTicks monotonic_time) override { LayerAnimationController* controller_impl = host_impl->active_tree()->root_layer()->children()[0]-> layer_animation_controller(); @@ -532,7 +517,7 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient client_; scoped_refptr<FakeContentLayer> content_; @@ -550,7 +535,7 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes : main_start_time_(-1.0), impl_start_time_(-1.0) {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); @@ -558,13 +543,11 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes layer_tree_host()->root_layer()->AddChild(content_); } - virtual void BeginTest() override { - PostAddAnimationToMainThread(content_.get()); - } + void BeginTest() override { PostAddAnimationToMainThread(content_.get()); } - virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationStarted(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { LayerAnimationController* controller = layer_tree_host()->root_layer()->children()[0]-> layer_animation_controller(); @@ -578,9 +561,8 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes EndTest(); } - virtual void UpdateAnimationState( - LayerTreeHostImpl* impl_host, - bool has_unfinished_animation) override { + void UpdateAnimationState(LayerTreeHostImpl* impl_host, + bool has_unfinished_animation) override { LayerAnimationController* controller = impl_host->active_tree()->root_layer()->children()[0]-> layer_animation_controller(); @@ -597,7 +579,7 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes EndTest(); } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_FLOAT_EQ(impl_start_time_, main_start_time_); } @@ -617,14 +599,13 @@ class LayerTreeHostAnimationTestAnimationFinishedEvents public: LayerTreeHostAnimationTestAnimationFinishedEvents() {} - virtual void BeginTest() override { + void BeginTest() override { PostAddInstantAnimationToMainThread(layer_tree_host()->root_layer()); } - virtual void NotifyAnimationFinished( - base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationFinished(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { LayerAnimationController* controller = layer_tree_host()->root_layer()->layer_animation_controller(); Animation* animation = @@ -634,7 +615,7 @@ class LayerTreeHostAnimationTestAnimationFinishedEvents EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} }; SINGLE_AND_MULTI_THREAD_TEST_F( @@ -649,17 +630,17 @@ class LayerTreeHostAnimationTestDoNotSkipLayersWithAnimatedOpacity : update_check_layer_(FakeContentLayer::Create(&client_)) { } - virtual void SetupTree() override { + void SetupTree() override { update_check_layer_->SetOpacity(0.f); layer_tree_host()->SetRootLayer(update_check_layer_); LayerTreeHostAnimationTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { PostAddAnimationToMainThread(update_check_layer_.get()); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { LayerAnimationController* controller_impl = host_impl->active_tree()->root_layer()->layer_animation_controller(); Animation* animation_impl = @@ -668,7 +649,7 @@ class LayerTreeHostAnimationTestDoNotSkipLayersWithAnimatedOpacity EndTest(); } - virtual void AfterTest() override { + void AfterTest() override { // Update() should have been called once, proving that the layer was not // skipped. EXPECT_EQ(1u, update_check_layer_->update_count()); @@ -692,11 +673,9 @@ class LayerTreeHostAnimationTestLayerAddedWithAnimation public: LayerTreeHostAnimationTestLayerAddedWithAnimation() {} - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { if (layer_tree_host()->source_frame_number() == 1) { scoped_refptr<Layer> layer = Layer::Create(); layer->set_layer_animation_delegate(this); @@ -713,13 +692,12 @@ class LayerTreeHostAnimationTestLayerAddedWithAnimation } } - virtual void AnimateLayers( - LayerTreeHostImpl* impl_host, - base::TimeTicks monotonic_time) override { + void AnimateLayers(LayerTreeHostImpl* impl_host, + base::TimeTicks monotonic_time) override { EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} }; SINGLE_AND_MULTI_THREAD_TEST_F( @@ -731,9 +709,9 @@ class LayerTreeHostAnimationTestCancelAnimateCommit LayerTreeHostAnimationTestCancelAnimateCommit() : num_begin_frames_(0), num_commit_calls_(0), num_draw_calls_(0) {} - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) override { + void BeginMainFrame(const BeginFrameArgs& args) override { num_begin_frames_++; // No-op animate will cancel the commit. if (layer_tree_host()->source_frame_number() == 1) { @@ -743,19 +721,19 @@ class LayerTreeHostAnimationTestCancelAnimateCommit layer_tree_host()->SetNeedsAnimate(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { num_commit_calls_++; if (impl->active_tree()->source_frame_number() > 1) FAIL() << "Commit should have been canceled."; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { num_draw_calls_++; if (impl->active_tree()->source_frame_number() > 1) FAIL() << "Draw should have been canceled."; } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_EQ(2, num_begin_frames_); EXPECT_EQ(1, num_commit_calls_); EXPECT_EQ(1, num_draw_calls_); @@ -777,23 +755,21 @@ class LayerTreeHostAnimationTestForceRedraw LayerTreeHostAnimationTestForceRedraw() : num_animate_(0), num_draw_layers_(0) {} - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) override { + void BeginMainFrame(const BeginFrameArgs& args) override { if (++num_animate_ < 2) layer_tree_host()->SetNeedsAnimate(); } - virtual void Layout() override { - layer_tree_host()->SetNextCommitForcesRedraw(); - } + void Layout() override { layer_tree_host()->SetNextCommitForcesRedraw(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { if (++num_draw_layers_ == 2) EndTest(); } - virtual void AfterTest() override { + void AfterTest() override { // The first commit will always draw; make sure the second draw triggered // by the animation was not cancelled. EXPECT_EQ(2, num_draw_layers_); @@ -813,21 +789,21 @@ class LayerTreeHostAnimationTestAnimateAfterSetNeedsCommit LayerTreeHostAnimationTestAnimateAfterSetNeedsCommit() : num_animate_(0), num_draw_layers_(0) {} - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) override { + void BeginMainFrame(const BeginFrameArgs& args) override { if (++num_animate_ <= 2) { layer_tree_host()->SetNeedsCommit(); layer_tree_host()->SetNeedsAnimate(); } } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { if (++num_draw_layers_ == 2) EndTest(); } - virtual void AfterTest() override { + void AfterTest() override { // The first commit will always draw; make sure the second draw triggered // by the SetNeedsCommit was not cancelled. EXPECT_EQ(2, num_draw_layers_); @@ -848,7 +824,7 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw public: LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw() : started_times_(0) {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); @@ -856,27 +832,24 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw layer_tree_host()->root_layer()->AddChild(content_); } - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->SetViewportSize(gfx::Size()); PostAddAnimationToMainThread(content_.get()); } - virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationStarted(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { started_times_++; } - virtual void NotifyAnimationFinished( - base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationFinished(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { EndTest(); } - virtual void AfterTest() override { - EXPECT_EQ(1, started_times_); - } + void AfterTest() override { EXPECT_EQ(1, started_times_); } private: int started_times_; @@ -894,7 +867,7 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotVisible public: LayerTreeHostAnimationTestRunAnimationWhenNotVisible() : started_times_(0) {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); @@ -902,33 +875,32 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotVisible layer_tree_host()->root_layer()->AddChild(content_); } - virtual void BeginTest() override { + void BeginTest() override { visible_ = true; PostAddAnimationToMainThread(content_.get()); } - virtual void DidCommit() override { + void DidCommit() override { visible_ = false; layer_tree_host()->SetVisible(false); } - virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationStarted(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { EXPECT_FALSE(visible_); started_times_++; } - virtual void NotifyAnimationFinished( - base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationFinished(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { EXPECT_FALSE(visible_); EXPECT_EQ(1, started_times_); EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} private: bool visible_; @@ -944,7 +916,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F( // checkerboard. class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations : public LayerTreeHostAnimationTest { - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); @@ -952,13 +924,13 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations layer_tree_host()->root_layer()->AddChild(content_); } - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { // Make sure that drawing many times doesn't cause a checkerboarded // animation to start so we avoid flake in this test. settings->timeout_and_draw_when_animation_checkerboards = false; } - virtual void BeginTest() override { + void BeginTest() override { prevented_draw_ = 0; added_animations_ = 0; started_times_ = 0; @@ -966,10 +938,9 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations PostSetNeedsCommitToMainThread(); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { if (added_animations_ < 2) return draw_result; if (TestEnded()) @@ -981,7 +952,7 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: // The animation is longer than 1 BeginFrame interval. @@ -996,15 +967,15 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations } } - virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationStarted(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { if (TestEnded()) return; started_times_++; } - virtual void AfterTest() override { + void AfterTest() override { // Make sure we tried to draw the second animation but failed. EXPECT_LT(0, prevented_draw_); // The first animation should be started, but the second should not because @@ -1030,7 +1001,7 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated public: LayerTreeHostAnimationTestScrollOffsetChangesArePropagated() {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); scroll_layer_ = FakeContentLayer::Create(&client_); @@ -1040,11 +1011,9 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated layer_tree_host()->root_layer()->AddChild(scroll_layer_); } - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 1: { scoped_ptr<ScrollOffsetAnimationCurve> curve( @@ -1069,7 +1038,7 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated } } - virtual void AfterTest() override {} + void AfterTest() override {} private: FakeContentLayerClient client_; @@ -1088,9 +1057,9 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers() : frame_count_with_pending_tree_(0) {} - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { if (layer_tree_host()->source_frame_number() == 1) { AddAnimatedTransformToLayer(layer_tree_host()->root_layer(), 4, 1, 1); } else if (layer_tree_host()->source_frame_number() == 2) { @@ -1105,12 +1074,12 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers } } - virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { + void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->settings().impl_side_painting) host_impl->BlockNotifyReadyToActivateForTesting(true); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { // For the commit that added animations to new and existing layers, keep // blocking activation. We want to verify that even with activation blocked, // the animation on the layer that's already in the active tree won't get a @@ -1121,8 +1090,8 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers } } - virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, - const BeginFrameArgs& args) override { + void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, + const BeginFrameArgs& args) override { if (!host_impl->pending_tree() || host_impl->pending_tree()->source_frame_number() != 2) return; @@ -1134,8 +1103,8 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers } } - virtual void UpdateAnimationState(LayerTreeHostImpl* host_impl, - bool has_unfinished_animation) override { + void UpdateAnimationState(LayerTreeHostImpl* host_impl, + bool has_unfinished_animation) override { LayerAnimationController* root_controller_impl = host_impl->active_tree()->root_layer()->layer_animation_controller(); Animation* root_animation = @@ -1156,7 +1125,7 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} private: int frame_count_with_pending_tree_; @@ -1171,16 +1140,16 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating LayerTreeHostAnimationTestAddAnimationAfterAnimating() : num_swap_buffers_(0) {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = Layer::Create(); content_->SetBounds(gfx::Size(4, 4)); layer_tree_host()->root_layer()->AddChild(content_); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 1: // First frame: add an animation to the root layer. @@ -1194,8 +1163,7 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { // After both animations have started, verify that they have valid // start times. num_swap_buffers_++; @@ -1220,7 +1188,7 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating } } - virtual void AfterTest() override {} + void AfterTest() override {} private: scoped_refptr<Layer> content_; diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc index a72b12e..8349bae 100644 --- a/cc/trees/layer_tree_host_unittest_context.cc +++ b/cc/trees/layer_tree_host_unittest_context.cc @@ -81,8 +81,8 @@ class LayerTreeHostContextTest : public LayerTreeTest { return TestWebGraphicsContext3D::Create(); } - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback) - override { + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { if (times_to_fail_create_) { --times_to_fail_create_; ExpectCreateToFail(); @@ -103,10 +103,9 @@ class LayerTreeHostContextTest : public LayerTreeTest { return FakeOutputSurface::Create3d(context3d.Pass()); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame, + DrawResult draw_result) override { if (draw_result == DRAW_ABORTED_MISSING_HIGH_RES_CONTENT) { // Only valid for single-threaded impl-side painting, which activates // immediately and will try to draw again when content has finished. @@ -127,7 +126,7 @@ class LayerTreeHostContextTest : public LayerTreeTest { return draw_result; } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { committed_at_least_once_ = true; if (!times_to_lose_during_commit_) @@ -139,9 +138,7 @@ class LayerTreeHostContextTest : public LayerTreeTest { times_to_fail_recreate_ = 0; } - virtual void DidFailToInitializeOutputSurface() override { - ++times_create_failed_; - } + void DidFailToInitializeOutputSurface() override { ++times_create_failed_; } virtual void TearDown() override { LayerTreeTest::TearDown(); @@ -175,9 +172,9 @@ class LayerTreeHostContextTestLostContextSucceeds recovered_context_(true), first_initialized_(false) {} - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void RequestNewOutputSurface(bool fallback) override { + void RequestNewOutputSurface(bool fallback) override { if (async_output_surface_creation_) { MainThreadTaskRunner()->PostTask( FROM_HERE, @@ -195,7 +192,7 @@ class LayerTreeHostContextTestLostContextSucceeds LayerTreeHostContextTest::CreateOutputSurface(fallback)); } - virtual void DidInitializeOutputSurface() override { + void DidInitializeOutputSurface() override { if (first_initialized_) ++num_losses_; else @@ -204,9 +201,9 @@ class LayerTreeHostContextTestLostContextSucceeds recovered_context_ = true; } - virtual void AfterTest() override { EXPECT_EQ(11u, test_case_); } + void AfterTest() override { EXPECT_EQ(11u, test_case_); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { // If the last frame had a context loss, then we'll commit again to // recover. if (!recovered_context_) @@ -358,25 +355,23 @@ class LayerTreeHostClientNotReadyDoesNotCreateOutputSurface LayerTreeHostClientNotReadyDoesNotCreateOutputSurface() : LayerTreeHostContextTest() {} - virtual void WillBeginTest() override { + void WillBeginTest() override { // Override and do not signal SetLayerTreeHostClientReady. } - virtual void BeginTest() override { + void BeginTest() override { PostSetNeedsCommitToMainThread(); EndTest(); } - virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) - override { + scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) override { EXPECT_TRUE(false); return nullptr; } - virtual void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } + void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } - virtual void AfterTest() override { - } + void AfterTest() override {} }; SINGLE_AND_MULTI_THREAD_TEST_F( @@ -388,29 +383,28 @@ class MultipleCompositeDoesNotCreateOutputSurface MultipleCompositeDoesNotCreateOutputSurface() : LayerTreeHostContextTest(), request_count_(0) {} - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->single_thread_proxy_scheduler = false; } - virtual void RequestNewOutputSurface(bool fallback) override { + void RequestNewOutputSurface(bool fallback) override { EXPECT_GE(1, ++request_count_); EndTest(); } - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->Composite(base::TimeTicks()); layer_tree_host()->Composite(base::TimeTicks()); } - virtual scoped_ptr<OutputSurface> CreateOutputSurface( - bool fallback) override { + scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) override { EXPECT_TRUE(false); return nullptr; } - virtual void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } + void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } - virtual void AfterTest() override {} + void AfterTest() override {} int request_count_; }; @@ -423,11 +417,11 @@ class FailedCreateDoesNotCreateExtraOutputSurface FailedCreateDoesNotCreateExtraOutputSurface() : LayerTreeHostContextTest(), request_count_(0) {} - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->single_thread_proxy_scheduler = false; } - virtual void RequestNewOutputSurface(bool fallback) override { + void RequestNewOutputSurface(bool fallback) override { if (request_count_ == 0) { ExpectCreateToFail(); layer_tree_host()->SetOutputSurface(nullptr); @@ -436,20 +430,19 @@ class FailedCreateDoesNotCreateExtraOutputSurface EndTest(); } - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->Composite(base::TimeTicks()); layer_tree_host()->Composite(base::TimeTicks()); } - virtual scoped_ptr<OutputSurface> CreateOutputSurface( - bool fallback) override { + scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) override { EXPECT_TRUE(false); return nullptr; } - virtual void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } + void DidInitializeOutputSurface() override { EXPECT_TRUE(false); } - virtual void AfterTest() override {} + void AfterTest() override {} int request_count_; }; @@ -459,7 +452,7 @@ SINGLE_THREAD_TEST_F(FailedCreateDoesNotCreateExtraOutputSurface); class LayerTreeHostContextTestLostContextSucceedsWithContent : public LayerTreeHostContextTestLostContextSucceeds { public: - virtual void SetupTree() override { + void SetupTree() override { root_ = Layer::Create(); root_->SetBounds(gfx::Size(10, 10)); root_->SetIsDrawable(true); @@ -482,7 +475,7 @@ class LayerTreeHostContextTestLostContextSucceedsWithContent LayerTreeHostContextTest::SetupTree(); } - virtual void InvalidateAndSetNeedsCommit() override { + void InvalidateAndSetNeedsCommit() override { // Invalidate the render surface so we don't try to use a cached copy of the // surface. We want to make sure to test the drawing paths for drawing to // a child surface. @@ -490,7 +483,7 @@ class LayerTreeHostContextTestLostContextSucceedsWithContent LayerTreeHostContextTestLostContextSucceeds::InvalidateAndSetNeedsCommit(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { if (!host_impl->settings().impl_side_painting) { FakeContentLayerImpl* content_impl = static_cast<FakeContentLayerImpl*>( host_impl->active_tree()->root_layer()->children()[0]); @@ -530,12 +523,10 @@ class LayerTreeHostContextTestCreateOutputSurfaceFails times_to_fail_create_ = times_to_fail_; } - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback) - override { + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { scoped_ptr<FakeOutputSurface> surface = LayerTreeHostContextTest::CreateFakeOutputSurface(fallback); @@ -546,13 +537,11 @@ class LayerTreeHostContextTestCreateOutputSurfaceFails return surface.Pass(); } - virtual void DidInitializeOutputSurface() override { times_initialized_++; } + void DidInitializeOutputSurface() override { times_initialized_++; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { - EndTest(); - } + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { EndTest(); } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_EQ(times_to_fail_, times_create_failed_); EXPECT_NE(0, times_initialized_); EXPECT_EQ(expect_fallback_attempt_, did_attempt_fallback_); @@ -596,7 +585,7 @@ class LayerTreeHostContextTestLostContextAndEvictTextures num_commits_(0), lost_context_(false) {} - virtual void SetupTree() override { + void SetupTree() override { // Paint non-solid color. SkPaint paint; paint.setColor(SkColorSetARGB(100, 80, 200, 200)); @@ -615,7 +604,7 @@ class LayerTreeHostContextTestLostContextAndEvictTextures LayerTreeHostContextTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } void PostEvictTextures() { if (HasImplThread()) { @@ -639,7 +628,7 @@ class LayerTreeHostContextTestLostContextAndEvictTextures } } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { if (num_commits_ > 1) return; if (!layer_tree_host()->settings().impl_side_painting) { @@ -648,7 +637,7 @@ class LayerTreeHostContextTestLostContextAndEvictTextures PostEvictTextures(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { LayerTreeHostContextTest::CommitCompleteOnThread(impl); if (num_commits_ > 1) return; @@ -659,7 +648,7 @@ class LayerTreeHostContextTestLostContextAndEvictTextures } } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { if (impl->settings().impl_side_painting) { FakePictureLayerImpl* picture_impl = static_cast<FakePictureLayerImpl*>(impl->active_tree()->root_layer()); @@ -675,9 +664,9 @@ class LayerTreeHostContextTestLostContextAndEvictTextures EndTest(); } - virtual void DidInitializeOutputSurface() override {} + void DidInitializeOutputSurface() override {} - virtual void AfterTest() override {} + void AfterTest() override {} protected: bool lose_after_evict_; @@ -762,7 +751,7 @@ class LayerTreeHostContextTestLostContextWhileUpdatingResources LayerTreeHostContextTestLostContextWhileUpdatingResources() : num_children_(50), times_to_lose_on_end_query_(3) {} - virtual scoped_ptr<TestWebGraphicsContext3D> CreateContext3d() override { + scoped_ptr<TestWebGraphicsContext3D> CreateContext3d() override { scoped_ptr<TestWebGraphicsContext3D> context = LayerTreeHostContextTest::CreateContext3d(); if (times_to_lose_on_end_query_) { @@ -772,7 +761,7 @@ class LayerTreeHostContextTestLostContextWhileUpdatingResources return context.Pass(); } - virtual void SetupTree() override { + void SetupTree() override { if (layer_tree_host()->settings().impl_side_painting) parent_ = FakePictureLayer::Create(&client_); else @@ -795,16 +784,14 @@ class LayerTreeHostContextTestLostContextWhileUpdatingResources LayerTreeHostContextTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_EQ(0, times_to_lose_on_end_query_); EndTest(); } - virtual void AfterTest() override { - EXPECT_EQ(0, times_to_lose_on_end_query_); - } + void AfterTest() override { EXPECT_EQ(0, times_to_lose_on_end_query_); } private: FakeContentLayerClient client_; @@ -821,7 +808,7 @@ class LayerTreeHostContextTestLayersNotified : public LayerTreeHostContextTest { LayerTreeHostContextTestLayersNotified() : LayerTreeHostContextTest(), num_commits_(0) {} - virtual void SetupTree() override { + void SetupTree() override { if (layer_tree_host()->settings().impl_side_painting) { root_ = FakePictureLayer::Create(&client_); child_ = FakePictureLayer::Create(&client_); @@ -839,9 +826,9 @@ class LayerTreeHostContextTestLayersNotified : public LayerTreeHostContextTest { LayerTreeHostContextTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { LayerTreeHostContextTest::DidActivateTreeOnThread(host_impl); FakePictureLayerImpl* root_picture = NULL; @@ -903,7 +890,7 @@ class LayerTreeHostContextTestLayersNotified : public LayerTreeHostContextTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} private: int num_commits_; @@ -938,7 +925,7 @@ class LayerTreeHostContextTestDontUseLostResources static void EmptyReleaseCallback(unsigned sync_point, bool lost) {} - virtual void SetupTree() override { + void SetupTree() override { gpu::gles2::GLES2Interface* gl = child_output_surface_->context_provider()->ContextGL(); @@ -1094,9 +1081,9 @@ class LayerTreeHostContextTestDontUseLostResources LayerTreeHostContextTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { LayerTreeHostContextTest::CommitCompleteOnThread(host_impl); if (host_impl->active_tree()->source_frame_number() == 3) { @@ -1108,10 +1095,9 @@ class LayerTreeHostContextTestDontUseLostResources } } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame, + DrawResult draw_result) override { if (host_impl->active_tree()->source_frame_number() == 2) { // Lose the context during draw on the second commit. This will cause // a third commit to recover. @@ -1120,8 +1106,8 @@ class LayerTreeHostContextTestDontUseLostResources return draw_result; } - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback) - override { + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { // This will get called twice: // First when we create the initial output surface... if (layer_tree_host()->source_frame_number() > 0) { @@ -1131,7 +1117,7 @@ class LayerTreeHostContextTestDontUseLostResources return LayerTreeHostContextTest::CreateFakeOutputSurface(fallback); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { ASSERT_TRUE(layer_tree_host()->hud_layer()); // End the test once we know the 3nd frame drew. if (layer_tree_host()->source_frame_number() < 5) { @@ -1142,7 +1128,7 @@ class LayerTreeHostContextTestDontUseLostResources } } - virtual void AfterTest() override { EXPECT_TRUE(lost_context_); } + void AfterTest() override { EXPECT_TRUE(lost_context_); } private: FakeContentLayerClient client_; @@ -1171,7 +1157,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources); class ImplSidePaintingLayerTreeHostContextTest : public LayerTreeHostContextTest { public: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; } }; @@ -1179,7 +1165,7 @@ class ImplSidePaintingLayerTreeHostContextTest class LayerTreeHostContextTestImplSidePainting : public ImplSidePaintingLayerTreeHostContextTest { public: - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<Layer> root = Layer::Create(); root->SetBounds(gfx::Size(10, 10)); root->SetIsDrawable(true); @@ -1193,14 +1179,14 @@ class LayerTreeHostContextTestImplSidePainting LayerTreeHostContextTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { times_to_lose_during_commit_ = 1; PostSetNeedsCommitToMainThread(); } - virtual void AfterTest() override {} + void AfterTest() override {} - virtual void DidInitializeOutputSurface() override { EndTest(); } + void DidInitializeOutputSurface() override { EndTest(); } private: FakeContentLayerClient client_; @@ -1212,7 +1198,7 @@ class ScrollbarLayerLostContext : public LayerTreeHostContextTest { public: ScrollbarLayerLostContext() : commits_(0) {} - virtual void BeginTest() override { + void BeginTest() override { scoped_refptr<Layer> scroll_layer = Layer::Create(); scrollbar_layer_ = FakePaintedScrollbarLayer::Create(false, true, scroll_layer->id()); @@ -1222,9 +1208,9 @@ class ScrollbarLayerLostContext : public LayerTreeHostContextTest { PostSetNeedsCommitToMainThread(); } - virtual void AfterTest() override {} + void AfterTest() override {} - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { LayerTreeHostContextTest::CommitCompleteOnThread(impl); ++commits_; @@ -1256,11 +1242,11 @@ SINGLE_AND_MULTI_THREAD_TEST_F(ScrollbarLayerLostContext); class UIResourceLostTest : public LayerTreeHostContextTest { public: UIResourceLostTest() : time_step_(0) {} - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->texture_id_allocation_chunk_size = 1; } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void AfterTest() override {} + void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void AfterTest() override {} // This is called on the main thread after each commit and // DidActivateTreeOnThread, with the value of time_step_ at the time @@ -1307,7 +1293,7 @@ class UIResourceLostTestSimple : public UIResourceLostTest { // activated. virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) = 0; - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { if (!layer_tree_host()->settings().impl_side_painting) { StepCompleteOnImplThread(impl); PostStepCompleteToMainThread(); @@ -1315,7 +1301,7 @@ class UIResourceLostTestSimple : public UIResourceLostTest { } } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { if (layer_tree_host()->settings().impl_side_painting) { StepCompleteOnImplThread(impl); PostStepCompleteToMainThread(); @@ -1327,7 +1313,7 @@ class UIResourceLostTestSimple : public UIResourceLostTest { // Losing context after an UI resource has been created. class UIResourceLostAfterCommit : public UIResourceLostTestSimple { public: - virtual void StepCompleteOnMainThread(int step) override { + void StepCompleteOnMainThread(int step) override { EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread()); switch (step) { case 0: @@ -1347,7 +1333,7 @@ class UIResourceLostAfterCommit : public UIResourceLostTestSimple { } } - virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) override { + void StepCompleteOnImplThread(LayerTreeHostImpl* impl) override { LayerTreeHostContextTest::CommitCompleteOnThread(impl); switch (time_step_) { case 1: @@ -1386,7 +1372,7 @@ class UIResourceLostBeforeCommit : public UIResourceLostTestSimple { public: UIResourceLostBeforeCommit() : test_id0_(0), test_id1_(0) {} - virtual void StepCompleteOnMainThread(int step) override { + void StepCompleteOnMainThread(int step) override { switch (step) { case 0: ui_resource_ = FakeScopedUIResource::Create(layer_tree_host()); @@ -1436,7 +1422,7 @@ class UIResourceLostBeforeCommit : public UIResourceLostTestSimple { } } - virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) override { + void StepCompleteOnImplThread(LayerTreeHostImpl* impl) override { LayerTreeHostContextTest::CommitCompleteOnThread(impl); switch (time_step_) { case 1: @@ -1482,7 +1468,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(UIResourceLostBeforeCommit); // Losing UI resource before the pending trees is activated but after the // commit. Impl-side-painting only. class UIResourceLostBeforeActivateTree : public UIResourceLostTest { - virtual void StepCompleteOnMainThread(int step) override { + void StepCompleteOnMainThread(int step) override { EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread()); switch (step) { case 0: @@ -1505,7 +1491,7 @@ class UIResourceLostBeforeActivateTree : public UIResourceLostTest { } } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { LayerTreeHostContextTest::CommitCompleteOnThread(impl); switch (time_step_) { case 2: @@ -1517,7 +1503,7 @@ class UIResourceLostBeforeActivateTree : public UIResourceLostTest { } } - virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override { switch (time_step_) { case 1: // The resource creation callback has been called. @@ -1534,7 +1520,7 @@ class UIResourceLostBeforeActivateTree : public UIResourceLostTest { } } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { LayerTreeHostContextTest::DidActivateTreeOnThread(impl); switch (time_step_) { case 1: @@ -1573,7 +1559,7 @@ TEST_F(UIResourceLostBeforeActivateTree, // Resources evicted explicitly and by visibility changes. class UIResourceLostEviction : public UIResourceLostTestSimple { public: - virtual void StepCompleteOnMainThread(int step) override { + void StepCompleteOnMainThread(int step) override { EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread()); switch (step) { case 0: @@ -1595,8 +1581,7 @@ class UIResourceLostEviction : public UIResourceLostTestSimple { } } - virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* impl, - bool visible) override { + void DidSetVisibleOnImplTree(LayerTreeHostImpl* impl, bool visible) override { TestWebGraphicsContext3D* context = TestContext(); if (!visible) { // All resources should have been evicted. @@ -1612,7 +1597,7 @@ class UIResourceLostEviction : public UIResourceLostTestSimple { } } - virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) override { + void StepCompleteOnImplThread(LayerTreeHostImpl* impl) override { TestWebGraphicsContext3D* context = TestContext(); LayerTreeHostContextTest::CommitCompleteOnThread(impl); switch (time_step_) { @@ -1660,7 +1645,7 @@ class LayerTreeHostContextTestSurfaceCreateCallback LayerTreeHostContextTestSurfaceCreateCallback() : LayerTreeHostContextTest() {} - virtual void SetupTree() override { + void SetupTree() override { if (layer_tree_host()->settings().impl_side_painting) { picture_layer_ = FakePictureLayer::Create(&client_); picture_layer_->SetBounds(gfx::Size(10, 20)); @@ -1674,9 +1659,9 @@ class LayerTreeHostContextTestSurfaceCreateCallback LayerTreeHostContextTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 1: if (layer_tree_host()->settings().impl_side_painting) @@ -1708,7 +1693,7 @@ class LayerTreeHostContextTestSurfaceCreateCallback } } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { LayerTreeHostContextTest::CommitCompleteOnThread(impl); switch (LastCommittedSourceFrameNumber(impl)) { case 0: @@ -1724,7 +1709,7 @@ class LayerTreeHostContextTestSurfaceCreateCallback } } - virtual void AfterTest() override {} + void AfterTest() override {} protected: FakeContentLayerClient client_; @@ -1737,12 +1722,12 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); class LayerTreeHostContextTestLoseAfterSendingBeginMainFrame : public LayerTreeHostContextTest { protected: - virtual void BeginTest() override { + void BeginTest() override { deferred_ = false; PostSetNeedsCommitToMainThread(); } - virtual void ScheduledActionWillSendBeginMainFrame() override { + void ScheduledActionWillSendBeginMainFrame() override { if (deferred_) return; deferred_ = true; @@ -1778,14 +1763,14 @@ class LayerTreeHostContextTestLoseAfterSendingBeginMainFrame layer_tree_host()->SetDeferCommits(defer_commits); } - virtual void WillBeginMainFrame() override { + void WillBeginMainFrame() override { // Don't begin a frame with a lost surface. EXPECT_FALSE(layer_tree_host()->output_surface_lost()); } - virtual void DidCommitAndDrawFrame() override { EndTest(); } + void DidCommitAndDrawFrame() override { EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} bool deferred_; }; diff --git a/cc/trees/layer_tree_host_unittest_copyrequest.cc b/cc/trees/layer_tree_host_unittest_copyrequest.cc index 860f283..1b68cca 100644 --- a/cc/trees/layer_tree_host_unittest_copyrequest.cc +++ b/cc/trees/layer_tree_host_unittest_copyrequest.cc @@ -21,7 +21,7 @@ class LayerTreeHostCopyRequestTest : public LayerTreeTest {}; class LayerTreeHostCopyRequestTestMultipleRequests : public LayerTreeHostCopyRequestTest { protected: - virtual void SetupTree() override { + void SetupTree() override { root = FakeContentLayer::Create(&client_); root->SetBounds(gfx::Size(20, 20)); @@ -33,9 +33,9 @@ class LayerTreeHostCopyRequestTestMultipleRequests LayerTreeHostCopyRequestTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { WaitForCallback(); } + void DidCommitAndDrawFrame() override { WaitForCallback(); } void WaitForCallback() { base::MessageLoop::current()->PostTask( @@ -101,10 +101,10 @@ class LayerTreeHostCopyRequestTestMultipleRequests callbacks_.push_back(result->size()); } - virtual void AfterTest() override { EXPECT_EQ(4u, callbacks_.size()); } + void AfterTest() override { EXPECT_EQ(4u, callbacks_.size()); } - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback) - override { + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { if (use_gl_renderer_) return FakeOutputSurface::Create3d(); return FakeOutputSurface::CreateSoftware( @@ -146,7 +146,7 @@ TEST_F(LayerTreeHostCopyRequestTestMultipleRequests, class LayerTreeHostCopyRequestTestLayerDestroyed : public LayerTreeHostCopyRequestTest { protected: - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); root_->SetBounds(gfx::Size(20, 20)); @@ -162,12 +162,12 @@ class LayerTreeHostCopyRequestTestLayerDestroyed LayerTreeHostCopyRequestTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { callback_count_ = 0; PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { int frame = layer_tree_host()->source_frame_number(); switch (frame) { case 1: @@ -224,7 +224,7 @@ class LayerTreeHostCopyRequestTestLayerDestroyed ++callback_count_; } - virtual void AfterTest() override {} + void AfterTest() override {} int callback_count_; FakeContentLayerClient client_; @@ -238,7 +238,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCopyRequestTestLayerDestroyed); class LayerTreeHostCopyRequestTestInHiddenSubtree : public LayerTreeHostCopyRequestTest { protected: - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); root_->SetBounds(gfx::Size(20, 20)); @@ -267,7 +267,7 @@ class LayerTreeHostCopyRequestTestInHiddenSubtree base::Unretained(this)))); } - virtual void BeginTest() override { + void BeginTest() override { callback_count_ = 0; PostSetNeedsCommitToMainThread(); @@ -321,7 +321,7 @@ class LayerTreeHostCopyRequestTestInHiddenSubtree } } - virtual void AfterTest() override {} + void AfterTest() override {} int callback_count_; FakeContentLayerClient client_; @@ -337,7 +337,7 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F( class LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest : public LayerTreeHostCopyRequestTest { protected: - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); root_->SetBounds(gfx::Size(20, 20)); @@ -360,7 +360,7 @@ class LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest LayerTreeHostCopyRequestTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { did_draw_ = false; PostSetNeedsCommitToMainThread(); @@ -377,7 +377,7 @@ class LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest EndTest(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { Renderer* renderer = host_impl->renderer(); LayerImpl* root = host_impl->active_tree()->root_layer(); @@ -398,7 +398,7 @@ class LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest did_draw_ = true; } - virtual void AfterTest() override { EXPECT_TRUE(did_draw_); } + void AfterTest() override { EXPECT_TRUE(did_draw_); } FakeContentLayerClient client_; bool did_draw_; @@ -415,7 +415,7 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( class LayerTreeHostCopyRequestTestClippedOut : public LayerTreeHostCopyRequestTest { protected: - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); root_->SetBounds(gfx::Size(20, 20)); @@ -433,7 +433,7 @@ class LayerTreeHostCopyRequestTestClippedOut LayerTreeHostCopyRequestTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { PostSetNeedsCommitToMainThread(); copy_layer_->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest( @@ -449,7 +449,7 @@ class LayerTreeHostCopyRequestTestClippedOut EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient client_; scoped_refptr<FakeContentLayer> root_; @@ -463,7 +463,7 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw : public LayerTreeHostCopyRequestTest { protected: - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); root_->SetBounds(gfx::Size(20, 20)); @@ -482,7 +482,7 @@ class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw base::Unretained(this)))); } - virtual void BeginTest() override { + void BeginTest() override { saw_copy_request_ = false; callback_count_ = 0; PostSetNeedsCommitToMainThread(); @@ -493,7 +493,7 @@ class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw AddCopyRequest(copy_layer_.get()); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { if (impl->active_tree()->source_frame_number() == 0) { LayerImpl* root = impl->active_tree()->root_layer(); EXPECT_TRUE(root->children()[0]->HasCopyRequest()); @@ -501,7 +501,7 @@ class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw } } - virtual void DidCommit() override { + void DidCommit() override { if (layer_tree_host()->source_frame_number() == 1) { // Allow drawing. layer_tree_host()->SetViewportSize(gfx::Size(root_->bounds())); @@ -519,7 +519,7 @@ class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw EndTest(); } - virtual void AfterTest() override { EXPECT_TRUE(saw_copy_request_); } + void AfterTest() override { EXPECT_TRUE(saw_copy_request_); } bool saw_copy_request_; int callback_count_; @@ -534,8 +534,8 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F( class LayerTreeHostCopyRequestTestLostOutputSurface : public LayerTreeHostCopyRequestTest { protected: - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback) - override { + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { if (!first_context_provider_.get()) { first_context_provider_ = TestContextProvider::Create(); return FakeOutputSurface::Create3d(first_context_provider_); @@ -546,7 +546,7 @@ class LayerTreeHostCopyRequestTestLostOutputSurface return FakeOutputSurface::Create3d(second_context_provider_); } - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); root_->SetBounds(gfx::Size(20, 20)); @@ -558,7 +558,7 @@ class LayerTreeHostCopyRequestTestLostOutputSurface LayerTreeHostCopyRequestTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } void CopyOutputCallback(scoped_ptr<CopyOutputResult> result) { EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread()); @@ -573,7 +573,7 @@ class LayerTreeHostCopyRequestTestLostOutputSurface layer_tree_host()->SetNeedsCommit(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: // The layers have been pushed to the impl side. The layer textures have @@ -605,8 +605,7 @@ class LayerTreeHostCopyRequestTestLostOutputSurface } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* impl, bool result) override { switch (impl->active_tree()->source_frame_number()) { case 0: // The layers have been drawn, so their textures have been allocated. @@ -646,7 +645,7 @@ class LayerTreeHostCopyRequestTestLostOutputSurface EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} scoped_refptr<TestContextProvider> first_context_provider_; scoped_refptr<TestContextProvider> second_context_provider_; @@ -664,13 +663,13 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F( class LayerTreeHostCopyRequestTestCountTextures : public LayerTreeHostCopyRequestTest { protected: - virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback) - override { + scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( + bool fallback) override { context_provider_ = TestContextProvider::Create(); return FakeOutputSurface::Create3d(context_provider_); } - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); root_->SetBounds(gfx::Size(20, 20)); @@ -682,7 +681,7 @@ class LayerTreeHostCopyRequestTestCountTextures LayerTreeHostCopyRequestTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { num_textures_without_readback_ = 0; num_textures_with_readback_ = 0; waited_sync_point_after_readback_ = 0; @@ -691,7 +690,7 @@ class LayerTreeHostCopyRequestTestCountTextures virtual void RequestCopy(Layer* layer) = 0; - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: // The layers have been pushed to the impl side. The layer textures have @@ -701,8 +700,7 @@ class LayerTreeHostCopyRequestTestCountTextures } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* impl, bool result) override { switch (impl->active_tree()->source_frame_number()) { case 0: // The layers have been drawn, so their textures have been allocated. @@ -738,7 +736,7 @@ class LayerTreeHostCopyRequestTestCountTextures class LayerTreeHostCopyRequestTestCreatesTexture : public LayerTreeHostCopyRequestTestCountTextures { protected: - virtual void RequestCopy(Layer* layer) override { + void RequestCopy(Layer* layer) override { // Request a normal texture copy. This should create a new texture. copy_layer_->RequestCopyOfOutput( CopyOutputRequest::CreateRequest(base::Bind( @@ -758,7 +756,7 @@ class LayerTreeHostCopyRequestTestCreatesTexture release->Run(0, false); } - virtual void AfterTest() override { + void AfterTest() override { // No sync point was needed. EXPECT_EQ(0u, waited_sync_point_after_readback_); // Except the copy to have made another texture. @@ -772,7 +770,7 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F( class LayerTreeHostCopyRequestTestProvideTexture : public LayerTreeHostCopyRequestTestCountTextures { protected: - virtual void BeginTest() override { + void BeginTest() override { external_context_provider_ = TestContextProvider::Create(); EXPECT_TRUE(external_context_provider_->BindToCurrentThread()); LayerTreeHostCopyRequestTestCountTextures::BeginTest(); @@ -788,7 +786,7 @@ class LayerTreeHostCopyRequestTestProvideTexture EXPECT_FALSE(release); } - virtual void RequestCopy(Layer* layer) override { + void RequestCopy(Layer* layer) override { // Request a copy to a provided texture. This should not create a new // texture. scoped_ptr<CopyOutputRequest> request = @@ -807,7 +805,7 @@ class LayerTreeHostCopyRequestTestProvideTexture copy_layer_->RequestCopyOfOutput(request.Pass()); } - virtual void AfterTest() override { + void AfterTest() override { // Expect the compositor to have waited for the sync point in the provided // TextureMailbox. EXPECT_EQ(sync_point_, waited_sync_point_after_readback_); @@ -825,7 +823,7 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F( class LayerTreeHostCopyRequestTestDestroyBeforeCopy : public LayerTreeHostCopyRequestTest { protected: - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); root_->SetBounds(gfx::Size(20, 20)); @@ -837,7 +835,7 @@ class LayerTreeHostCopyRequestTestDestroyBeforeCopy LayerTreeHostCopyRequestTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { callback_count_ = 0; PostSetNeedsCommitToMainThread(); } @@ -847,7 +845,7 @@ class LayerTreeHostCopyRequestTestDestroyBeforeCopy ++callback_count_; } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { MainThreadTaskRunner()->PostTask( FROM_HERE, base::Bind(&LayerTreeHostCopyRequestTestDestroyBeforeCopy::DidActivate, @@ -888,7 +886,7 @@ class LayerTreeHostCopyRequestTestDestroyBeforeCopy } } - virtual void AfterTest() override {} + void AfterTest() override {} int callback_count_; FakeContentLayerClient client_; @@ -902,7 +900,7 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( class LayerTreeHostCopyRequestTestShutdownBeforeCopy : public LayerTreeHostCopyRequestTest { protected: - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); root_->SetBounds(gfx::Size(20, 20)); @@ -914,7 +912,7 @@ class LayerTreeHostCopyRequestTestShutdownBeforeCopy LayerTreeHostCopyRequestTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { callback_count_ = 0; PostSetNeedsCommitToMainThread(); } @@ -924,7 +922,7 @@ class LayerTreeHostCopyRequestTestShutdownBeforeCopy ++callback_count_; } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { MainThreadTaskRunner()->PostTask( FROM_HERE, base::Bind(&LayerTreeHostCopyRequestTestShutdownBeforeCopy::DidActivate, @@ -959,7 +957,7 @@ class LayerTreeHostCopyRequestTestShutdownBeforeCopy } } - virtual void AfterTest() override { EXPECT_EQ(1, callback_count_); } + void AfterTest() override { EXPECT_EQ(1, callback_count_); } int callback_count_; FakeContentLayerClient client_; diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc index d231553..d541751 100644 --- a/cc/trees/layer_tree_host_unittest_damage.cc +++ b/cc/trees/layer_tree_host_unittest_damage.cc @@ -26,7 +26,7 @@ class LayerTreeHostDamageTest : public LayerTreeTest {}; // LayerTreeHost::SetNeedsRedraw should damage the whole viewport. class LayerTreeHostDamageTestSetNeedsRedraw : public LayerTreeHostDamageTest { - virtual void SetupTree() override { + void SetupTree() override { // Viewport is 10x10. scoped_refptr<FakeContentLayer> root = FakeContentLayer::Create(&client_); root->SetBounds(gfx::Size(10, 10)); @@ -35,12 +35,12 @@ class LayerTreeHostDamageTestSetNeedsRedraw LayerTreeHostDamageTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { draw_count_ = 0; PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: layer_tree_host()->SetNeedsRedraw(); @@ -48,10 +48,9 @@ class LayerTreeHostDamageTestSetNeedsRedraw } } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { EXPECT_EQ(DRAW_SUCCESS, draw_result); RenderSurfaceImpl* root_surface = @@ -77,7 +76,7 @@ class LayerTreeHostDamageTestSetNeedsRedraw return draw_result; } - virtual void AfterTest() override {} + void AfterTest() override {} int draw_count_; FakeContentLayerClient client_; @@ -88,7 +87,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDamageTestSetNeedsRedraw); // LayerTreeHost::SetViewportSize should damage the whole viewport. class LayerTreeHostDamageTestSetViewportSize : public LayerTreeHostDamageTest { - virtual void SetupTree() override { + void SetupTree() override { // Viewport is 10x10. scoped_refptr<FakeContentLayer> root = FakeContentLayer::Create(&client_); root->SetBounds(gfx::Size(10, 10)); @@ -97,12 +96,12 @@ class LayerTreeHostDamageTestSetViewportSize LayerTreeHostDamageTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { draw_count_ = 0; PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: layer_tree_host()->SetViewportSize(gfx::Size(15, 15)); @@ -110,10 +109,9 @@ class LayerTreeHostDamageTestSetViewportSize } } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { EXPECT_EQ(DRAW_SUCCESS, draw_result); RenderSurfaceImpl* root_surface = @@ -139,7 +137,7 @@ class LayerTreeHostDamageTestSetViewportSize return draw_result; } - virtual void AfterTest() override {} + void AfterTest() override {} int draw_count_; FakeContentLayerClient client_; @@ -149,14 +147,14 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDamageTestSetViewportSize); class LayerTreeHostDamageTestNoDamageDoesNotSwap : public LayerTreeHostDamageTest { - virtual void BeginTest() override { + void BeginTest() override { expect_swap_and_succeed_ = 0; did_swaps_ = 0; did_swap_and_succeed_ = 0; PostSetNeedsCommitToMainThread(); } - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<FakeContentLayer> root = FakeContentLayer::Create(&client_); root->SetBounds(gfx::Size(10, 10)); @@ -169,10 +167,9 @@ class LayerTreeHostDamageTestNoDamageDoesNotSwap LayerTreeHostDamageTest::SetupTree(); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { EXPECT_EQ(DRAW_SUCCESS, draw_result); int source_frame = host_impl->active_tree()->source_frame_number(); @@ -197,15 +194,14 @@ class LayerTreeHostDamageTestNoDamageDoesNotSwap return draw_result; } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ++did_swaps_; if (result) ++did_swap_and_succeed_; EXPECT_EQ(expect_swap_and_succeed_, did_swap_and_succeed_); } - virtual void DidCommit() override { + void DidCommit() override { int next_frame = layer_tree_host()->source_frame_number(); switch (next_frame) { case 1: @@ -224,7 +220,7 @@ class LayerTreeHostDamageTestNoDamageDoesNotSwap } } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_EQ(4, did_swaps_); EXPECT_EQ(2, expect_swap_and_succeed_); EXPECT_EQ(expect_swap_and_succeed_, did_swap_and_succeed_); @@ -241,11 +237,9 @@ SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F( LayerTreeHostDamageTestNoDamageDoesNotSwap); class LayerTreeHostDamageTestForcedFullDamage : public LayerTreeHostDamageTest { - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void SetupTree() override { + void SetupTree() override { root_ = FakeContentLayer::Create(&client_); child_ = FakeContentLayer::Create(&client_); @@ -258,10 +252,9 @@ class LayerTreeHostDamageTestForcedFullDamage : public LayerTreeHostDamageTest { LayerTreeHostDamageTest::SetupTree(); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { EXPECT_EQ(DRAW_SUCCESS, draw_result); RenderSurfaceImpl* root_surface = @@ -334,7 +327,7 @@ class LayerTreeHostDamageTestForcedFullDamage : public LayerTreeHostDamageTest { return draw_result; } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { if (!TestEnded()) layer_tree_host()->SetNeedsCommit(); @@ -344,7 +337,7 @@ class LayerTreeHostDamageTestForcedFullDamage : public LayerTreeHostDamageTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient client_; scoped_refptr<FakeContentLayer> root_; @@ -355,7 +348,7 @@ class LayerTreeHostDamageTestForcedFullDamage : public LayerTreeHostDamageTest { SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(LayerTreeHostDamageTestForcedFullDamage); class LayerTreeHostScrollbarDamageTest : public LayerTreeHostDamageTest { - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<Layer> root_layer = Layer::Create(); root_layer->SetBounds(gfx::Size(400, 400)); root_layer->SetMasksToBounds(true); @@ -395,15 +388,14 @@ class LayerTreeHostScrollbarDamageTest : public LayerTreeHostDamageTest { class LayerTreeHostDamageTestScrollbarDoesDamage : public LayerTreeHostScrollbarDamageTest { - virtual void BeginTest() override { + void BeginTest() override { did_swaps_ = 0; PostSetNeedsCommitToMainThread(); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { EXPECT_EQ(DRAW_SUCCESS, draw_result); RenderSurfaceImpl* root_surface = host_impl->active_tree()->root_layer()->render_surface(); @@ -431,8 +423,7 @@ class LayerTreeHostDamageTestScrollbarDoesDamage return draw_result; } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ++did_swaps_; EXPECT_TRUE(result); LayerImpl* root = host_impl->active_tree()->root_layer(); @@ -458,9 +449,7 @@ class LayerTreeHostDamageTestScrollbarDoesDamage } } - virtual void AfterTest() override { - EXPECT_EQ(4, did_swaps_); - } + void AfterTest() override { EXPECT_EQ(4, did_swaps_); } int did_swaps_; }; @@ -469,15 +458,14 @@ MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarDoesDamage); class LayerTreeHostDamageTestScrollbarCommitDoesNoDamage : public LayerTreeHostScrollbarDamageTest { - virtual void BeginTest() override { + void BeginTest() override { did_swaps_ = 0; PostSetNeedsCommitToMainThread(); } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame_data, + DrawResult draw_result) override { EXPECT_EQ(DRAW_SUCCESS, draw_result); RenderSurfaceImpl* root_surface = host_impl->active_tree()->root_layer()->render_surface(); @@ -507,8 +495,7 @@ class LayerTreeHostDamageTestScrollbarCommitDoesNoDamage return draw_result; } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ++did_swaps_; EXPECT_TRUE(result); LayerImpl* root = host_impl->active_tree()->root_layer(); @@ -535,9 +522,7 @@ class LayerTreeHostDamageTestScrollbarCommitDoesNoDamage } } - virtual void AfterTest() override { - EXPECT_EQ(3, did_swaps_); - } + void AfterTest() override { EXPECT_EQ(3, did_swaps_); } int did_swaps_; }; @@ -546,16 +531,13 @@ MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarCommitDoesNoDamage); class LayerTreeHostDamageTestVisibleTilesStillTriggerDraws : public LayerTreeHostDamageTest { - - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; } - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<FakePictureLayer> root = FakePictureLayer::Create(&client_); root->SetBounds(gfx::Size(500, 500)); layer_tree_host()->SetRootLayer(root); @@ -566,10 +548,9 @@ class LayerTreeHostDamageTestVisibleTilesStillTriggerDraws update_visible_tile_count_ = 0; } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) override { + 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_) { @@ -599,8 +580,7 @@ class LayerTreeHostDamageTestVisibleTilesStillTriggerDraws return draw_result; } - virtual void UpdateVisibleTilesOnThread( - LayerTreeHostImpl* host_impl) override { + 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 @@ -617,14 +597,14 @@ class LayerTreeHostDamageTestVisibleTilesStillTriggerDraws } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool didSwap) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, + bool didSwap) override { if (!didSwap) return; ++swap_count_; } - virtual void AfterTest() override { + 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); diff --git a/cc/trees/layer_tree_host_unittest_delegated.cc b/cc/trees/layer_tree_host_unittest_delegated.cc index 018df87..3aabeff 100644 --- a/cc/trees/layer_tree_host_unittest_delegated.cc +++ b/cc/trees/layer_tree_host_unittest_delegated.cc @@ -252,7 +252,7 @@ class LayerTreeHostDelegatedTestCaseSingleDelegatedLayer resource_collection_->SetClient(this); } - virtual void SetupTree() override { + void SetupTree() override { root_ = Layer::Create(); root_->SetBounds(gfx::Size(15, 15)); @@ -260,7 +260,7 @@ class LayerTreeHostDelegatedTestCaseSingleDelegatedLayer LayerTreeHostDelegatedTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { resource_collection_->SetClient(this); PostSetNeedsCommitToMainThread(); } @@ -297,10 +297,10 @@ class LayerTreeHostDelegatedTestCaseSingleDelegatedLayer return delegated; } - virtual void AfterTest() override { resource_collection_->SetClient(NULL); } + void AfterTest() override { resource_collection_->SetClient(NULL); } // DelegatedFrameProviderClient implementation. - virtual void UnusedResourcesAreAvailable() override { available_ = true; } + void UnusedResourcesAreAvailable() override { available_ = true; } bool TestAndResetAvailable() { bool available = available_; @@ -324,13 +324,13 @@ class LayerTreeHostDelegatedTestCreateChildId num_activates_(0), did_reset_child_id_(false) {} - virtual void DidCommit() override { + void DidCommit() override { if (TestEnded()) return; SetFrameData(CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1))); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->active_tree()->source_frame_number() < 1) return; @@ -360,8 +360,8 @@ class LayerTreeHostDelegatedTestCreateChildId } } - virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, - bool success) override { + void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, + bool success) override { EXPECT_TRUE(success); if (num_activates_ < 2) @@ -392,7 +392,7 @@ class LayerTreeHostDelegatedTestInvalidFrameAfterContextLost LayerTreeHostDelegatedTestInvalidFrameAfterContextLost() : num_activates_(0), num_output_surfaces_initialized_(0) {} - virtual void DidCommit() override { + void DidCommit() override { if (TestEnded()) return; scoped_ptr<DelegatedFrameData> frame1 = @@ -402,7 +402,7 @@ class LayerTreeHostDelegatedTestInvalidFrameAfterContextLost SetFrameData(frame1.Pass()); } - virtual void DidInitializeOutputSurface() override { + void DidInitializeOutputSurface() override { if (!num_output_surfaces_initialized_++) return; @@ -415,7 +415,7 @@ class LayerTreeHostDelegatedTestInvalidFrameAfterContextLost DCHECK(delegated_.get() == old_delegated.get()); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->active_tree()->source_frame_number() < 1) return; @@ -435,8 +435,8 @@ class LayerTreeHostDelegatedTestInvalidFrameAfterContextLost } } - virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, - bool success) override { + void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, + bool success) override { EXPECT_TRUE(success); if (num_activates_ < 2) @@ -451,7 +451,7 @@ class LayerTreeHostDelegatedTestInvalidFrameAfterContextLost EXPECT_EQ(0U, delegated_impl->Resources().size()); } - virtual void AfterTest() override { + void AfterTest() override { LayerTreeHostDelegatedTestCaseSingleDelegatedLayer::AfterTest(); EXPECT_EQ(2, num_output_surfaces_initialized_); } @@ -471,7 +471,7 @@ class LayerTreeHostDelegatedTestLayerUsesFrameDamage : LayerTreeHostDelegatedTestCaseSingleDelegatedLayer(), first_draw_for_source_frame_(true) {} - virtual void DidCommit() override { + void DidCommit() override { int next_source_frame_number = layer_tree_host()->source_frame_number(); switch (next_source_frame_number) { case 1: @@ -581,10 +581,9 @@ class LayerTreeHostDelegatedTestLayerUsesFrameDamage first_draw_for_source_frame_ = true; } - virtual DrawResult PrepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame, + DrawResult draw_result) override { EXPECT_EQ(DRAW_SUCCESS, draw_result); if (!first_draw_for_source_frame_) @@ -675,7 +674,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestLayerUsesFrameDamage); class LayerTreeHostDelegatedTestMergeResources : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { + void BeginTest() override { // Push two frames to the delegated renderer layer with no commit between. // The first frame has resource 999. @@ -708,7 +707,7 @@ class LayerTreeHostDelegatedTestMergeResources PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { LayerImpl* root_impl = host_impl->active_tree()->root_layer(); FakeDelegatedRendererLayerImpl* delegated_impl = static_cast<FakeDelegatedRendererLayerImpl*>(root_impl->children()[0]); @@ -735,7 +734,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestMergeResources); class LayerTreeHostDelegatedTestRemapResourcesInQuads : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { + void BeginTest() override { // Generate a frame with two resources in it. scoped_ptr<DelegatedFrameData> frame = CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)); @@ -748,7 +747,7 @@ class LayerTreeHostDelegatedTestRemapResourcesInQuads PostSetNeedsCommitToMainThread(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { LayerImpl* root_impl = host_impl->active_tree()->root_layer(); FakeDelegatedRendererLayerImpl* delegated_impl = static_cast<FakeDelegatedRendererLayerImpl*>(root_impl->children()[0]); @@ -784,11 +783,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestRemapResourcesInQuads); class LayerTreeHostDelegatedTestReturnUnusedResources : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -856,8 +853,7 @@ class LayerTreeHostDelegatedTestReturnUnusedResources EXPECT_FALSE(TestAndResetAvailable()); } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } }; @@ -868,11 +864,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostDelegatedTestReusedResources : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -928,8 +922,7 @@ class LayerTreeHostDelegatedTestReusedResources } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } }; @@ -939,11 +932,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestReusedResources); class LayerTreeHostDelegatedTestFrameBeforeAck : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -998,7 +989,7 @@ class LayerTreeHostDelegatedTestFrameBeforeAck } } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->active_tree()->source_frame_number() != 3) return; @@ -1028,8 +1019,7 @@ class LayerTreeHostDelegatedTestFrameBeforeAck EndTest(); } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } }; @@ -1039,11 +1029,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestFrameBeforeAck); class LayerTreeHostDelegatedTestFrameBeforeTakeResources : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -1110,7 +1098,7 @@ class LayerTreeHostDelegatedTestFrameBeforeTakeResources } } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->active_tree()->source_frame_number() != 3) return; @@ -1147,8 +1135,7 @@ class LayerTreeHostDelegatedTestFrameBeforeTakeResources EXPECT_EQ(map.find(444)->second, quad3->resource_id); } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } }; @@ -1159,11 +1146,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostDelegatedTestBadFrame : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -1230,8 +1215,7 @@ class LayerTreeHostDelegatedTestBadFrame } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { if (host_impl->active_tree()->source_frame_number() < 1) return; @@ -1313,11 +1297,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestBadFrame); class LayerTreeHostDelegatedTestUnnamedResource : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -1353,7 +1335,7 @@ class LayerTreeHostDelegatedTestUnnamedResource } } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->active_tree()->source_frame_number() != 1) return; @@ -1379,11 +1361,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestUnnamedResource); class LayerTreeHostDelegatedTestDontLeakResource : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -1431,7 +1411,7 @@ class LayerTreeHostDelegatedTestDontLeakResource } } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->active_tree()->source_frame_number() != 1) return; @@ -1451,8 +1431,7 @@ class LayerTreeHostDelegatedTestDontLeakResource EXPECT_EQ(1u, delegated_impl->Resources().count(555)); } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } }; @@ -1462,7 +1441,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestDontLeakResource); class LayerTreeHostDelegatedTestResourceSentToParent : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -1517,7 +1496,7 @@ class LayerTreeHostDelegatedTestResourceSentToParent host_impl->ReclaimResources(&ack); } - virtual void UnusedResourcesAreAvailable() override { + void UnusedResourcesAreAvailable() override { EXPECT_EQ(3, layer_tree_host()->source_frame_number()); ReturnedResourceArray resources; @@ -1532,7 +1511,7 @@ class LayerTreeHostDelegatedTestResourceSentToParent EndTest(); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->active_tree()->source_frame_number() < 1) return; @@ -1593,13 +1572,13 @@ SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F( class LayerTreeHostDelegatedTestCommitWithoutTake : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { + void BeginTest() override { // Prevent drawing with resources that are sent to the grandparent. layer_tree_host()->SetViewportSize(gfx::Size()); PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -1665,7 +1644,7 @@ class LayerTreeHostDelegatedTestCommitWithoutTake } } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { if (host_impl->active_tree()->source_frame_number() < 1) return; @@ -1715,7 +1694,7 @@ class DelegatedFrameIsActivatedDuringCommit protected: DelegatedFrameIsActivatedDuringCommit() : returned_resource_count_(0) {} - virtual void BeginTest() override { + void BeginTest() override { activate_count_ = 0; scoped_ptr<DelegatedFrameData> frame = @@ -1727,11 +1706,11 @@ class DelegatedFrameIsActivatedDuringCommit PostSetNeedsCommitToMainThread(); } - virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override { ++activate_count_; } - virtual void DidCommit() override { + void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 1: { // The first frame has been activated. Set a new frame, and @@ -1758,7 +1737,7 @@ class DelegatedFrameIsActivatedDuringCommit } } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { switch (host_impl->active_tree()->source_frame_number()) { case 0: { // The activate for the 1st frame should have happened before now. @@ -1782,12 +1761,11 @@ class DelegatedFrameIsActivatedDuringCommit } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } - virtual void UnusedResourcesAreAvailable() override { + void UnusedResourcesAreAvailable() override { LayerTreeHostDelegatedTestCaseSingleDelegatedLayer:: UnusedResourcesAreAvailable(); ReturnedResourceArray resources; @@ -1808,9 +1786,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostDelegatedTestTwoImplLayers : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -1857,8 +1835,7 @@ class LayerTreeHostDelegatedTestTwoImplLayers } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } }; @@ -1868,9 +1845,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestTwoImplLayers); class LayerTreeHostDelegatedTestTwoImplLayersTwoFrames : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -1926,8 +1903,7 @@ class LayerTreeHostDelegatedTestTwoImplLayersTwoFrames } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } }; @@ -1938,9 +1914,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostDelegatedTestTwoLayers : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -2013,8 +1989,7 @@ class LayerTreeHostDelegatedTestTwoLayers } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } @@ -2026,9 +2001,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestTwoLayers); class LayerTreeHostDelegatedTestRemoveAndAddToTree : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -2105,8 +2080,7 @@ class LayerTreeHostDelegatedTestRemoveAndAddToTree } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } @@ -2118,9 +2092,9 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestRemoveAndAddToTree); class LayerTreeHostDelegatedTestRemoveAndChangeResources : public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer { public: - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { scoped_ptr<DelegatedFrameData> frame; ReturnedResourceArray resources; @@ -2187,8 +2161,7 @@ class LayerTreeHostDelegatedTestRemoveAndChangeResources } } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { ReturnUnusedResourcesFromParent(host_impl); } diff --git a/cc/trees/layer_tree_host_unittest_no_message_loop.cc b/cc/trees/layer_tree_host_unittest_no_message_loop.cc index 4930e86..aa5a508 100644 --- a/cc/trees/layer_tree_host_unittest_no_message_loop.cc +++ b/cc/trees/layer_tree_host_unittest_no_message_loop.cc @@ -28,10 +28,10 @@ namespace { class NoMessageLoopOutputSurface : public OutputSurface { public: NoMessageLoopOutputSurface() : OutputSurface(TestContextProvider::Create()) {} - virtual ~NoMessageLoopOutputSurface() {} + ~NoMessageLoopOutputSurface() override {} // OutputSurface overrides. - virtual void SwapBuffers(CompositorFrame* frame) override { + void SwapBuffers(CompositorFrame* frame) override { DCHECK(client_); client_->DidSwapBuffers(); client_->DidSwapBuffersComplete(); @@ -53,34 +53,32 @@ class LayerTreeHostNoMessageLoopTest virtual ~LayerTreeHostNoMessageLoopTest() {} // LayerTreeHostClient overrides. - virtual void WillBeginMainFrame(int frame_id) override {} - virtual void BeginMainFrame(const BeginFrameArgs& args) override {} - virtual void DidBeginMainFrame() override {} - virtual void Layout() override {} - virtual void ApplyViewportDeltas(const gfx::Vector2d& inner_delta, - const gfx::Vector2d& outer_delta, - float page_scale, - float top_controls_delta) override {} - virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, - float page_scale, - float top_controls_delta) override {} - virtual void RequestNewOutputSurface(bool fallback) override { + void WillBeginMainFrame(int frame_id) override {} + void BeginMainFrame(const BeginFrameArgs& args) override {} + void DidBeginMainFrame() override {} + void Layout() override {} + void ApplyViewportDeltas(const gfx::Vector2d& inner_delta, + const gfx::Vector2d& outer_delta, + float page_scale, + float top_controls_delta) override {} + void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, + float page_scale, + float top_controls_delta) override {} + void RequestNewOutputSurface(bool fallback) override { layer_tree_host_->SetOutputSurface( make_scoped_ptr<OutputSurface>(new NoMessageLoopOutputSurface)); } - virtual void DidInitializeOutputSurface() override { + void DidInitializeOutputSurface() override { did_initialize_output_surface_ = true; } - virtual void WillCommit() override {} - virtual void DidCommit() override { did_commit_ = true; } - virtual void DidCommitAndDrawFrame() override { - did_commit_and_draw_frame_ = true; - } - virtual void DidCompleteSwapBuffers() override {} + void WillCommit() override {} + void DidCommit() override { did_commit_ = true; } + void DidCommitAndDrawFrame() override { did_commit_and_draw_frame_ = true; } + void DidCompleteSwapBuffers() override {} // LayerTreeHostSingleThreadClient overrides. - virtual void DidPostSwapBuffers() override {} - virtual void DidAbortSwapBuffers() override {} + void DidPostSwapBuffers() override {} + void DidAbortSwapBuffers() override {} void RunTest() { no_loop_thread_.Start(); @@ -88,7 +86,7 @@ class LayerTreeHostNoMessageLoopTest } // base::DelegateSimpleThread::Delegate override. - virtual void Run() override { + void Run() override { ASSERT_FALSE(base::MessageLoopProxy::current().get()); RunTestWithoutMessageLoop(); EXPECT_FALSE(base::MessageLoopProxy::current().get()); @@ -137,7 +135,7 @@ class LayerTreeHostNoMessageLoopTest class LayerTreeHostNoMessageLoopSmokeTest : public LayerTreeHostNoMessageLoopTest { protected: - virtual void RunTestWithoutMessageLoop() override { + void RunTestWithoutMessageLoop() override { gfx::Size size(100, 100); // Set up root layer. @@ -164,7 +162,7 @@ class LayerTreeHostNoMessageLoopDelegatedLayer : public LayerTreeHostNoMessageLoopTest, public DelegatedFrameResourceCollectionClient { protected: - virtual void RunTestWithoutMessageLoop() override { + void RunTestWithoutMessageLoop() override { resource_collection_ = new DelegatedFrameResourceCollection; frame_provider_ = new DelegatedFrameProvider( resource_collection_.get(), CreateFrameDataWithResource(998)); @@ -198,7 +196,7 @@ class LayerTreeHostNoMessageLoopDelegatedLayer } // DelegatedFrameResourceCollectionClient overrides. - virtual void UnusedResourcesAreAvailable() override {} + void UnusedResourcesAreAvailable() override {} private: scoped_ptr<DelegatedFrameData> CreateFrameDataWithResource( diff --git a/cc/trees/layer_tree_host_unittest_occlusion.cc b/cc/trees/layer_tree_host_unittest_occlusion.cc index 3e22f04..fe87e44 100644 --- a/cc/trees/layer_tree_host_unittest_occlusion.cc +++ b/cc/trees/layer_tree_host_unittest_occlusion.cc @@ -19,8 +19,8 @@ class TestLayer : public Layer { return make_scoped_refptr(new TestLayer()); } - virtual bool Update(ResourceUpdateQueue* update_queue, - const OcclusionTracker<Layer>* occlusion) override { + bool Update(ResourceUpdateQueue* update_queue, + const OcclusionTracker<Layer>* occlusion) override { if (!occlusion) return false; @@ -44,7 +44,7 @@ class TestLayer : public Layer { TestLayer() : Layer() { SetIsDrawable(true); } - virtual ~TestLayer() {} + ~TestLayer() override {} SimpleEnclosedRegion occlusion_; SimpleEnclosedRegion expected_occlusion_; @@ -60,18 +60,16 @@ class LayerTreeHostOcclusionTest : public LayerTreeTest { mask_(TestLayer::Create()) { } - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { TestLayer* root = static_cast<TestLayer*>(layer_tree_host()->root_layer()); VerifyOcclusion(root); EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} void VerifyOcclusion(TestLayer* layer) const { EXPECT_EQ(layer->expected_occlusion().ToString(), @@ -99,7 +97,7 @@ class LayerTreeHostOcclusionTest : public LayerTreeTest { } protected: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->minimum_occlusion_tracking_size = gfx::Size(); } @@ -116,7 +114,7 @@ class LayerTreeHostOcclusionTest : public LayerTreeTest { class LayerTreeHostOcclusionTestOcclusionSurfaceClipping : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // The child layer is a surface and the grand_child is opaque, but clipped // to the child and root SetLayerPropertiesForTesting( @@ -146,7 +144,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostOcclusionTestOcclusionSurfaceClippingOpaque : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // If the child layer is opaque, then it adds to the occlusion seen by the // root_. SetLayerPropertiesForTesting( @@ -176,7 +174,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostOcclusionTestOcclusionTwoChildren : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // Add a second child to the root layer and the regions should merge SetLayerPropertiesForTesting( root_.get(), NULL, identity_matrix_, @@ -209,7 +207,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostOcclusionTestOcclusionMask : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // If the child layer has a mask on it, then it shouldn't contribute to // occlusion on stuff below it. SetLayerPropertiesForTesting( @@ -242,7 +240,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestOcclusionMask); class LayerTreeHostOcclusionTestOcclusionMaskBelowOcclusion : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // If the child layer with a mask is below child2, then child2 should // contribute to occlusion on everything, and child shouldn't contribute // to the root_. @@ -278,7 +276,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostOcclusionTestOcclusionOpacity : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // If the child layer has a non-opaque opacity, then it shouldn't // contribute to occlusion on stuff below it SetLayerPropertiesForTesting( @@ -311,7 +309,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestOcclusionOpacity); class LayerTreeHostOcclusionTestOcclusionOpacityBelowOcclusion : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // If the child layer with non-opaque opacity is below child2, then // child2 should contribute to occlusion on everything, and child shouldn't // contribute to the root_. @@ -347,7 +345,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostOcclusionTestOcclusionBlending : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // If the child layer has a blend mode, then it shouldn't // contribute to occlusion on stuff below it SetLayerPropertiesForTesting( @@ -380,7 +378,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestOcclusionBlending); class LayerTreeHostOcclusionTestOcclusionBlendingBelowOcclusion : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // If the child layer with a blend mode is below child2, then // child2 should contribute to occlusion on everything, and child shouldn't // contribute to the root_. @@ -415,7 +413,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostOcclusionTestOcclusionOpacityFilter : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { FilterOperations filters; filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); @@ -467,7 +465,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F( class LayerTreeHostOcclusionTestOcclusionBlurFilter : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { gfx::Transform child_transform; child_transform.Translate(250.0, 250.0); child_transform.Rotate(90.0); @@ -511,7 +509,7 @@ class LayerTreeHostOcclusionTestOcclusionCopyRequest public: static void CopyOutputCallback(scoped_ptr<CopyOutputResult> result) {} - virtual void SetupTree() override { + void SetupTree() override { // If the child layer has copy request, and is below child2, // then child should not inherit occlusion from outside its subtree. // The child layer will still receive occlusion from inside, and @@ -546,7 +544,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestOcclusionCopyRequest); class LayerTreeHostOcclusionTestOcclusionReplica : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // If the child layer has copy request, and is below child2, // then child should not inherit occlusion from outside its subtree. // The child layer will still receive occlusion from inside, and @@ -581,7 +579,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostOcclusionTestOcclusionReplica); class LayerTreeHostOcclusionTestManySurfaces : public LayerTreeHostOcclusionTest { public: - virtual void SetupTree() override { + void SetupTree() override { // We create enough RenderSurfaces that it will trigger Vector reallocation // while computing occlusion. std::vector<scoped_refptr<TestLayer>> layers; diff --git a/cc/trees/layer_tree_host_unittest_picture.cc b/cc/trees/layer_tree_host_unittest_picture.cc index a79d075..b81fdff 100644 --- a/cc/trees/layer_tree_host_unittest_picture.cc +++ b/cc/trees/layer_tree_host_unittest_picture.cc @@ -16,7 +16,7 @@ namespace { // These tests deal with picture layers. class LayerTreeHostPictureTest : public LayerTreeTest { protected: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { // PictureLayer can only be used with impl side painting enabled. settings->impl_side_painting = true; } @@ -24,7 +24,7 @@ class LayerTreeHostPictureTest : public LayerTreeTest { class LayerTreeHostPictureTestTwinLayer : public LayerTreeHostPictureTest { - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostPictureTest::SetupTree(); scoped_refptr<FakePictureLayer> picture = @@ -32,12 +32,12 @@ class LayerTreeHostPictureTestTwinLayer layer_tree_host()->root_layer()->AddChild(picture); } - virtual void BeginTest() override { + void BeginTest() override { activates_ = 0; PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 2: // Drop the picture layer from the tree. @@ -52,7 +52,7 @@ class LayerTreeHostPictureTestTwinLayer } } - virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override { LayerImpl* pending_root_impl = impl->pending_tree()->root_layer(); LayerImpl* active_root_impl = impl->active_tree()->root_layer(); @@ -88,7 +88,7 @@ class LayerTreeHostPictureTestTwinLayer EXPECT_EQ(active_picture_impl, pending_picture_impl->twin_layer()); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { LayerImpl* active_root_impl = impl->active_tree()->root_layer(); if (active_root_impl->children().empty()) { @@ -107,7 +107,7 @@ class LayerTreeHostPictureTestTwinLayer EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} FakeContentLayerClient client_; int activates_; diff --git a/cc/trees/layer_tree_host_unittest_proxy.cc b/cc/trees/layer_tree_host_unittest_proxy.cc index 5993479..f27b553 100644 --- a/cc/trees/layer_tree_host_unittest_proxy.cc +++ b/cc/trees/layer_tree_host_unittest_proxy.cc @@ -37,8 +37,8 @@ class ProxyTest : public LayerTreeTest { RunTest(threaded, delegating_renderer, impl_side_painting); } - virtual void BeginTest() override {} - virtual void AfterTest() override {} + void BeginTest() override {} + void AfterTest() override {} private: DISALLOW_COPY_AND_ASSIGN(ProxyTest); @@ -46,30 +46,24 @@ class ProxyTest : public LayerTreeTest { class ProxyTestScheduledActionsBasic : public ProxyTest { protected: - virtual void BeginTest() override { - proxy()->SetNeedsCommit(); - } + void BeginTest() override { proxy()->SetNeedsCommit(); } - virtual void ScheduledActionBeginOutputSurfaceCreation() override { + void ScheduledActionBeginOutputSurfaceCreation() override { EXPECT_EQ(0, action_phase_++); } - virtual void ScheduledActionSendBeginMainFrame() override { + void ScheduledActionSendBeginMainFrame() override { EXPECT_EQ(1, action_phase_++); } - virtual void ScheduledActionCommit() override { - EXPECT_EQ(2, action_phase_++); - } + void ScheduledActionCommit() override { EXPECT_EQ(2, action_phase_++); } - virtual void ScheduledActionDrawAndSwapIfPossible() override { + void ScheduledActionDrawAndSwapIfPossible() override { EXPECT_EQ(3, action_phase_++); EndTest(); } - virtual void AfterTest() override { - EXPECT_EQ(4, action_phase_); - } + void AfterTest() override { EXPECT_EQ(4, action_phase_); } ProxyTestScheduledActionsBasic() : action_phase_(0) { } @@ -109,7 +103,7 @@ class ThreadProxyTestSetNeedsCommit : public ThreadProxyTest { ThreadProxyTestSetNeedsCommit() {} virtual ~ThreadProxyTestSetNeedsCommit() {} - virtual void BeginTest() override { + void BeginTest() override { EXPECT_FALSE(ThreadProxyMainOnly().commit_requested); EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); @@ -119,7 +113,7 @@ class ThreadProxyTestSetNeedsCommit : public ThreadProxyTest { EXPECT_TRUE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); } - virtual void DidBeginMainFrame() override { + void DidBeginMainFrame() override { EXPECT_FALSE(ThreadProxyMainOnly().commit_requested); EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc index 82f3d55..c4f2eb3 100644 --- a/cc/trees/layer_tree_host_unittest_scroll.cc +++ b/cc/trees/layer_tree_host_unittest_scroll.cc @@ -33,7 +33,7 @@ class LayerTreeHostScrollTestScrollSimple : public LayerTreeHostScrollTest { scroll_amount_(2, -1), num_scrolls_(0) {} - virtual void BeginTest() override { + void BeginTest() override { Layer* root_layer = layer_tree_host()->root_layer(); scoped_refptr<Layer> scroll_layer = Layer::Create(); root_layer->AddChild(scroll_layer); @@ -48,7 +48,7 @@ class LayerTreeHostScrollTestScrollSimple : public LayerTreeHostScrollTest { PostSetNeedsCommitToMainThread(); } - virtual void Layout() override { + void Layout() override { Layer* root = layer_tree_host()->root_layer(); Layer* scroll_layer = root->children()[0].get(); if (!layer_tree_host()->source_frame_number()) { @@ -63,7 +63,7 @@ class LayerTreeHostScrollTestScrollSimple : public LayerTreeHostScrollTest { } } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { LayerImpl* root = impl->active_tree()->root_layer(); LayerImpl* scroll_layer = root->children()[0]; EXPECT_VECTOR_EQ(gfx::Vector2d(), scroll_layer->ScrollDelta()); @@ -87,13 +87,13 @@ class LayerTreeHostScrollTestScrollSimple : public LayerTreeHostScrollTest { } } - virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, - float scale, - float top_controls_delta) override { + void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, + float scale, + float top_controls_delta) override { num_scrolls_++; } - virtual void AfterTest() override { EXPECT_EQ(1, num_scrolls_); } + void AfterTest() override { EXPECT_EQ(1, num_scrolls_); } private: gfx::ScrollOffset initial_scroll_; @@ -110,7 +110,7 @@ class LayerTreeHostScrollTestScrollMultipleRedraw LayerTreeHostScrollTestScrollMultipleRedraw() : initial_scroll_(40, 10), scroll_amount_(-3, 17), num_scrolls_(0) {} - virtual void BeginTest() override { + void BeginTest() override { Layer* root_layer = layer_tree_host()->root_layer(); scroll_layer_ = Layer::Create(); root_layer->AddChild(scroll_layer_); @@ -125,7 +125,7 @@ class LayerTreeHostScrollTestScrollMultipleRedraw PostSetNeedsCommitToMainThread(); } - virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override { + void BeginCommitOnThread(LayerTreeHostImpl* impl) override { switch (layer_tree_host()->source_frame_number()) { case 0: EXPECT_VECTOR_EQ(scroll_layer_->scroll_offset(), initial_scroll_); @@ -144,7 +144,7 @@ class LayerTreeHostScrollTestScrollMultipleRedraw } } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { LayerImpl* scroll_layer = impl->active_tree()->LayerById(scroll_layer_->id()); if (impl->active_tree()->source_frame_number() == 0 && @@ -178,13 +178,13 @@ class LayerTreeHostScrollTestScrollMultipleRedraw } } - virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, - float scale, - float top_controls_delta) override { + void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, + float scale, + float top_controls_delta) override { num_scrolls_++; } - virtual void AfterTest() override { EXPECT_EQ(1, num_scrolls_); } + void AfterTest() override { EXPECT_EQ(1, num_scrolls_); } private: gfx::ScrollOffset initial_scroll_; @@ -210,9 +210,9 @@ class LayerTreeHostScrollTestScrollAbortedCommit num_impl_commits_(0), num_impl_scrolls_(0) {} - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostScrollTest::SetupTree(); Layer* root_layer = layer_tree_host()->root_layer(); scoped_refptr<Layer> root_scroll_layer = Layer::Create(); @@ -228,7 +228,7 @@ class LayerTreeHostScrollTestScrollAbortedCommit layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.01f, 100.f); } - virtual void WillBeginMainFrame() override { + void WillBeginMainFrame() override { num_will_begin_main_frames_++; Layer* root_scroll_layer = layer_tree_host()->root_layer()->children()[0].get(); @@ -280,17 +280,17 @@ class LayerTreeHostScrollTestScrollAbortedCommit } } - virtual void DidBeginMainFrame() override { num_did_begin_main_frames_++; } + void DidBeginMainFrame() override { num_did_begin_main_frames_++; } - virtual void WillCommit() override { num_will_commits_++; } + void WillCommit() override { num_will_commits_++; } - virtual void DidCommit() override { num_did_commits_++; } + void DidCommit() override { num_did_commits_++; } - virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override { + void BeginCommitOnThread(LayerTreeHostImpl* impl) override { num_impl_commits_++; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { LayerImpl* root_scroll_layer = impl->active_tree()->root_layer()->children()[0]; @@ -358,13 +358,13 @@ class LayerTreeHostScrollTestScrollAbortedCommit } } - virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, - float scale, - float top_controls_delta) override { + void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, + float scale, + float top_controls_delta) override { num_impl_scrolls_++; } - virtual void AfterTest() override { + void AfterTest() override { EXPECT_EQ(3, num_impl_scrolls_); // Verify that the embedder sees aborted commits as real commits. EXPECT_EQ(4, num_will_begin_main_frames_); @@ -394,7 +394,7 @@ class LayerTreeHostScrollTestFractionalScroll : public LayerTreeHostScrollTest { public: LayerTreeHostScrollTestFractionalScroll() : scroll_amount_(1.75, 0) {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostScrollTest::SetupTree(); Layer* root_layer = layer_tree_host()->root_layer(); scoped_refptr<Layer> root_scroll_layer = Layer::Create(); @@ -411,11 +411,9 @@ class LayerTreeHostScrollTestFractionalScroll : public LayerTreeHostScrollTest { layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.01f, 100.f); } - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { LayerImpl* root = impl->active_tree()->root_layer(); LayerImpl* scroll_layer = root->children()[0]; @@ -447,7 +445,7 @@ class LayerTreeHostScrollTestFractionalScroll : public LayerTreeHostScrollTest { scroll_layer->ScrollBy(scroll_amount_); } - virtual void AfterTest() override {} + void AfterTest() override {} private: gfx::Vector2dF scroll_amount_; @@ -463,7 +461,7 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest { scroll_amount_(2, -1), num_scrolls_(0) {} - virtual void SetupTree() override { + void SetupTree() override { layer_tree_host()->SetDeviceScaleFactor(device_scale_factor_); scoped_refptr<Layer> root_layer = Layer::Create(); @@ -516,9 +514,9 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest { LayerTreeHostScrollTest::SetupTree(); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void WillCommit() override { + void WillCommit() override { // Keep the test committing (otherwise the early out for no update // will stall the test). if (layer_tree_host()->source_frame_number() < 2) { @@ -530,13 +528,13 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest { final_scroll_offset_ = expected_scroll_layer_->scroll_offset(); } - virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, - float scale, - float top_controls_delta) override { + void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, + float scale, + float top_controls_delta) override { num_scrolls_++; } - virtual void Layout() override { + void Layout() override { EXPECT_VECTOR_EQ(gfx::Vector2d(), expected_no_scroll_layer_->scroll_offset()); @@ -561,7 +559,7 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest { } } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { LayerImpl* root_impl = impl->active_tree()->root_layer(); FakePictureLayerImpl* root_scroll_layer_impl = static_cast<FakePictureLayerImpl*>(root_impl->children()[0]); @@ -632,7 +630,7 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest { } } - virtual void AfterTest() override { + void AfterTest() override { if (scroll_child_layer_) { EXPECT_EQ(0, num_scrolls_); EXPECT_VECTOR_EQ(gfx::ScrollOffsetWithDelta(javascript_scroll_, @@ -748,11 +746,11 @@ TEST_F(LayerTreeHostScrollTestCaseWithChild, class ImplSidePaintingScrollTest : public LayerTreeHostScrollTest { public: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { settings->impl_side_painting = true; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { if (impl->pending_tree()) impl->SetNeedsRedraw(); } @@ -767,7 +765,7 @@ class ImplSidePaintingScrollTestSimple : public ImplSidePaintingScrollTest { impl_thread_scroll2_(-3, 10), num_scrolls_(0) {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostScrollTest::SetupTree(); Layer* root_layer = layer_tree_host()->root_layer(); scoped_refptr<Layer> root_scroll_layer = Layer::Create(); @@ -785,11 +783,9 @@ class ImplSidePaintingScrollTestSimple : public ImplSidePaintingScrollTest { layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.01f, 100.f); } - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void Layout() override { + void Layout() override { Layer* root = layer_tree_host()->root_layer(); Layer* scroll_layer = root->children()[0].get(); if (!layer_tree_host()->source_frame_number()) { @@ -807,14 +803,14 @@ class ImplSidePaintingScrollTestSimple : public ImplSidePaintingScrollTest { } } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { // We force a second draw here of the first commit before activating // the second commit. if (impl->active_tree()->source_frame_number() == 0) impl->SetNeedsRedraw(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { ImplSidePaintingScrollTest::DrawLayersOnThread(impl); LayerImpl* root = impl->active_tree()->root_layer(); @@ -872,13 +868,13 @@ class ImplSidePaintingScrollTestSimple : public ImplSidePaintingScrollTest { } } - virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, - float scale, - float top_controls_delta) override { + void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, + float scale, + float top_controls_delta) override { num_scrolls_++; } - virtual void AfterTest() override { EXPECT_EQ(1, num_scrolls_); } + void AfterTest() override { EXPECT_EQ(1, num_scrolls_); } private: gfx::ScrollOffset initial_scroll_; @@ -900,7 +896,7 @@ class ImplSidePaintingScrollTestImplOnlyScroll ImplSidePaintingScrollTestImplOnlyScroll() : initial_scroll_(20, 10), impl_thread_scroll_(-2, 3) {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeHostScrollTest::SetupTree(); Layer* root_layer = layer_tree_host()->root_layer(); scoped_refptr<Layer> root_scroll_layer = Layer::Create(); @@ -918,11 +914,9 @@ class ImplSidePaintingScrollTestImplOnlyScroll layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.01f, 100.f); } - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void WillCommit() override { + void WillCommit() override { Layer* root = layer_tree_host()->root_layer(); Layer* scroll_layer = root->children()[0].get(); switch (layer_tree_host()->source_frame_number()) { @@ -938,7 +932,7 @@ class ImplSidePaintingScrollTestImplOnlyScroll } } - virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override { + void BeginCommitOnThread(LayerTreeHostImpl* impl) override { // Scroll after the 2nd commit has started. if (impl->active_tree()->source_frame_number() == 0) { LayerImpl* active_root = impl->active_tree()->root_layer(); @@ -949,7 +943,7 @@ class ImplSidePaintingScrollTestImplOnlyScroll } } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { // We force a second draw here of the first commit before activating // the second commit. LayerImpl* active_root = impl->active_tree()->root_layer(); @@ -998,7 +992,7 @@ class ImplSidePaintingScrollTestImplOnlyScroll } } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { ImplSidePaintingScrollTest::DrawLayersOnThread(impl); LayerImpl* root = impl->active_tree()->root_layer(); @@ -1020,7 +1014,7 @@ class ImplSidePaintingScrollTestImplOnlyScroll } } - virtual void AfterTest() override {} + void AfterTest() override {} private: gfx::ScrollOffset initial_scroll_; @@ -1034,15 +1028,15 @@ class LayerTreeHostScrollTestScrollZeroMaxScrollOffset public: LayerTreeHostScrollTestScrollZeroMaxScrollOffset() {} - virtual void SetupTree() override { + void SetupTree() override { LayerTreeTest::SetupTree(); scoped_refptr<Layer> scroll_layer = Layer::Create(); layer_tree_host()->root_layer()->AddChild(scroll_layer); } - virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { LayerImpl* root = impl->active_tree()->root_layer(); LayerImpl* scroll_layer = root->children()[0]; scroll_layer->SetScrollClipLayer(root->id()); @@ -1069,7 +1063,7 @@ class LayerTreeHostScrollTestScrollZeroMaxScrollOffset EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} }; SINGLE_AND_MULTI_THREAD_TEST_F( @@ -1081,26 +1075,25 @@ class ThreadCheckingInputHandlerClient : public InputHandlerClient { bool* received_stop_flinging) : task_runner_(runner), received_stop_flinging_(received_stop_flinging) {} - virtual void WillShutdown() override { + void WillShutdown() override { if (!received_stop_flinging_) ADD_FAILURE() << "WillShutdown() called before fling stopped"; } - virtual void Animate(base::TimeTicks time) override { + void Animate(base::TimeTicks time) override { if (!task_runner_->BelongsToCurrentThread()) ADD_FAILURE() << "Animate called on wrong thread"; } - virtual void MainThreadHasStoppedFlinging() override { + void MainThreadHasStoppedFlinging() override { if (!task_runner_->BelongsToCurrentThread()) ADD_FAILURE() << "MainThreadHasStoppedFlinging called on wrong thread"; *received_stop_flinging_ = true; } - virtual void DidOverscroll( - const gfx::PointF& causal_event_viewport_point, - const gfx::Vector2dF& accumulated_overscroll, - const gfx::Vector2dF& latest_overscroll_delta) override { + void DidOverscroll(const gfx::PointF& causal_event_viewport_point, + const gfx::Vector2dF& accumulated_overscroll, + const gfx::Vector2dF& latest_overscroll_delta) override { if (!task_runner_->BelongsToCurrentThread()) ADD_FAILURE() << "DidOverscroll called on wrong thread"; } @@ -1156,7 +1149,7 @@ class LayerTreeHostScrollTestLayerStructureChange LayerTreeHostScrollTestLayerStructureChange() : scroll_destroy_whole_tree_(false) {} - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<Layer> root_layer = Layer::Create(); root_layer->SetBounds(gfx::Size(10, 10)); @@ -1169,11 +1162,9 @@ class LayerTreeHostScrollTestLayerStructureChange LayerTreeHostScrollTest::SetupTree(); } - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* impl) override { LayerImpl* root = impl->active_tree()->root_layer(); switch (impl->active_tree()->source_frame_number()) { case 0: @@ -1188,7 +1179,7 @@ class LayerTreeHostScrollTestLayerStructureChange } } - virtual void AfterTest() override {} + void AfterTest() override {} virtual void DidScroll(Layer* layer) { if (scroll_destroy_whole_tree_) { diff --git a/cc/trees/layer_tree_host_unittest_video.cc b/cc/trees/layer_tree_host_unittest_video.cc index 8d8b130..ffeda72 100644 --- a/cc/trees/layer_tree_host_unittest_video.cc +++ b/cc/trees/layer_tree_host_unittest_video.cc @@ -22,7 +22,7 @@ class LayerTreeHostVideoTest : public LayerTreeTest {}; class LayerTreeHostVideoTestSetNeedsDisplay : public LayerTreeHostVideoTest { public: - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<Layer> root = Layer::Create(); root->SetBounds(gfx::Size(10, 10)); root->SetIsDrawable(true); @@ -39,14 +39,14 @@ class LayerTreeHostVideoTestSetNeedsDisplay LayerTreeHostVideoTest::SetupTree(); } - virtual void BeginTest() override { + void BeginTest() override { num_draws_ = 0; PostSetNeedsCommitToMainThread(); } - virtual DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) override { + DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, + LayerTreeHostImpl::FrameData* frame, + DrawResult draw_result) override { LayerImpl* root_layer = host_impl->active_tree()->root_layer(); RenderSurfaceImpl* root_surface = root_layer->render_surface(); gfx::RectF damage_rect = @@ -70,7 +70,7 @@ class LayerTreeHostVideoTestSetNeedsDisplay return draw_result; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { VideoLayerImpl* video = static_cast<VideoLayerImpl*>( host_impl->active_tree()->root_layer()->children()[0]); @@ -82,9 +82,7 @@ class LayerTreeHostVideoTestSetNeedsDisplay ++num_draws_; } - virtual void AfterTest() override { - EXPECT_EQ(2, num_draws_); - } + void AfterTest() override { EXPECT_EQ(2, num_draws_); } private: int num_draws_; diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 5fc01fc..206ec60 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc @@ -49,17 +49,16 @@ class LayerScrollOffsetDelegateProxy : public LayerImpl::ScrollOffsetDelegate { } // LayerScrollOffsetDelegate implementation. - virtual void SetTotalScrollOffset( - const gfx::ScrollOffset& new_offset) override { + void SetTotalScrollOffset(const gfx::ScrollOffset& new_offset) override { last_set_scroll_offset_ = new_offset; layer_tree_impl_->UpdateScrollOffsetDelegate(); } - virtual gfx::ScrollOffset GetTotalScrollOffset() override { + gfx::ScrollOffset GetTotalScrollOffset() override { return layer_tree_impl_->GetDelegatedScrollOffset(layer_); } - virtual bool IsExternalFlingActive() const override { + bool IsExternalFlingActive() const override { return delegate_->IsExternalFlingActive(); } diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc index 6ab3397..75cd243 100644 --- a/cc/trees/occlusion_tracker_unittest.cc +++ b/cc/trees/occlusion_tracker_unittest.cc @@ -33,7 +33,7 @@ class TestContentLayer : public Layer { SetIsDrawable(true); } - virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override { + SimpleEnclosedRegion VisibleContentOpaqueRegion() const override { if (override_opaque_contents_rect_) { return SimpleEnclosedRegion( gfx::IntersectRects(opaque_contents_rect_, visible_content_rect())); @@ -46,7 +46,7 @@ class TestContentLayer : public Layer { } private: - virtual ~TestContentLayer() {} + ~TestContentLayer() override {} bool override_opaque_contents_rect_; gfx::Rect opaque_contents_rect_; @@ -59,7 +59,7 @@ class TestContentLayerImpl : public LayerImpl { SetDrawsContent(true); } - virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override { + SimpleEnclosedRegion VisibleContentOpaqueRegion() const override { if (override_opaque_contents_rect_) { return SimpleEnclosedRegion( gfx::IntersectRects(opaque_contents_rect_, visible_content_rect())); diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h index ed7b101..89378f57 100644 --- a/cc/trees/single_thread_proxy.h +++ b/cc/trees/single_thread_proxy.h @@ -31,82 +31,79 @@ class CC_EXPORT SingleThreadProxy : public Proxy, LayerTreeHost* layer_tree_host, LayerTreeHostSingleThreadClient* client, scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); - virtual ~SingleThreadProxy(); + ~SingleThreadProxy() override; // Proxy implementation - virtual void FinishAllRendering() override; - virtual bool IsStarted() const override; - virtual void SetOutputSurface(scoped_ptr<OutputSurface>) override; - virtual void SetLayerTreeHostClientReady() override; - virtual void SetVisible(bool visible) override; - virtual const RendererCapabilities& GetRendererCapabilities() const override; - virtual void SetNeedsAnimate() override; - virtual void SetNeedsUpdateLayers() override; - virtual void SetNeedsCommit() override; - virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) override; - virtual void SetNextCommitWaitsForActivation() override; - virtual void NotifyInputThrottledUntilCommit() override {} - virtual void SetDeferCommits(bool defer_commits) override; - virtual bool CommitRequested() const override; - virtual bool BeginMainFrameRequested() const override; - virtual void MainThreadHasStoppedFlinging() override {} - virtual void Start() override; - virtual void Stop() override; - virtual size_t MaxPartialTextureUpdates() const override; - virtual void ForceSerializeOnSwapBuffers() override; - virtual bool SupportsImplScrolling() const override; - virtual void AsValueInto(base::debug::TracedValue* state) const override; - virtual bool MainFrameWillHappenForTesting() override; + void FinishAllRendering() override; + bool IsStarted() const override; + void SetOutputSurface(scoped_ptr<OutputSurface>) override; + void SetLayerTreeHostClientReady() override; + void SetVisible(bool visible) override; + const RendererCapabilities& GetRendererCapabilities() const override; + void SetNeedsAnimate() override; + void SetNeedsUpdateLayers() override; + void SetNeedsCommit() override; + void SetNeedsRedraw(const gfx::Rect& damage_rect) override; + void SetNextCommitWaitsForActivation() override; + void NotifyInputThrottledUntilCommit() override {} + void SetDeferCommits(bool defer_commits) override; + bool CommitRequested() const override; + bool BeginMainFrameRequested() const override; + void MainThreadHasStoppedFlinging() override {} + void Start() override; + void Stop() override; + size_t MaxPartialTextureUpdates() const override; + void ForceSerializeOnSwapBuffers() override; + bool SupportsImplScrolling() const override; + void AsValueInto(base::debug::TracedValue* state) const override; + bool MainFrameWillHappenForTesting() override; // SchedulerClient implementation - virtual BeginFrameSource* ExternalBeginFrameSource() override; - virtual void WillBeginImplFrame(const BeginFrameArgs& args) override; - virtual void ScheduledActionSendBeginMainFrame() override; - virtual DrawResult ScheduledActionDrawAndSwapIfPossible() override; - virtual DrawResult ScheduledActionDrawAndSwapForced() override; - virtual void ScheduledActionCommit() override; - virtual void ScheduledActionAnimate() override; - virtual void ScheduledActionUpdateVisibleTiles() override; - virtual void ScheduledActionActivateSyncTree() override; - virtual void ScheduledActionBeginOutputSurfaceCreation() override; - virtual void ScheduledActionManageTiles() override; - virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) override; - virtual base::TimeDelta DrawDurationEstimate() override; - virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() override; - virtual base::TimeDelta CommitToActivateDurationEstimate() override; - virtual void DidBeginImplFrameDeadline() override; + BeginFrameSource* ExternalBeginFrameSource() override; + void WillBeginImplFrame(const BeginFrameArgs& args) override; + void ScheduledActionSendBeginMainFrame() override; + DrawResult ScheduledActionDrawAndSwapIfPossible() override; + DrawResult ScheduledActionDrawAndSwapForced() override; + void ScheduledActionCommit() override; + void ScheduledActionAnimate() override; + void ScheduledActionUpdateVisibleTiles() override; + void ScheduledActionActivateSyncTree() override; + void ScheduledActionBeginOutputSurfaceCreation() override; + void ScheduledActionManageTiles() override; + void DidAnticipatedDrawTimeChange(base::TimeTicks time) override; + base::TimeDelta DrawDurationEstimate() override; + base::TimeDelta BeginMainFrameToCommitDurationEstimate() override; + base::TimeDelta CommitToActivateDurationEstimate() override; + void DidBeginImplFrameDeadline() override; // LayerTreeHostImplClient implementation - virtual void UpdateRendererCapabilitiesOnImplThread() override; - virtual void DidLoseOutputSurfaceOnImplThread() override; - virtual void CommitVSyncParameters(base::TimeTicks timebase, - base::TimeDelta interval) override {} - virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override {} - virtual void SetMaxSwapsPendingOnImplThread(int max) override {} - virtual void DidSwapBuffersOnImplThread() override; - virtual void DidSwapBuffersCompleteOnImplThread() override; - virtual void OnCanDrawStateChanged(bool can_draw) override; - virtual void NotifyReadyToActivate() override; - virtual void SetNeedsRedrawOnImplThread() override; - virtual void SetNeedsRedrawRectOnImplThread( - const gfx::Rect& dirty_rect) override; - virtual void SetNeedsAnimateOnImplThread() override; - virtual void SetNeedsManageTilesOnImplThread() override; - virtual void DidInitializeVisibleTileOnImplThread() override; - virtual void SetNeedsCommitOnImplThread() override; - virtual void PostAnimationEventsToMainThreadOnImplThread( + void UpdateRendererCapabilitiesOnImplThread() override; + void DidLoseOutputSurfaceOnImplThread() override; + void CommitVSyncParameters(base::TimeTicks timebase, + base::TimeDelta interval) override {} + void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override {} + void SetMaxSwapsPendingOnImplThread(int max) override {} + void DidSwapBuffersOnImplThread() override; + void DidSwapBuffersCompleteOnImplThread() override; + void OnCanDrawStateChanged(bool can_draw) override; + void NotifyReadyToActivate() override; + void SetNeedsRedrawOnImplThread() override; + 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; - virtual bool ReduceContentsTextureMemoryOnImplThread( - size_t limit_bytes, - int priority_cutoff) override; - virtual bool IsInsideDraw() override; - virtual void RenewTreePriority() override {} - virtual void PostDelayedScrollbarFadeOnImplThread( - const base::Closure& start_fade, - base::TimeDelta delay) override {} - virtual void DidActivateSyncTree() override; - virtual void DidManageTiles() override; - virtual void SetDebugState(const LayerTreeDebugState& debug_state) override {} + bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, + int priority_cutoff) override; + bool IsInsideDraw() override; + void RenewTreePriority() override {} + void PostDelayedScrollbarFadeOnImplThread(const base::Closure& start_fade, + base::TimeDelta delay) override {} + void DidActivateSyncTree() override; + void DidManageTiles() override; + void SetDebugState(const LayerTreeDebugState& debug_state) override {} void RequestNewOutputSurface(); diff --git a/cc/trees/thread_proxy.h b/cc/trees/thread_proxy.h index c2440e5..2f3e7c5 100644 --- a/cc/trees/thread_proxy.h +++ b/cc/trees/thread_proxy.h @@ -42,7 +42,7 @@ class CC_EXPORT ThreadProxy : public Proxy, scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); - virtual ~ThreadProxy(); + ~ThreadProxy() override; struct BeginMainFrameAndCommitState { BeginMainFrameAndCommitState(); @@ -146,85 +146,82 @@ class CC_EXPORT ThreadProxy : public Proxy, const CompositorThreadOnly& impl() const; // Proxy implementation - virtual void FinishAllRendering() override; - virtual bool IsStarted() const override; - virtual void SetOutputSurface(scoped_ptr<OutputSurface>) override; - virtual void SetLayerTreeHostClientReady() override; - virtual void SetVisible(bool visible) override; - virtual const RendererCapabilities& GetRendererCapabilities() const override; - virtual void SetNeedsAnimate() override; - virtual void SetNeedsUpdateLayers() override; - virtual void SetNeedsCommit() override; - virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) override; - virtual void SetNextCommitWaitsForActivation() override; - virtual void NotifyInputThrottledUntilCommit() override; - virtual void SetDeferCommits(bool defer_commits) override; - virtual bool CommitRequested() const override; - virtual bool BeginMainFrameRequested() const override; - virtual void MainThreadHasStoppedFlinging() override; - virtual void Start() override; - virtual void Stop() override; - virtual size_t MaxPartialTextureUpdates() const override; - virtual void ForceSerializeOnSwapBuffers() override; - virtual bool SupportsImplScrolling() const override; - virtual void SetDebugState(const LayerTreeDebugState& debug_state) override; - virtual void AsValueInto(base::debug::TracedValue* value) const override; - virtual bool MainFrameWillHappenForTesting() override; + void FinishAllRendering() override; + bool IsStarted() const override; + void SetOutputSurface(scoped_ptr<OutputSurface>) override; + void SetLayerTreeHostClientReady() override; + void SetVisible(bool visible) override; + const RendererCapabilities& GetRendererCapabilities() const override; + void SetNeedsAnimate() override; + void SetNeedsUpdateLayers() override; + void SetNeedsCommit() override; + void SetNeedsRedraw(const gfx::Rect& damage_rect) override; + void SetNextCommitWaitsForActivation() override; + void NotifyInputThrottledUntilCommit() override; + void SetDeferCommits(bool defer_commits) override; + bool CommitRequested() const override; + bool BeginMainFrameRequested() const override; + void MainThreadHasStoppedFlinging() override; + void Start() override; + void Stop() override; + size_t MaxPartialTextureUpdates() const override; + void ForceSerializeOnSwapBuffers() override; + bool SupportsImplScrolling() const override; + void SetDebugState(const LayerTreeDebugState& debug_state) override; + void AsValueInto(base::debug::TracedValue* value) const override; + bool MainFrameWillHappenForTesting() override; // LayerTreeHostImplClient implementation - virtual void UpdateRendererCapabilitiesOnImplThread() override; - virtual void DidLoseOutputSurfaceOnImplThread() override; - virtual void CommitVSyncParameters(base::TimeTicks timebase, - base::TimeDelta interval) override; - virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override; - virtual void SetMaxSwapsPendingOnImplThread(int max) override; - virtual void DidSwapBuffersOnImplThread() override; - virtual void DidSwapBuffersCompleteOnImplThread() override; - virtual void OnCanDrawStateChanged(bool can_draw) override; - virtual void NotifyReadyToActivate() override; + void UpdateRendererCapabilitiesOnImplThread() override; + void DidLoseOutputSurfaceOnImplThread() override; + void CommitVSyncParameters(base::TimeTicks timebase, + base::TimeDelta interval) override; + void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override; + void SetMaxSwapsPendingOnImplThread(int max) override; + void DidSwapBuffersOnImplThread() override; + void DidSwapBuffersCompleteOnImplThread() override; + void OnCanDrawStateChanged(bool can_draw) override; + void NotifyReadyToActivate() override; // Please call these 3 functions through // LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and // SetNeedsAnimate(). - virtual void SetNeedsRedrawOnImplThread() override; - virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& dirty_rect) - override; - virtual void SetNeedsAnimateOnImplThread() override; - virtual void SetNeedsManageTilesOnImplThread() override; - virtual void DidInitializeVisibleTileOnImplThread() override; - virtual void SetNeedsCommitOnImplThread() override; - virtual void PostAnimationEventsToMainThreadOnImplThread( + void SetNeedsRedrawOnImplThread() override; + 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; - virtual bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, - int priority_cutoff) - override; - virtual bool IsInsideDraw() override; - virtual void RenewTreePriority() override; - virtual void PostDelayedScrollbarFadeOnImplThread( - const base::Closure& start_fade, - base::TimeDelta delay) override; - virtual void DidActivateSyncTree() override; - virtual void DidManageTiles() override; + bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes, + int priority_cutoff) override; + bool IsInsideDraw() override; + void RenewTreePriority() override; + void PostDelayedScrollbarFadeOnImplThread(const base::Closure& start_fade, + base::TimeDelta delay) override; + void DidActivateSyncTree() override; + void DidManageTiles() override; // SchedulerClient implementation - virtual BeginFrameSource* ExternalBeginFrameSource() override; - virtual void WillBeginImplFrame(const BeginFrameArgs& args) override; - virtual void ScheduledActionSendBeginMainFrame() override; - virtual DrawResult ScheduledActionDrawAndSwapIfPossible() override; - virtual DrawResult ScheduledActionDrawAndSwapForced() override; - virtual void ScheduledActionAnimate() override; - virtual void ScheduledActionCommit() override; - virtual void ScheduledActionUpdateVisibleTiles() override; - virtual void ScheduledActionActivateSyncTree() override; - virtual void ScheduledActionBeginOutputSurfaceCreation() override; - virtual void ScheduledActionManageTiles() override; - virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) override; - virtual base::TimeDelta DrawDurationEstimate() override; - virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() override; - virtual base::TimeDelta CommitToActivateDurationEstimate() override; - virtual void DidBeginImplFrameDeadline() override; + BeginFrameSource* ExternalBeginFrameSource() override; + void WillBeginImplFrame(const BeginFrameArgs& args) override; + void ScheduledActionSendBeginMainFrame() override; + DrawResult ScheduledActionDrawAndSwapIfPossible() override; + DrawResult ScheduledActionDrawAndSwapForced() override; + void ScheduledActionAnimate() override; + void ScheduledActionCommit() override; + void ScheduledActionUpdateVisibleTiles() override; + void ScheduledActionActivateSyncTree() override; + void ScheduledActionBeginOutputSurfaceCreation() override; + void ScheduledActionManageTiles() override; + void DidAnticipatedDrawTimeChange(base::TimeTicks time) override; + base::TimeDelta DrawDurationEstimate() override; + base::TimeDelta BeginMainFrameToCommitDurationEstimate() override; + base::TimeDelta CommitToActivateDurationEstimate() override; + void DidBeginImplFrameDeadline() override; // ResourceUpdateControllerClient implementation - virtual void ReadyToFinalizeTextureUpdates() override; + void ReadyToFinalizeTextureUpdates() override; protected: ThreadProxy(LayerTreeHost* layer_tree_host, diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc index 2b8f5df..2715727 100644 --- a/cc/trees/tree_synchronizer_unittest.cc +++ b/cc/trees/tree_synchronizer_unittest.cc @@ -30,7 +30,7 @@ class MockLayerImpl : public LayerImpl { int layer_id) { return make_scoped_ptr(new MockLayerImpl(tree_impl, layer_id)); } - virtual ~MockLayerImpl() { + ~MockLayerImpl() override { if (layer_impl_destruction_list_) layer_impl_destruction_list_->push_back(id()); } @@ -54,12 +54,11 @@ class MockLayer : public Layer { return make_scoped_refptr(new MockLayer(layer_impl_destruction_list)); } - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override { + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override { return MockLayerImpl::Create(tree_impl, layer_id_); } - virtual void PushPropertiesTo(LayerImpl* layer_impl) override { + void PushPropertiesTo(LayerImpl* layer_impl) override { Layer::PushPropertiesTo(layer_impl); MockLayerImpl* mock_layer_impl = static_cast<MockLayerImpl*>(layer_impl); @@ -69,7 +68,7 @@ class MockLayer : public Layer { private: explicit MockLayer(std::vector<int>* layer_impl_destruction_list) : Layer(), layer_impl_destruction_list_(layer_impl_destruction_list) {} - virtual ~MockLayer() {} + ~MockLayer() override {} std::vector<int>* layer_impl_destruction_list_; }; @@ -88,10 +87,10 @@ class FakeLayerAnimationController : public LayerAnimationController { : LayerAnimationController(1), synchronized_animations_(false) {} - virtual ~FakeLayerAnimationController() {} + ~FakeLayerAnimationController() override {} - virtual void PushAnimationUpdatesTo(LayerAnimationController* controller_impl) - override { + void PushAnimationUpdatesTo( + LayerAnimationController* controller_impl) override { LayerAnimationController::PushAnimationUpdatesTo(controller_impl); synchronized_animations_ = true; } |