diff options
220 files changed, 2890 insertions, 3251 deletions
diff --git a/cc/animation/animation_curve.h b/cc/animation/animation_curve.h index 7f38af9..57c42c7 100644 --- a/cc/animation/animation_curve.h +++ b/cc/animation/animation_curve.h @@ -45,27 +45,27 @@ class CC_EXPORT AnimationCurve { class CC_EXPORT ColorAnimationCurve : public AnimationCurve { public: - virtual ~ColorAnimationCurve() {} + ~ColorAnimationCurve() override {} virtual SkColor GetValue(double t) const = 0; // Partial Animation implementation. - virtual CurveType Type() const override; + CurveType Type() const override; }; class CC_EXPORT FloatAnimationCurve : public AnimationCurve { public: - virtual ~FloatAnimationCurve() {} + ~FloatAnimationCurve() override {} virtual float GetValue(double t) const = 0; // Partial Animation implementation. - virtual CurveType Type() const override; + CurveType Type() const override; }; class CC_EXPORT TransformAnimationCurve : public AnimationCurve { public: - virtual ~TransformAnimationCurve() {} + ~TransformAnimationCurve() override {} virtual gfx::Transform GetValue(double t) const = 0; @@ -90,18 +90,18 @@ class CC_EXPORT TransformAnimationCurve : public AnimationCurve { float* max_scale) const = 0; // Partial Animation implementation. - virtual CurveType Type() const override; + CurveType Type() const override; }; class CC_EXPORT FilterAnimationCurve : public AnimationCurve { public: - virtual ~FilterAnimationCurve() {} + ~FilterAnimationCurve() override {} virtual FilterOperations GetValue(double t) const = 0; virtual bool HasFilterThatMovesPixels() const = 0; // Partial Animation implementation. - virtual CurveType Type() const override; + CurveType Type() const override; }; } // namespace cc diff --git a/cc/animation/keyframed_animation_curve.h b/cc/animation/keyframed_animation_curve.h index 5d25b89..a6e6740 100644 --- a/cc/animation/keyframed_animation_curve.h +++ b/cc/animation/keyframed_animation_curve.h @@ -37,7 +37,7 @@ class CC_EXPORT ColorKeyframe : public Keyframe { double time, SkColor value, scoped_ptr<TimingFunction> timing_function); - virtual ~ColorKeyframe(); + ~ColorKeyframe() override; SkColor Value() const; @@ -57,7 +57,7 @@ class CC_EXPORT FloatKeyframe : public Keyframe { double time, float value, scoped_ptr<TimingFunction> timing_function); - virtual ~FloatKeyframe(); + ~FloatKeyframe() override; float Value() const; @@ -77,7 +77,7 @@ class CC_EXPORT TransformKeyframe : public Keyframe { double time, const TransformOperations& value, scoped_ptr<TimingFunction> timing_function); - virtual ~TransformKeyframe(); + ~TransformKeyframe() override; const TransformOperations& Value() const; @@ -98,7 +98,7 @@ class CC_EXPORT FilterKeyframe : public Keyframe { double time, const FilterOperations& value, scoped_ptr<TimingFunction> timing_function); - virtual ~FilterKeyframe(); + ~FilterKeyframe() override; const FilterOperations& Value() const; @@ -118,7 +118,7 @@ class CC_EXPORT KeyframedColorAnimationCurve : public ColorAnimationCurve { // It is required that the keyframes be sorted by time. static scoped_ptr<KeyframedColorAnimationCurve> Create(); - virtual ~KeyframedColorAnimationCurve(); + ~KeyframedColorAnimationCurve() override; void AddKeyframe(scoped_ptr<ColorKeyframe> keyframe); void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { @@ -126,11 +126,11 @@ class CC_EXPORT KeyframedColorAnimationCurve : public ColorAnimationCurve { } // AnimationCurve implementation - virtual double Duration() const override; - virtual scoped_ptr<AnimationCurve> Clone() const override; + double Duration() const override; + scoped_ptr<AnimationCurve> Clone() const override; // BackgrounColorAnimationCurve implementation - virtual SkColor GetValue(double t) const override; + SkColor GetValue(double t) const override; private: KeyframedColorAnimationCurve(); @@ -148,7 +148,7 @@ class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve { // It is required that the keyframes be sorted by time. static scoped_ptr<KeyframedFloatAnimationCurve> Create(); - virtual ~KeyframedFloatAnimationCurve(); + ~KeyframedFloatAnimationCurve() override; void AddKeyframe(scoped_ptr<FloatKeyframe> keyframe); void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { @@ -156,11 +156,11 @@ class CC_EXPORT KeyframedFloatAnimationCurve : public FloatAnimationCurve { } // AnimationCurve implementation - virtual double Duration() const override; - virtual scoped_ptr<AnimationCurve> Clone() const override; + double Duration() const override; + scoped_ptr<AnimationCurve> Clone() const override; // FloatAnimationCurve implementation - virtual float GetValue(double t) const override; + float GetValue(double t) const override; private: KeyframedFloatAnimationCurve(); @@ -179,7 +179,7 @@ class CC_EXPORT KeyframedTransformAnimationCurve // It is required that the keyframes be sorted by time. static scoped_ptr<KeyframedTransformAnimationCurve> Create(); - virtual ~KeyframedTransformAnimationCurve(); + ~KeyframedTransformAnimationCurve() override; void AddKeyframe(scoped_ptr<TransformKeyframe> keyframe); void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { @@ -187,17 +187,17 @@ class CC_EXPORT KeyframedTransformAnimationCurve } // AnimationCurve implementation - virtual double Duration() const override; - virtual scoped_ptr<AnimationCurve> Clone() const override; + double Duration() const override; + scoped_ptr<AnimationCurve> Clone() const override; // TransformAnimationCurve implementation - virtual gfx::Transform GetValue(double t) const override; - virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, - gfx::BoxF* bounds) const override; - virtual bool AffectsScale() const override; - virtual bool IsTranslation() const override; - virtual bool MaximumTargetScale(bool forward_direction, - float* max_scale) const override; + gfx::Transform GetValue(double t) const override; + bool AnimatedBoundsForBox(const gfx::BoxF& box, + gfx::BoxF* bounds) const override; + bool AffectsScale() const override; + bool IsTranslation() const override; + bool MaximumTargetScale(bool forward_direction, + float* max_scale) const override; private: KeyframedTransformAnimationCurve(); @@ -216,7 +216,7 @@ class CC_EXPORT KeyframedFilterAnimationCurve // It is required that the keyframes be sorted by time. static scoped_ptr<KeyframedFilterAnimationCurve> Create(); - virtual ~KeyframedFilterAnimationCurve(); + ~KeyframedFilterAnimationCurve() override; void AddKeyframe(scoped_ptr<FilterKeyframe> keyframe); void SetTimingFunction(scoped_ptr<TimingFunction> timing_function) { @@ -224,12 +224,12 @@ class CC_EXPORT KeyframedFilterAnimationCurve } // AnimationCurve implementation - virtual double Duration() const override; - virtual scoped_ptr<AnimationCurve> Clone() const override; + double Duration() const override; + scoped_ptr<AnimationCurve> Clone() const override; // FilterAnimationCurve implementation - virtual FilterOperations GetValue(double t) const override; - virtual bool HasFilterThatMovesPixels() const override; + FilterOperations GetValue(double t) const override; + bool HasFilterThatMovesPixels() const override; private: KeyframedFilterAnimationCurve(); diff --git a/cc/animation/layer_animation_controller_unittest.cc b/cc/animation/layer_animation_controller_unittest.cc index a5a29650..96c406c 100644 --- a/cc/animation/layer_animation_controller_unittest.cc +++ b/cc/animation/layer_animation_controller_unittest.cc @@ -859,16 +859,15 @@ class FakeAnimationDelegate : public AnimationDelegate { : started_(false), finished_(false) {} - virtual void NotifyAnimationStarted(TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationStarted(TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { started_ = true; } - virtual void NotifyAnimationFinished( - TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override { + void NotifyAnimationFinished(TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override { finished_ = true; } diff --git a/cc/animation/scroll_offset_animation_curve.h b/cc/animation/scroll_offset_animation_curve.h index 197a431..0c8692a 100644 --- a/cc/animation/scroll_offset_animation_curve.h +++ b/cc/animation/scroll_offset_animation_curve.h @@ -21,7 +21,7 @@ class CC_EXPORT ScrollOffsetAnimationCurve : public AnimationCurve { const gfx::ScrollOffset& target_value, scoped_ptr<TimingFunction> timing_function); - virtual ~ScrollOffsetAnimationCurve(); + ~ScrollOffsetAnimationCurve() override; void SetInitialValue(const gfx::ScrollOffset& initial_value); gfx::ScrollOffset GetValue(double t) const; @@ -29,9 +29,9 @@ class CC_EXPORT ScrollOffsetAnimationCurve : public AnimationCurve { void UpdateTarget(double t, const gfx::ScrollOffset& new_target); // AnimationCurve implementation - virtual double Duration() const override; - virtual CurveType Type() const override; - virtual scoped_ptr<AnimationCurve> Clone() const override; + double Duration() const override; + CurveType Type() const override; + scoped_ptr<AnimationCurve> Clone() const override; private: ScrollOffsetAnimationCurve(const gfx::ScrollOffset& target_value, diff --git a/cc/animation/scrollbar_animation_controller_linear_fade.h b/cc/animation/scrollbar_animation_controller_linear_fade.h index 86524f2..73d6031 100644 --- a/cc/animation/scrollbar_animation_controller_linear_fade.h +++ b/cc/animation/scrollbar_animation_controller_linear_fade.h @@ -22,9 +22,9 @@ class CC_EXPORT ScrollbarAnimationControllerLinearFade base::TimeDelta resize_delay_before_starting, base::TimeDelta duration); - virtual ~ScrollbarAnimationControllerLinearFade(); + ~ScrollbarAnimationControllerLinearFade() override; - virtual void DidScrollUpdate(bool on_resize) override; + void DidScrollUpdate(bool on_resize) override; protected: ScrollbarAnimationControllerLinearFade( @@ -34,7 +34,7 @@ class CC_EXPORT ScrollbarAnimationControllerLinearFade base::TimeDelta resize_delay_before_starting, base::TimeDelta duration); - virtual void RunAnimationFrame(float progress) override; + void RunAnimationFrame(float progress) override; private: float OpacityAtTime(base::TimeTicks now) const; diff --git a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc index 4ffb0b2..3f01c54 100644 --- a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc +++ b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc @@ -22,14 +22,12 @@ class ScrollbarAnimationControllerLinearFadeTest ScrollbarAnimationControllerLinearFadeTest() : host_impl_(&proxy_, &shared_bitmap_manager_), needs_frame_count_(0) {} - virtual void PostDelayedScrollbarFade(const base::Closure& start_fade, - base::TimeDelta delay) override { + void PostDelayedScrollbarFade(const base::Closure& start_fade, + base::TimeDelta delay) override { start_fade_ = start_fade; delay_ = delay; } - virtual void SetNeedsScrollbarAnimationFrame() override { - needs_frame_count_++; - } + void SetNeedsScrollbarAnimationFrame() override { needs_frame_count_++; } protected: virtual void SetUp() { @@ -83,7 +81,7 @@ class ScrollbarAnimationControllerLinearFadeTest class VerticalScrollbarAnimationControllerLinearFadeTest : public ScrollbarAnimationControllerLinearFadeTest { protected: - virtual ScrollbarOrientation orientation() const override { return VERTICAL; } + ScrollbarOrientation orientation() const override { return VERTICAL; } }; TEST_F(ScrollbarAnimationControllerLinearFadeTest, DelayAnimationOnResize) { diff --git a/cc/animation/scrollbar_animation_controller_thinning.h b/cc/animation/scrollbar_animation_controller_thinning.h index 6e9f21a..2cf30f5 100644 --- a/cc/animation/scrollbar_animation_controller_thinning.h +++ b/cc/animation/scrollbar_animation_controller_thinning.h @@ -24,7 +24,7 @@ class CC_EXPORT ScrollbarAnimationControllerThinning base::TimeDelta resize_delay_before_starting, base::TimeDelta duration); - virtual ~ScrollbarAnimationControllerThinning(); + ~ScrollbarAnimationControllerThinning() override; void set_mouse_move_distance_for_test(float distance) { mouse_move_distance_to_trigger_animation_ = distance; @@ -32,9 +32,9 @@ class CC_EXPORT ScrollbarAnimationControllerThinning bool mouse_is_over_scrollbar() const { return mouse_is_over_scrollbar_; } bool mouse_is_near_scrollbar() const { return mouse_is_near_scrollbar_; } - virtual void DidScrollUpdate(bool on_resize) override; - virtual void DidMouseMoveOffScrollbar() override; - virtual void DidMouseMoveNear(float distance) override; + void DidScrollUpdate(bool on_resize) override; + void DidMouseMoveOffScrollbar() override; + void DidMouseMoveNear(float distance) override; protected: ScrollbarAnimationControllerThinning( @@ -44,7 +44,7 @@ class CC_EXPORT ScrollbarAnimationControllerThinning base::TimeDelta resize_delay_before_starting, base::TimeDelta duration); - virtual void RunAnimationFrame(float progress) override; + void RunAnimationFrame(float progress) override; private: // Describes whether the current animation should INCREASE (darken / thicken) diff --git a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc index 7836dd7..d46431b 100644 --- a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc +++ b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc @@ -22,11 +22,11 @@ class ScrollbarAnimationControllerThinningTest ScrollbarAnimationControllerThinningTest() : host_impl_(&proxy_, &shared_bitmap_manager_) {} - virtual void PostDelayedScrollbarFade(const base::Closure& start_fade, - base::TimeDelta delay) override { + void PostDelayedScrollbarFade(const base::Closure& start_fade, + base::TimeDelta delay) override { start_fade_ = start_fade; } - virtual void SetNeedsScrollbarAnimationFrame() override {} + void SetNeedsScrollbarAnimationFrame() override {} protected: virtual void SetUp() { diff --git a/cc/animation/timing_function.h b/cc/animation/timing_function.h index 9974865..69d1cc9 100644 --- a/cc/animation/timing_function.h +++ b/cc/animation/timing_function.h @@ -32,13 +32,13 @@ class CC_EXPORT CubicBezierTimingFunction : public TimingFunction { public: static scoped_ptr<CubicBezierTimingFunction> Create(double x1, double y1, double x2, double y2); - virtual ~CubicBezierTimingFunction(); + ~CubicBezierTimingFunction() override; // TimingFunction implementation. - virtual float GetValue(double time) const override; - virtual float Velocity(double time) const override; - virtual void Range(float* min, float* max) const override; - virtual scoped_ptr<TimingFunction> Clone() const override; + float GetValue(double time) const override; + float Velocity(double time) const override; + void Range(float* min, float* max) const override; + scoped_ptr<TimingFunction> Clone() const override; protected: CubicBezierTimingFunction(double x1, double y1, double x2, double y2); diff --git a/cc/base/delayed_unique_notifier_unittest.cc b/cc/base/delayed_unique_notifier_unittest.cc index 090da33..41cde83 100644 --- a/cc/base/delayed_unique_notifier_unittest.cc +++ b/cc/base/delayed_unique_notifier_unittest.cc @@ -20,10 +20,10 @@ class TestNotifier : public DelayedUniqueNotifier { const base::Closure& closure, const base::TimeDelta& delay) : DelayedUniqueNotifier(task_runner, closure, delay) {} - virtual ~TestNotifier() {} + ~TestNotifier() override {} // Overridden from DelayedUniqueNotifier: - virtual base::TimeTicks Now() const override { return now_; } + base::TimeTicks Now() const override { return now_; } void SetNow(base::TimeTicks now) { now_ = now; } diff --git a/cc/base/latency_info_swap_promise.h b/cc/base/latency_info_swap_promise.h index b912f24..a7941f1 100644 --- a/cc/base/latency_info_swap_promise.h +++ b/cc/base/latency_info_swap_promise.h @@ -14,12 +14,12 @@ namespace cc { class CC_EXPORT LatencyInfoSwapPromise : public SwapPromise { public: explicit LatencyInfoSwapPromise(const ui::LatencyInfo& latency_info); - virtual ~LatencyInfoSwapPromise(); + ~LatencyInfoSwapPromise() override; - virtual void DidSwap(CompositorFrameMetadata* metadata) override; - virtual void DidNotSwap(DidNotSwapReason reason) override; + void DidSwap(CompositorFrameMetadata* metadata) override; + void DidNotSwap(DidNotSwapReason reason) override; - virtual int64 TraceId() const override; + int64 TraceId() const override; private: ui::LatencyInfo latency_; diff --git a/cc/base/latency_info_swap_promise_monitor.h b/cc/base/latency_info_swap_promise_monitor.h index cf1dc1d..d9e71fb 100644 --- a/cc/base/latency_info_swap_promise_monitor.h +++ b/cc/base/latency_info_swap_promise_monitor.h @@ -22,11 +22,11 @@ class CC_EXPORT LatencyInfoSwapPromiseMonitor : public SwapPromiseMonitor { LatencyInfoSwapPromiseMonitor(ui::LatencyInfo* latency, LayerTreeHost* layer_tree_host, LayerTreeHostImpl* layer_tree_host_impl); - virtual ~LatencyInfoSwapPromiseMonitor(); + ~LatencyInfoSwapPromiseMonitor() override; - virtual void OnSetNeedsCommitOnMain() override; - virtual void OnSetNeedsRedrawOnImpl() override; - virtual void OnForwardScrollUpdateToMainThreadOnImpl() override; + void OnSetNeedsCommitOnMain() override; + void OnSetNeedsRedrawOnImpl() override; + void OnForwardScrollUpdateToMainThreadOnImpl() override; private: ui::LatencyInfo* latency_; diff --git a/cc/blink/scrollbar_impl.h b/cc/blink/scrollbar_impl.h index 5f0572c..fa5f042 100644 --- a/cc/blink/scrollbar_impl.h +++ b/cc/blink/scrollbar_impl.h @@ -22,20 +22,20 @@ class ScrollbarImpl : public cc::Scrollbar { ScrollbarImpl(scoped_ptr<blink::WebScrollbar> scrollbar, blink::WebScrollbarThemePainter painter, scoped_ptr<blink::WebScrollbarThemeGeometry> geometry); - virtual ~ScrollbarImpl(); + ~ScrollbarImpl() override; // cc::Scrollbar implementation. - virtual cc::ScrollbarOrientation Orientation() const override; - virtual bool IsLeftSideVerticalScrollbar() const override; - virtual bool HasThumb() const override; - virtual bool IsOverlay() const override; - virtual gfx::Point Location() const override; - virtual int ThumbThickness() const override; - virtual int ThumbLength() const override; - virtual gfx::Rect TrackRect() const override; - virtual void PaintPart(SkCanvas* canvas, - cc::ScrollbarPart part, - const gfx::Rect& content_rect) override; + cc::ScrollbarOrientation Orientation() const override; + bool IsLeftSideVerticalScrollbar() const override; + bool HasThumb() const override; + bool IsOverlay() const override; + gfx::Point Location() const override; + int ThumbThickness() const override; + int ThumbLength() const override; + gfx::Rect TrackRect() const override; + void PaintPart(SkCanvas* canvas, + cc::ScrollbarPart part, + const gfx::Rect& content_rect) override; private: scoped_ptr<blink::WebScrollbar> scrollbar_; diff --git a/cc/blink/web_content_layer_impl.h b/cc/blink/web_content_layer_impl.h index 9dab02d..b9bb871 100644 --- a/cc/blink/web_content_layer_impl.h +++ b/cc/blink/web_content_layer_impl.h @@ -36,12 +36,12 @@ class WebContentLayerImpl : public blink::WebContentLayer, virtual ~WebContentLayerImpl(); // ContentLayerClient implementation. - virtual void PaintContents(SkCanvas* canvas, - const gfx::Rect& clip, - ContentLayerClient::GraphicsContextStatus - graphics_context_status) override; - virtual void DidChangeLayerCanUseLCDText() override; - virtual bool FillsBoundsCompletely() const override; + void PaintContents(SkCanvas* canvas, + const gfx::Rect& clip, + ContentLayerClient::GraphicsContextStatus + graphics_context_status) override; + void DidChangeLayerCanUseLCDText() override; + bool FillsBoundsCompletely() const override; scoped_ptr<WebLayerImpl> layer_; blink::WebContentLayerClient* client_; diff --git a/cc/blink/web_external_texture_layer_impl.h b/cc/blink/web_external_texture_layer_impl.h index a657e62..853b1a0 100644 --- a/cc/blink/web_external_texture_layer_impl.h +++ b/cc/blink/web_external_texture_layer_impl.h @@ -45,7 +45,7 @@ class WebExternalTextureLayerImpl virtual void setRateLimitContext(bool rate_limit); // TextureLayerClient implementation. - virtual bool PrepareTextureMailbox( + bool PrepareTextureMailbox( cc::TextureMailbox* mailbox, scoped_ptr<cc::SingleReleaseCallback>* release_callback, bool use_shared_memory) override; diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc index b4b9f29..f73ae10 100644 --- a/cc/blink/web_layer_impl.cc +++ b/cc/blink/web_layer_impl.cc @@ -435,7 +435,7 @@ class TracedDebugInfo : public base::debug::ConvertableToTraceFormat { // This object takes ownership of the debug_info object. explicit TracedDebugInfo(blink::WebGraphicsLayerDebugInfo* debug_info) : debug_info_(debug_info) {} - virtual void AppendAsTraceFormat(std::string* out) const override { + void AppendAsTraceFormat(std::string* out) const override { DCHECK(thread_checker_.CalledOnValidThread()); blink::WebString web_string; debug_info_->appendAsTraceFormat(&web_string); @@ -443,7 +443,7 @@ class TracedDebugInfo : public base::debug::ConvertableToTraceFormat { } private: - virtual ~TracedDebugInfo() {} + ~TracedDebugInfo() override {} scoped_ptr<blink::WebGraphicsLayerDebugInfo> debug_info_; base::ThreadChecker thread_checker_; }; diff --git a/cc/blink/web_layer_impl.h b/cc/blink/web_layer_impl.h index cc94344..bced5980 100644 --- a/cc/blink/web_layer_impl.h +++ b/cc/blink/web_layer_impl.h @@ -132,8 +132,7 @@ class WebLayerImpl : public blink::WebLayer, public cc::LayerClient { virtual void setWebLayerClient(blink::WebLayerClient* client); // LayerClient implementation. - virtual scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo() - override; + scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo() override; virtual void setScrollParent(blink::WebLayer* parent); virtual void setClipParent(blink::WebLayer* parent); diff --git a/cc/blink/web_to_cc_animation_delegate_adapter.h b/cc/blink/web_to_cc_animation_delegate_adapter.h index b52a758..4d52cb4 100644 --- a/cc/blink/web_to_cc_animation_delegate_adapter.h +++ b/cc/blink/web_to_cc_animation_delegate_adapter.h @@ -21,14 +21,12 @@ class WebToCCAnimationDelegateAdapter : public cc::AnimationDelegate { blink::WebCompositorAnimationDelegate* delegate); private: - virtual void NotifyAnimationStarted( - base::TimeTicks monotonic_time, - cc::Animation::TargetProperty target_property, - int group) override; - virtual void NotifyAnimationFinished( - base::TimeTicks monotonic_time, - cc::Animation::TargetProperty target_property, - int group) override; + void NotifyAnimationStarted(base::TimeTicks monotonic_time, + cc::Animation::TargetProperty target_property, + int group) override; + void NotifyAnimationFinished(base::TimeTicks monotonic_time, + cc::Animation::TargetProperty target_property, + int group) override; blink::WebCompositorAnimationDelegate* delegate_; diff --git a/cc/debug/invalidation_benchmark.h b/cc/debug/invalidation_benchmark.h index a727104..f17fdbd 100644 --- a/cc/debug/invalidation_benchmark.h +++ b/cc/debug/invalidation_benchmark.h @@ -21,12 +21,12 @@ class CC_EXPORT InvalidationBenchmark : public MicroBenchmark { public: explicit InvalidationBenchmark(scoped_ptr<base::Value> value, const MicroBenchmark::DoneCallback& callback); - virtual ~InvalidationBenchmark(); + ~InvalidationBenchmark() override; // Implements MicroBenchmark interface. - virtual void DidUpdateLayers(LayerTreeHost* host) override; - virtual void RunOnLayer(PictureLayer* layer) override; - virtual bool ProcessMessage(scoped_ptr<base::Value> value) override; + void DidUpdateLayers(LayerTreeHost* host) override; + void RunOnLayer(PictureLayer* layer) override; + bool ProcessMessage(scoped_ptr<base::Value> value) override; private: enum Mode { FIXED_SIZE, LAYER, VIEWPORT, RANDOM }; diff --git a/cc/debug/picture_record_benchmark.h b/cc/debug/picture_record_benchmark.h index 472f660..d6330fe1 100644 --- a/cc/debug/picture_record_benchmark.h +++ b/cc/debug/picture_record_benchmark.h @@ -20,11 +20,11 @@ class CC_EXPORT PictureRecordBenchmark : public MicroBenchmark { public: explicit PictureRecordBenchmark(scoped_ptr<base::Value> value, const MicroBenchmark::DoneCallback& callback); - virtual ~PictureRecordBenchmark(); + ~PictureRecordBenchmark() override; // Implements MicroBenchmark interface. - virtual void DidUpdateLayers(LayerTreeHost* host) override; - virtual void RunOnLayer(PictureLayer* layer) override; + void DidUpdateLayers(LayerTreeHost* host) override; + void RunOnLayer(PictureLayer* layer) override; private: void Run(Layer* layer); diff --git a/cc/debug/rasterize_and_record_benchmark.h b/cc/debug/rasterize_and_record_benchmark.h index 921a7e9..68d5d05 100644 --- a/cc/debug/rasterize_and_record_benchmark.h +++ b/cc/debug/rasterize_and_record_benchmark.h @@ -27,13 +27,13 @@ class RasterizeAndRecordBenchmark : public MicroBenchmark { explicit RasterizeAndRecordBenchmark( scoped_ptr<base::Value> value, const MicroBenchmark::DoneCallback& callback); - virtual ~RasterizeAndRecordBenchmark(); + ~RasterizeAndRecordBenchmark() override; // Implements MicroBenchmark interface. - virtual void DidUpdateLayers(LayerTreeHost* host) override; - virtual void RunOnLayer(PictureLayer* layer) override; + void DidUpdateLayers(LayerTreeHost* host) override; + void RunOnLayer(PictureLayer* layer) override; - virtual scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( + scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( scoped_refptr<base::MessageLoopProxy> origin_loop) override; private: diff --git a/cc/debug/rasterize_and_record_benchmark_impl.cc b/cc/debug/rasterize_and_record_benchmark_impl.cc index 91c92b9..77bc259 100644 --- a/cc/debug/rasterize_and_record_benchmark_impl.cc +++ b/cc/debug/rasterize_and_record_benchmark_impl.cc @@ -37,7 +37,7 @@ class BenchmarkRasterTask : public Task { best_time_(base::TimeDelta::Max()) {} // Overridden from Task: - virtual void RunOnWorkerThread() override { + void RunOnWorkerThread() override { // Parameters for LapTimer. const int kTimeLimitMillis = 1; const int kWarmupRuns = 0; @@ -76,7 +76,7 @@ class BenchmarkRasterTask : public Task { base::TimeDelta GetBestTime() const { return best_time_; } private: - virtual ~BenchmarkRasterTask() {} + ~BenchmarkRasterTask() override {} PicturePileImpl* picture_pile_; gfx::Rect content_rect_; @@ -94,50 +94,46 @@ class FixedInvalidationPictureLayerTilingClient const Region invalidation) : base_client_(base_client), invalidation_(invalidation) {} - virtual scoped_refptr<Tile> CreateTile( - PictureLayerTiling* tiling, - const gfx::Rect& content_rect) override { + scoped_refptr<Tile> CreateTile(PictureLayerTiling* tiling, + const gfx::Rect& content_rect) override { return base_client_->CreateTile(tiling, content_rect); } - virtual PicturePileImpl* GetPile() override { - return base_client_->GetPile(); - } + PicturePileImpl* GetPile() override { return base_client_->GetPile(); } - virtual gfx::Size CalculateTileSize( - const gfx::Size& content_bounds) const override { + gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override { return base_client_->CalculateTileSize(content_bounds); } // This is the only function that returns something different from the base // client. - virtual const Region* GetInvalidation() override { return &invalidation_; } + const Region* GetInvalidation() override { return &invalidation_; } - virtual const PictureLayerTiling* GetTwinTiling( + const PictureLayerTiling* GetTwinTiling( const PictureLayerTiling* tiling) const override { return base_client_->GetTwinTiling(tiling); } - virtual PictureLayerTiling* GetRecycledTwinTiling( + PictureLayerTiling* GetRecycledTwinTiling( const PictureLayerTiling* tiling) override { return base_client_->GetRecycledTwinTiling(tiling); } - virtual size_t GetMaxTilesForInterestArea() const override { + size_t GetMaxTilesForInterestArea() const override { return base_client_->GetMaxTilesForInterestArea(); } - virtual float GetSkewportTargetTimeInSeconds() const override { + float GetSkewportTargetTimeInSeconds() const override { return base_client_->GetSkewportTargetTimeInSeconds(); } - virtual int GetSkewportExtrapolationLimitInContentPixels() const override { + int GetSkewportExtrapolationLimitInContentPixels() const override { return base_client_->GetSkewportExtrapolationLimitInContentPixels(); } - virtual WhichTree GetTree() const override { return base_client_->GetTree(); } + WhichTree GetTree() const override { return base_client_->GetTree(); } - virtual bool RequiresHighResToDraw() const override { + bool RequiresHighResToDraw() const override { return base_client_->RequiresHighResToDraw(); } diff --git a/cc/debug/rasterize_and_record_benchmark_impl.h b/cc/debug/rasterize_and_record_benchmark_impl.h index 4508d5e..c0f26fd 100644 --- a/cc/debug/rasterize_and_record_benchmark_impl.h +++ b/cc/debug/rasterize_and_record_benchmark_impl.h @@ -24,11 +24,11 @@ class RasterizeAndRecordBenchmarkImpl : public MicroBenchmarkImpl { scoped_refptr<base::MessageLoopProxy> origin_loop, base::Value* value, const MicroBenchmarkImpl::DoneCallback& callback); - virtual ~RasterizeAndRecordBenchmarkImpl(); + ~RasterizeAndRecordBenchmarkImpl() override; // Implements MicroBenchmark interface. - virtual void DidCompleteCommit(LayerTreeHostImpl* host) override; - virtual void RunOnLayer(PictureLayerImpl* layer) override; + void DidCompleteCommit(LayerTreeHostImpl* host) override; + void RunOnLayer(PictureLayerImpl* layer) override; private: void Run(LayerImpl* layer); diff --git a/cc/debug/traced_picture.h b/cc/debug/traced_picture.h index 1d31694a..b5f5e3a 100644 --- a/cc/debug/traced_picture.h +++ b/cc/debug/traced_picture.h @@ -23,10 +23,10 @@ class TracedPicture : public base::debug::ConvertableToTraceFormat { static scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceablePictureAlias(const Picture* original); - virtual void AppendAsTraceFormat(std::string* out) const override; + void AppendAsTraceFormat(std::string* out) const override; private: - virtual ~TracedPicture(); + ~TracedPicture() override; void AppendPicture(std::string* out) const; void AppendPictureAlias(std::string* out) const; diff --git a/cc/debug/unittest_only_benchmark.h b/cc/debug/unittest_only_benchmark.h index 277d85f..7fa2b4d 100644 --- a/cc/debug/unittest_only_benchmark.h +++ b/cc/debug/unittest_only_benchmark.h @@ -14,13 +14,13 @@ class CC_EXPORT UnittestOnlyBenchmark : public MicroBenchmark { public: UnittestOnlyBenchmark(scoped_ptr<base::Value> value, const DoneCallback& callback); - virtual ~UnittestOnlyBenchmark(); + ~UnittestOnlyBenchmark() override; - virtual void DidUpdateLayers(LayerTreeHost* host) override; - virtual bool ProcessMessage(scoped_ptr<base::Value> value) override; + void DidUpdateLayers(LayerTreeHost* host) override; + bool ProcessMessage(scoped_ptr<base::Value> value) override; protected: - virtual scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( + scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( scoped_refptr<base::MessageLoopProxy> origin_loop) override; private: diff --git a/cc/debug/unittest_only_benchmark_impl.h b/cc/debug/unittest_only_benchmark_impl.h index 48953de..f9b256d 100644 --- a/cc/debug/unittest_only_benchmark_impl.h +++ b/cc/debug/unittest_only_benchmark_impl.h @@ -21,9 +21,9 @@ class CC_EXPORT UnittestOnlyBenchmarkImpl : public MicroBenchmarkImpl { UnittestOnlyBenchmarkImpl(scoped_refptr<base::MessageLoopProxy> origin_loop, base::Value* settings, const DoneCallback& callback); - virtual ~UnittestOnlyBenchmarkImpl(); + ~UnittestOnlyBenchmarkImpl() override; - virtual void DidCompleteCommit(LayerTreeHostImpl* host) override; + void DidCompleteCommit(LayerTreeHostImpl* host) override; }; } // namespace cc diff --git a/cc/input/top_controls_manager_unittest.cc b/cc/input/top_controls_manager_unittest.cc index 177904c..9bde132 100644 --- a/cc/input/top_controls_manager_unittest.cc +++ b/cc/input/top_controls_manager_unittest.cc @@ -35,24 +35,20 @@ class MockTopControlsManagerClient : public TopControlsManagerClient { root_scroll_layer_ = LayerImpl::Create(active_tree_.get(), 1); } - virtual ~MockTopControlsManagerClient() {} + ~MockTopControlsManagerClient() override {} - virtual void DidChangeTopControlsPosition() override { + void DidChangeTopControlsPosition() override { redraw_needed_ = true; update_draw_properties_needed_ = true; } - virtual bool HaveRootScrollLayer() const override { - return true; - } + bool HaveRootScrollLayer() const override { return true; } - virtual void SetControlsTopOffset(float offset) override { + void SetControlsTopOffset(float offset) override { top_controls_top_offset_ = offset; } - virtual float ControlsTopOffset() const override { - return top_controls_top_offset_; - } + float ControlsTopOffset() const override { return top_controls_top_offset_; } LayerImpl* rootScrollLayer() { return root_scroll_layer_.get(); diff --git a/cc/layers/content_layer.h b/cc/layers/content_layer.h index 4b8c346..fe0bd37 100644 --- a/cc/layers/content_layer.h +++ b/cc/layers/content_layer.h @@ -21,7 +21,7 @@ class CC_EXPORT ContentLayerPainter : public LayerPainter { public: static scoped_ptr<ContentLayerPainter> Create(ContentLayerClient* client); - virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override; + void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override; private: explicit ContentLayerPainter(ContentLayerClient* client); @@ -38,33 +38,32 @@ class CC_EXPORT ContentLayer : public TiledLayer { void ClearClient(); - virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override; - virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) - override; - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; - virtual bool NeedMoreUpdates() override; + void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override; + void SetTexturePriorities(const PriorityCalculator& priority_calc) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; + bool NeedMoreUpdates() override; - virtual void SetContentsOpaque(bool contents_opaque) override; + void SetContentsOpaque(bool contents_opaque) override; - virtual bool SupportsLCDText() const override; + bool SupportsLCDText() const override; - virtual skia::RefPtr<SkPicture> GetPicture() const override; + skia::RefPtr<SkPicture> GetPicture() const override; - virtual void OnOutputSurfaceCreated() override; + void OnOutputSurfaceCreated() override; protected: explicit ContentLayer(ContentLayerClient* client); - virtual ~ContentLayer(); + ~ContentLayer() override; - virtual bool HasDrawableContent() const override; + bool HasDrawableContent() const override; // TiledLayer implementation. - virtual LayerUpdater* Updater() const override; + LayerUpdater* Updater() const override; private: // TiledLayer implementation. - virtual void CreateUpdaterIfNeeded() override; + void CreateUpdaterIfNeeded() override; void UpdateCanUseLCDText(); diff --git a/cc/layers/contents_scaling_layer.h b/cc/layers/contents_scaling_layer.h index 3b1f828..15faa00 100644 --- a/cc/layers/contents_scaling_layer.h +++ b/cc/layers/contents_scaling_layer.h @@ -14,17 +14,17 @@ namespace cc { // The content bounds are determined by bounds and scale of the contents. class CC_EXPORT ContentsScalingLayer : public Layer { public: - 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; - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; protected: ContentsScalingLayer(); - virtual ~ContentsScalingLayer(); + ~ContentsScalingLayer() override; gfx::Size ComputeContentBoundsForScale(float scale_x, float scale_y) const; diff --git a/cc/layers/contents_scaling_layer_unittest.cc b/cc/layers/contents_scaling_layer_unittest.cc index 9865079..38385a0 100644 --- a/cc/layers/contents_scaling_layer_unittest.cc +++ b/cc/layers/contents_scaling_layer_unittest.cc @@ -18,7 +18,7 @@ class MockContentsScalingLayer : public ContentsScalingLayer { MockContentsScalingLayer() : ContentsScalingLayer() {} - virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override { + void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override { last_needs_display_rect_ = dirty_rect; ContentsScalingLayer::SetNeedsDisplayRect(dirty_rect); } @@ -28,7 +28,7 @@ class MockContentsScalingLayer : public ContentsScalingLayer { } private: - virtual ~MockContentsScalingLayer() {} + ~MockContentsScalingLayer() override {} gfx::Rect last_needs_display_rect_; }; diff --git a/cc/layers/delegated_frame_provider_unittest.cc b/cc/layers/delegated_frame_provider_unittest.cc index 76af9a1..5ba92bf 100644 --- a/cc/layers/delegated_frame_provider_unittest.cc +++ b/cc/layers/delegated_frame_provider_unittest.cc @@ -69,7 +69,7 @@ class DelegatedFrameProviderTest virtual void TearDown() override { resource_collection_->SetClient(nullptr); } - virtual void UnusedResourcesAreAvailable() override { + void UnusedResourcesAreAvailable() override { resources_available_ = true; resource_collection_->TakeUnusedResourcesForChildCompositor(&resources_); } diff --git a/cc/layers/delegated_frame_resource_collection_unittest.cc b/cc/layers/delegated_frame_resource_collection_unittest.cc index 8ec7169..3e95823 100644 --- a/cc/layers/delegated_frame_resource_collection_unittest.cc +++ b/cc/layers/delegated_frame_resource_collection_unittest.cc @@ -46,7 +46,7 @@ class DelegatedFrameResourceCollectionTest return resources; } - virtual void UnusedResourcesAreAvailable() override { + void UnusedResourcesAreAvailable() override { resources_available_ = true; resource_collection_->TakeUnusedResourcesForChildCompositor( &returned_resources_); diff --git a/cc/layers/delegated_renderer_layer.h b/cc/layers/delegated_renderer_layer.h index 8f31b17..39d2696 100644 --- a/cc/layers/delegated_renderer_layer.h +++ b/cc/layers/delegated_renderer_layer.h @@ -21,22 +21,21 @@ class CC_EXPORT DelegatedRendererLayer : public Layer { static scoped_refptr<DelegatedRendererLayer> Create( const scoped_refptr<DelegatedFrameProvider>& frame_provider); - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void SetLayerTreeHost(LayerTreeHost* host) override; - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; - virtual void PushPropertiesTo(LayerImpl* impl) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void SetLayerTreeHost(LayerTreeHost* host) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; + void PushPropertiesTo(LayerImpl* impl) override; // Called by the DelegatedFrameProvider when a new frame is available to be // picked up. void ProviderHasNewFrame(); - virtual bool HasDelegatedContent() const override; + bool HasDelegatedContent() const override; protected: DelegatedRendererLayer( const scoped_refptr<DelegatedFrameProvider>& frame_provider); - virtual ~DelegatedRendererLayer(); + ~DelegatedRendererLayer() override; private: scoped_refptr<DelegatedFrameProvider> frame_provider_; diff --git a/cc/layers/delegated_renderer_layer_impl.h b/cc/layers/delegated_renderer_layer_impl.h index 53f2f8a..1f84ffb 100644 --- a/cc/layers/delegated_renderer_layer_impl.h +++ b/cc/layers/delegated_renderer_layer_impl.h @@ -21,23 +21,22 @@ class CC_EXPORT DelegatedRendererLayerImpl : public LayerImpl { LayerTreeImpl* tree_impl, int id) { return make_scoped_ptr(new DelegatedRendererLayerImpl(tree_impl, id)); } - virtual ~DelegatedRendererLayerImpl(); + ~DelegatedRendererLayerImpl() override; // LayerImpl overrides. - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual bool HasDelegatedContent() const override; - virtual bool HasContributingDelegatedRenderPasses() const override; - virtual RenderPassId FirstContributingRenderPassId() const override; - virtual RenderPassId NextContributingRenderPassId( + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + bool HasDelegatedContent() const override; + bool HasContributingDelegatedRenderPasses() const override; + RenderPassId FirstContributingRenderPassId() const override; + RenderPassId NextContributingRenderPassId( RenderPassId previous) const override; - virtual void ReleaseResources() override; - virtual bool WillDraw(DrawMode draw_mode, - ResourceProvider* resource_provider) override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; - virtual void PushPropertiesTo(LayerImpl* layer) override; + void ReleaseResources() override; + bool WillDraw(DrawMode draw_mode, + ResourceProvider* resource_provider) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; + void PushPropertiesTo(LayerImpl* layer) override; void AppendContributingRenderPasses(RenderPassSink* render_pass_sink); @@ -85,7 +84,7 @@ class CC_EXPORT DelegatedRendererLayerImpl : public LayerImpl { const gfx::Size& frame_size) const; // LayerImpl overrides. - virtual const char* LayerTypeAsString() const override; + const char* LayerTypeAsString() const override; bool have_render_passes_to_push_; float inverse_device_scale_factor_; diff --git a/cc/layers/heads_up_display_layer.h b/cc/layers/heads_up_display_layer.h index 22dcec8..7ca09925 100644 --- a/cc/layers/heads_up_display_layer.h +++ b/cc/layers/heads_up_display_layer.h @@ -20,16 +20,14 @@ class CC_EXPORT HeadsUpDisplayLayer : public ContentsScalingLayer { void PrepareForCalculateDrawProperties( const gfx::Size& device_viewport, float device_scale_factor); - - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; protected: HeadsUpDisplayLayer(); - virtual bool HasDrawableContent() const override; + bool HasDrawableContent() const override; private: - virtual ~HeadsUpDisplayLayer(); + ~HeadsUpDisplayLayer() override; DISALLOW_COPY_AND_ASSIGN(HeadsUpDisplayLayer); }; diff --git a/cc/layers/heads_up_display_layer_impl.h b/cc/layers/heads_up_display_layer_impl.h index 388dfcd..c826092 100644 --- a/cc/layers/heads_up_display_layer_impl.h +++ b/cc/layers/heads_up_display_layer_impl.h @@ -32,20 +32,19 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { int id) { return make_scoped_ptr(new HeadsUpDisplayLayerImpl(tree_impl, id)); } - virtual ~HeadsUpDisplayLayerImpl(); + ~HeadsUpDisplayLayerImpl() override; - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; - virtual bool WillDraw(DrawMode draw_mode, - ResourceProvider* resource_provider) override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; + bool WillDraw(DrawMode draw_mode, + ResourceProvider* resource_provider) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; void UpdateHudTexture(DrawMode draw_mode, ResourceProvider* resource_provider); - virtual void ReleaseResources() override; + void ReleaseResources() override; bool IsAnimatingHUDContents() const { return fade_step_ > 0; } @@ -70,9 +69,9 @@ class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { HeadsUpDisplayLayerImpl(LayerTreeImpl* tree_impl, int id); - virtual const char* LayerTypeAsString() const override; + const char* LayerTypeAsString() const override; - virtual void AsValueInto(base::debug::TracedValue* dict) const override; + void AsValueInto(base::debug::TracedValue* dict) const override; void UpdateHudContents(); void DrawHudContents(SkCanvas* canvas); diff --git a/cc/layers/heads_up_display_unittest.cc b/cc/layers/heads_up_display_unittest.cc index 37d40a8..312e482 100644 --- a/cc/layers/heads_up_display_unittest.cc +++ b/cc/layers/heads_up_display_unittest.cc @@ -12,7 +12,7 @@ namespace { class HeadsUpDisplayTest : public LayerTreeTest { protected: - virtual void InitializeSettings(LayerTreeSettings* settings) override { + void InitializeSettings(LayerTreeSettings* settings) override { // Enable the HUD without requiring text. settings->initial_debug_state.show_property_changed_rects = true; } @@ -23,11 +23,11 @@ class DrawsContentLayer : public Layer { static scoped_refptr<DrawsContentLayer> Create() { return make_scoped_refptr(new DrawsContentLayer()); } - virtual bool DrawsContent() const override { return true; } + bool DrawsContent() const override { return true; } private: DrawsContentLayer() : Layer() {} - virtual ~DrawsContentLayer() {} + ~DrawsContentLayer() override {} }; class HudWithRootLayerChange : public HeadsUpDisplayTest { @@ -37,14 +37,14 @@ class HudWithRootLayerChange : public HeadsUpDisplayTest { root_layer2_(DrawsContentLayer::Create()), num_commits_(0) {} - virtual void BeginTest() override { + void BeginTest() override { root_layer1_->SetBounds(gfx::Size(30, 30)); root_layer2_->SetBounds(gfx::Size(30, 30)); PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { ++num_commits_; ASSERT_TRUE(layer_tree_host()->hud_layer()); @@ -86,7 +86,7 @@ class HudWithRootLayerChange : public HeadsUpDisplayTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} private: scoped_refptr<DrawsContentLayer> root_layer1_; diff --git a/cc/layers/image_layer.h b/cc/layers/image_layer.h index 53d1f69..ed2a2a3 100644 --- a/cc/layers/image_layer.h +++ b/cc/layers/image_layer.h @@ -19,28 +19,27 @@ class CC_EXPORT ImageLayer : public TiledLayer { static scoped_refptr<ImageLayer> Create(); // Layer implementation. - virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) - override; - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; - virtual void CalculateContentsScale(float ideal_contents_scale, - float* contents_scale_x, - float* contents_scale_y, - gfx::Size* content_bounds) override; - virtual void OnOutputSurfaceCreated() override; + void SetTexturePriorities(const PriorityCalculator& priority_calc) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; + void CalculateContentsScale(float ideal_contents_scale, + float* contents_scale_x, + float* contents_scale_y, + gfx::Size* content_bounds) override; + void OnOutputSurfaceCreated() override; void SetBitmap(const SkBitmap& image); protected: - virtual bool HasDrawableContent() const override; + bool HasDrawableContent() const override; private: ImageLayer(); - virtual ~ImageLayer(); + ~ImageLayer() override; // TiledLayer Implementation. - virtual LayerUpdater* Updater() const override; - virtual void CreateUpdaterIfNeeded() override; + LayerUpdater* Updater() const override; + void CreateUpdaterIfNeeded() override; float ImageContentsScaleX() const; float ImageContentsScaleY() const; diff --git a/cc/layers/io_surface_layer.h b/cc/layers/io_surface_layer.h index 681f1a1..90bcf3e 100644 --- a/cc/layers/io_surface_layer.h +++ b/cc/layers/io_surface_layer.h @@ -16,18 +16,17 @@ class CC_EXPORT IOSurfaceLayer : public Layer { void SetIOSurfaceProperties(uint32_t io_surface_id, const gfx::Size& size); - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; protected: - virtual bool HasDrawableContent() const override; + bool HasDrawableContent() const override; IOSurfaceLayer(); private: - virtual ~IOSurfaceLayer(); + ~IOSurfaceLayer() override; uint32_t io_surface_id_; gfx::Size io_surface_size_; diff --git a/cc/layers/io_surface_layer_impl.h b/cc/layers/io_surface_layer_impl.h index d6b6625..17b7093 100644 --- a/cc/layers/io_surface_layer_impl.h +++ b/cc/layers/io_surface_layer_impl.h @@ -19,28 +19,27 @@ class CC_EXPORT IOSurfaceLayerImpl : public LayerImpl { int id) { return make_scoped_ptr(new IOSurfaceLayerImpl(tree_impl, id)); } - virtual ~IOSurfaceLayerImpl(); + ~IOSurfaceLayerImpl() override; void SetIOSurfaceProperties(unsigned io_surface_id, const gfx::Size& size); - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer_tree_impl) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer_tree_impl) 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; - virtual bool WillDraw(DrawMode draw_mode, - ResourceProvider* resource_provider) override; - virtual void ReleaseResources() override; + bool WillDraw(DrawMode draw_mode, + ResourceProvider* resource_provider) override; + void ReleaseResources() override; private: IOSurfaceLayerImpl(LayerTreeImpl* tree_impl, int id); void DestroyResource(); - virtual const char* LayerTypeAsString() const override; + const char* LayerTypeAsString() const override; unsigned io_surface_id_; gfx::Size io_surface_size_; diff --git a/cc/layers/layer.h b/cc/layers/layer.h index 5af7195..c6279af1 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h @@ -465,7 +465,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, protected: friend class LayerImpl; friend class TreeSynchronizer; - virtual ~Layer(); + ~Layer() override; Layer(); @@ -552,16 +552,15 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, void RemoveChildOrDependent(Layer* child); // LayerAnimationValueProvider implementation. - virtual gfx::ScrollOffset ScrollOffsetForAnimation() const override; + gfx::ScrollOffset ScrollOffsetForAnimation() const override; // LayerAnimationValueObserver implementation. - virtual void OnFilterAnimated(const FilterOperations& filters) override; - virtual void OnOpacityAnimated(float opacity) override; - virtual void OnTransformAnimated(const gfx::Transform& transform) override; - virtual void OnScrollOffsetAnimated( - const gfx::ScrollOffset& scroll_offset) override; - virtual void OnAnimationWaitingForDeletion() override; - virtual bool IsActive() const override; + void OnFilterAnimated(const FilterOperations& filters) override; + void OnOpacityAnimated(float opacity) override; + void OnTransformAnimated(const gfx::Transform& transform) override; + void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override; + void OnAnimationWaitingForDeletion() override; + bool IsActive() const override; // If this layer has a scroll parent, it removes |this| from its list of // scroll children. diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h index 210b392..bcac36c 100644 --- a/cc/layers/layer_impl.h +++ b/cc/layers/layer_impl.h @@ -94,30 +94,28 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver, return make_scoped_ptr(new LayerImpl(tree_impl, id)); } - virtual ~LayerImpl(); + ~LayerImpl() override; int id() const { return layer_id_; } // LayerAnimationValueProvider implementation. - virtual gfx::ScrollOffset ScrollOffsetForAnimation() const override; + gfx::ScrollOffset ScrollOffsetForAnimation() const override; // LayerAnimationValueObserver implementation. - virtual void OnFilterAnimated(const FilterOperations& filters) override; - virtual void OnOpacityAnimated(float opacity) override; - virtual void OnTransformAnimated(const gfx::Transform& transform) override; - virtual void OnScrollOffsetAnimated( - const gfx::ScrollOffset& scroll_offset) override; - virtual void OnAnimationWaitingForDeletion() override; - virtual bool IsActive() const override; + void OnFilterAnimated(const FilterOperations& filters) override; + void OnOpacityAnimated(float opacity) override; + void OnTransformAnimated(const gfx::Transform& transform) override; + void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override; + void OnAnimationWaitingForDeletion() override; + bool IsActive() const override; // AnimationDelegate implementation. - virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override{}; - virtual void NotifyAnimationFinished( - base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override; + void NotifyAnimationStarted(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override{}; + void NotifyAnimationFinished(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override; // Tree structure. LayerImpl* parent() { return parent_; } diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc index 3f5ff5e..8d120be 100644 --- a/cc/layers/layer_impl_unittest.cc +++ b/cc/layers/layer_impl_unittest.cc @@ -497,12 +497,11 @@ TEST_F(LayerImplScrollTest, ScrollByWithNonZeroOffset) { class ScrollDelegateIgnore : public LayerImpl::ScrollOffsetDelegate { public: - virtual void SetTotalScrollOffset( - const gfx::ScrollOffset& new_value) override {} - virtual gfx::ScrollOffset GetTotalScrollOffset() override { + void SetTotalScrollOffset(const gfx::ScrollOffset& new_value) override {} + gfx::ScrollOffset GetTotalScrollOffset() override { return gfx::ScrollOffset(fixed_offset_); } - virtual bool IsExternalFlingActive() const override { return false; } + bool IsExternalFlingActive() const override { return false; } void set_fixed_offset(const gfx::Vector2dF& fixed_offset) { fixed_offset_ = fixed_offset; @@ -547,14 +546,11 @@ TEST_F(LayerImplScrollTest, ScrollByWithIgnoringDelegate) { class ScrollDelegateAccept : public LayerImpl::ScrollOffsetDelegate { public: - virtual void SetTotalScrollOffset( - const gfx::ScrollOffset& new_value) override { + void SetTotalScrollOffset(const gfx::ScrollOffset& new_value) override { current_offset_ = new_value; } - virtual gfx::ScrollOffset GetTotalScrollOffset() override { - return current_offset_; - } - virtual bool IsExternalFlingActive() const override { return false; } + gfx::ScrollOffset GetTotalScrollOffset() override { return current_offset_; } + bool IsExternalFlingActive() const override { return false; } private: gfx::ScrollOffset current_offset_; diff --git a/cc/layers/layer_iterator_unittest.cc b/cc/layers/layer_iterator_unittest.cc index 3aa98d22..cdc1473 100644 --- a/cc/layers/layer_iterator_unittest.cc +++ b/cc/layers/layer_iterator_unittest.cc @@ -31,7 +31,7 @@ class TestLayer : public Layer { int count_representing_contributing_surface_; int count_representing_itself_; - virtual bool DrawsContent() const override { return draws_content_; } + bool DrawsContent() const override { return draws_content_; } void set_draws_content(bool draws_content) { draws_content_ = draws_content; } private: @@ -39,7 +39,7 @@ class TestLayer : public Layer { SetBounds(gfx::Size(100, 100)); SetPosition(gfx::Point()); } - virtual ~TestLayer() {} + ~TestLayer() override {} bool draws_content_; }; diff --git a/cc/layers/layer_perftest.cc b/cc/layers/layer_perftest.cc index c9b8a40..fcd0844 100644 --- a/cc/layers/layer_perftest.cc +++ b/cc/layers/layer_perftest.cc @@ -23,8 +23,7 @@ static const int kTimeCheckInterval = 10; class MockLayerPainter : public LayerPainter { public: - virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override { - } + void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override {} }; diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc index bd832be..ecdd916 100644 --- a/cc/layers/layer_unittest.cc +++ b/cc/layers/layer_unittest.cc @@ -52,8 +52,7 @@ class MockLayerTreeHost : public LayerTreeHost { class MockLayerPainter : public LayerPainter { public: - virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override { - } + void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override {} }; class LayerTest : public testing::Test { @@ -1211,12 +1210,12 @@ class DrawsContentChangeLayer : public Layer { return make_scoped_refptr(new DrawsContentChangeLayer()); } - virtual void SetLayerTreeHost(LayerTreeHost* host) override { + void SetLayerTreeHost(LayerTreeHost* host) override { Layer::SetLayerTreeHost(host); SetFakeDrawsContent(!fake_draws_content_); } - virtual bool HasDrawableContent() const override { + bool HasDrawableContent() const override { return fake_draws_content_ && Layer::HasDrawableContent(); } @@ -1227,7 +1226,7 @@ class DrawsContentChangeLayer : public Layer { private: DrawsContentChangeLayer() : Layer(), fake_draws_content_(false) {} - virtual ~DrawsContentChangeLayer() override {} + ~DrawsContentChangeLayer() override {} bool fake_draws_content_; }; diff --git a/cc/layers/nine_patch_layer.h b/cc/layers/nine_patch_layer.h index c1891bc..f5aa712 100644 --- a/cc/layers/nine_patch_layer.h +++ b/cc/layers/nine_patch_layer.h @@ -21,7 +21,7 @@ class CC_EXPORT NinePatchLayer : public UIResourceLayer { public: static scoped_refptr<NinePatchLayer> Create(); - virtual void PushPropertiesTo(LayerImpl* layer) override; + void PushPropertiesTo(LayerImpl* layer) override; // |border| is the space around the center rectangular region in layer space // (known as aperture in image space). |border.x()| and |border.y()| are the @@ -41,9 +41,8 @@ class CC_EXPORT NinePatchLayer : public UIResourceLayer { private: NinePatchLayer(); - virtual ~NinePatchLayer(); - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + ~NinePatchLayer() override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; gfx::Rect border_; bool fill_center_; diff --git a/cc/layers/nine_patch_layer_impl.h b/cc/layers/nine_patch_layer_impl.h index 0674ecb..9af6f32 100644 --- a/cc/layers/nine_patch_layer_impl.h +++ b/cc/layers/nine_patch_layer_impl.h @@ -27,7 +27,7 @@ class CC_EXPORT NinePatchLayerImpl : public UIResourceLayerImpl { int id) { return make_scoped_ptr(new NinePatchLayerImpl(tree_impl, id)); } - virtual ~NinePatchLayerImpl(); + ~NinePatchLayerImpl() override; // The bitmap stretches out the bounds of the layer. The following picture // illustrates the parameters associated with the dimensions. @@ -57,21 +57,20 @@ class CC_EXPORT NinePatchLayerImpl : public UIResourceLayerImpl { const gfx::Rect& border, bool fill_center); - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) 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; - virtual base::DictionaryValue* LayerTreeAsJson() const override; + base::DictionaryValue* LayerTreeAsJson() const override; protected: NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id); private: - virtual const char* LayerTypeAsString() const override; + const char* LayerTypeAsString() const override; void CheckGeometryLimitations(); diff --git a/cc/layers/painted_scrollbar_layer.h b/cc/layers/painted_scrollbar_layer.h index 8a621e3..950c165 100644 --- a/cc/layers/painted_scrollbar_layer.h +++ b/cc/layers/painted_scrollbar_layer.h @@ -19,37 +19,36 @@ class ScrollbarThemeComposite; class CC_EXPORT PaintedScrollbarLayer : public ScrollbarLayerInterface, public ContentsScalingLayer { public: - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; static scoped_refptr<PaintedScrollbarLayer> Create( scoped_ptr<Scrollbar> scrollbar, int scroll_layer_id); - virtual bool OpacityCanAnimateOnImplThread() const override; - virtual ScrollbarLayerInterface* ToScrollbarLayer() override; + bool OpacityCanAnimateOnImplThread() const override; + ScrollbarLayerInterface* ToScrollbarLayer() override; // ScrollbarLayerInterface - virtual int ScrollLayerId() const override; - virtual void SetScrollLayer(int layer_id) override; - virtual void SetClipLayer(int layer_id) override; + int ScrollLayerId() const override; + void SetScrollLayer(int layer_id) override; + void SetClipLayer(int layer_id) override; - virtual ScrollbarOrientation orientation() const override; + ScrollbarOrientation orientation() const override; // Layer interface - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; - virtual void SetLayerTreeHost(LayerTreeHost* host) override; - virtual void PushPropertiesTo(LayerImpl* layer) override; - virtual void PushScrollClipPropertiesTo(LayerImpl* layer) override; - virtual void CalculateContentsScale(float ideal_contents_scale, - float* contents_scale_x, - float* contents_scale_y, - gfx::Size* content_bounds) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; + void SetLayerTreeHost(LayerTreeHost* host) override; + void PushPropertiesTo(LayerImpl* layer) override; + void PushScrollClipPropertiesTo(LayerImpl* layer) override; + void CalculateContentsScale(float ideal_contents_scale, + float* contents_scale_x, + float* contents_scale_y, + gfx::Size* content_bounds) override; protected: PaintedScrollbarLayer(scoped_ptr<Scrollbar> scrollbar, int scroll_layer_id); - virtual ~PaintedScrollbarLayer(); + ~PaintedScrollbarLayer() override; // For unit tests UIResourceId track_resource_id() { diff --git a/cc/layers/painted_scrollbar_layer_impl.h b/cc/layers/painted_scrollbar_layer_impl.h index 1c67e73..d54de6b 100644 --- a/cc/layers/painted_scrollbar_layer_impl.h +++ b/cc/layers/painted_scrollbar_layer_impl.h @@ -21,18 +21,17 @@ class CC_EXPORT PaintedScrollbarLayerImpl : public ScrollbarLayerImplBase { LayerTreeImpl* tree_impl, int id, ScrollbarOrientation orientation); - virtual ~PaintedScrollbarLayerImpl(); + ~PaintedScrollbarLayerImpl() override; // LayerImpl implementation. - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) override; - virtual bool WillDraw(DrawMode draw_mode, - ResourceProvider* resource_provider) override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; + bool WillDraw(DrawMode draw_mode, + ResourceProvider* resource_provider) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; void SetThumbThickness(int thumb_thickness); void SetThumbLength(int thumb_length); @@ -52,14 +51,14 @@ class CC_EXPORT PaintedScrollbarLayerImpl : public ScrollbarLayerImplBase { ScrollbarOrientation orientation); // ScrollbarLayerImplBase implementation. - virtual int ThumbThickness() const override; - virtual int ThumbLength() const override; - virtual float TrackLength() const override; - virtual int TrackStart() const override; - virtual bool IsThumbResizable() const override; + int ThumbThickness() const override; + int ThumbLength() const override; + float TrackLength() const override; + int TrackStart() const override; + bool IsThumbResizable() const override; private: - virtual const char* LayerTypeAsString() const override; + const char* LayerTypeAsString() const override; UIResourceId track_ui_resource_id_; UIResourceId thumb_ui_resource_id_; diff --git a/cc/layers/picture_image_layer.h b/cc/layers/picture_image_layer.h index 6f73b42..3467804 100644 --- a/cc/layers/picture_image_layer.h +++ b/cc/layers/picture_image_layer.h @@ -20,23 +20,22 @@ class CC_EXPORT PictureImageLayer : public PictureLayer, ContentLayerClient { void SetBitmap(const SkBitmap& image); // Layer implementation. - virtual scoped_ptr<LayerImpl> CreateLayerImpl( - LayerTreeImpl* tree_impl) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; // ContentLayerClient implementation. - virtual void PaintContents( + void PaintContents( SkCanvas* canvas, const gfx::Rect& clip, ContentLayerClient::GraphicsContextStatus gc_status) override; - virtual void DidChangeLayerCanUseLCDText() override {} - virtual bool FillsBoundsCompletely() const override; + void DidChangeLayerCanUseLCDText() override {} + bool FillsBoundsCompletely() const override; protected: - virtual bool HasDrawableContent() const override; + bool HasDrawableContent() const override; private: PictureImageLayer(); - virtual ~PictureImageLayer(); + ~PictureImageLayer() override; SkBitmap bitmap_; diff --git a/cc/layers/picture_image_layer_impl.h b/cc/layers/picture_image_layer_impl.h index db36a13..7a363a1 100644 --- a/cc/layers/picture_image_layer_impl.h +++ b/cc/layers/picture_image_layer_impl.h @@ -15,22 +15,20 @@ class CC_EXPORT PictureImageLayerImpl : public PictureLayerImpl { int id) { return make_scoped_ptr(new PictureImageLayerImpl(tree_impl, id)); } - virtual ~PictureImageLayerImpl(); + ~PictureImageLayerImpl() override; // LayerImpl overrides. - virtual const char* LayerTypeAsString() const override; - virtual scoped_ptr<LayerImpl> CreateLayerImpl( - LayerTreeImpl* tree_impl) override; + const char* LayerTypeAsString() const override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; protected: PictureImageLayerImpl(LayerTreeImpl* tree_impl, int id); - virtual bool ShouldAdjustRasterScale() const override; - virtual void RecalculateRasterScales() override; - virtual void GetDebugBorderProperties( - SkColor* color, float* width) const override; + bool ShouldAdjustRasterScale() const override; + void RecalculateRasterScales() override; + void GetDebugBorderProperties(SkColor* color, float* width) const override; - virtual void UpdateIdealScales() override; + void UpdateIdealScales() override; private: DISALLOW_COPY_AND_ASSIGN(PictureImageLayerImpl); diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h index 2108fbe..0ba26e6 100644 --- a/cc/layers/picture_layer.h +++ b/cc/layers/picture_layer.h @@ -24,19 +24,18 @@ class CC_EXPORT PictureLayer : public Layer { void ClearClient(); // Layer interface. - virtual scoped_ptr<LayerImpl> CreateLayerImpl( - LayerTreeImpl* tree_impl) override; - virtual void SetLayerTreeHost(LayerTreeHost* host) override; - virtual void PushPropertiesTo(LayerImpl* layer) override; - virtual void SetNeedsDisplayRect(const gfx::Rect& layer_rect) override; - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; - virtual void SetIsMask(bool is_mask) override; - virtual bool SupportsLCDText() const override; - virtual skia::RefPtr<SkPicture> GetPicture() const override; - virtual bool IsSuitableForGpuRasterization() const override; - - virtual void RunMicroBenchmark(MicroBenchmark* benchmark) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void SetLayerTreeHost(LayerTreeHost* host) override; + void PushPropertiesTo(LayerImpl* layer) override; + void SetNeedsDisplayRect(const gfx::Rect& layer_rect) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; + void SetIsMask(bool is_mask) override; + bool SupportsLCDText() const override; + skia::RefPtr<SkPicture> GetPicture() const override; + bool IsSuitableForGpuRasterization() const override; + + void RunMicroBenchmark(MicroBenchmark* benchmark) override; ContentLayerClient* client() { return client_; } @@ -44,9 +43,9 @@ class CC_EXPORT PictureLayer : public Layer { protected: explicit PictureLayer(ContentLayerClient* client); - virtual ~PictureLayer(); + ~PictureLayer() override; - virtual bool HasDrawableContent() const override; + bool HasDrawableContent() const override; void UpdateCanUseLCDText(); private: diff --git a/cc/layers/picture_layer_impl.h b/cc/layers/picture_layer_impl.h index 967b930..1ac106a 100644 --- a/cc/layers/picture_layer_impl.h +++ b/cc/layers/picture_layer_impl.h @@ -99,52 +99,49 @@ class CC_EXPORT PictureLayerImpl static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, int id) { return make_scoped_ptr(new PictureLayerImpl(tree_impl, id)); } - virtual ~PictureLayerImpl(); + ~PictureLayerImpl() override; // LayerImpl overrides. - virtual const char* LayerTypeAsString() const override; - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; - virtual void UpdateTiles(const Occlusion& occlusion_in_content_space, - bool resourceless_software_draw) override; - virtual void NotifyTileStateChanged(const Tile* tile) override; - virtual void DidBecomeActive() override; - virtual void DidBeginTracing() override; - virtual void ReleaseResources() override; - virtual skia::RefPtr<SkPicture> GetPicture() override; + const char* LayerTypeAsString() const override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; + void UpdateTiles(const Occlusion& occlusion_in_content_space, + bool resourceless_software_draw) override; + void NotifyTileStateChanged(const Tile* tile) override; + void DidBecomeActive() override; + void DidBeginTracing() override; + void ReleaseResources() override; + skia::RefPtr<SkPicture> GetPicture() override; // PictureLayerTilingClient overrides. - virtual scoped_refptr<Tile> CreateTile( - PictureLayerTiling* tiling, - const gfx::Rect& content_rect) override; - virtual PicturePileImpl* GetPile() override; - virtual gfx::Size CalculateTileSize( - const gfx::Size& content_bounds) const override; - virtual const Region* GetInvalidation() override; - virtual const PictureLayerTiling* GetTwinTiling( + scoped_refptr<Tile> CreateTile(PictureLayerTiling* tiling, + const gfx::Rect& content_rect) override; + PicturePileImpl* GetPile() override; + gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; + const Region* GetInvalidation() override; + const PictureLayerTiling* GetTwinTiling( const PictureLayerTiling* tiling) const override; - virtual PictureLayerTiling* GetRecycledTwinTiling( + PictureLayerTiling* GetRecycledTwinTiling( const PictureLayerTiling* tiling) override; - virtual size_t GetMaxTilesForInterestArea() const override; - virtual float GetSkewportTargetTimeInSeconds() const override; - virtual int GetSkewportExtrapolationLimitInContentPixels() const override; - virtual WhichTree GetTree() const override; - virtual bool RequiresHighResToDraw() const override; + size_t GetMaxTilesForInterestArea() const override; + float GetSkewportTargetTimeInSeconds() const override; + int GetSkewportExtrapolationLimitInContentPixels() const override; + WhichTree GetTree() const override; + bool RequiresHighResToDraw() const override; // PushPropertiesTo active tree => pending tree. void SyncTiling(const PictureLayerTiling* tiling); // Mask-related functions. - 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; - virtual size_t GPUMemoryUsageInBytes() const override; + size_t GPUMemoryUsageInBytes() const override; - virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; + void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; // Functions used by tile manager. PictureLayerImpl* GetTwinLayer() { return twin_layer_; } @@ -185,11 +182,9 @@ class CC_EXPORT PictureLayerImpl bool ShouldAdjustRasterScaleDuringScaleAnimations() const; - virtual void GetDebugBorderProperties( - SkColor* color, float* width) const override; - virtual void GetAllTilesForTracing( - std::set<const Tile*>* tiles) const override; - virtual void AsValueInto(base::debug::TracedValue* dict) const override; + void GetDebugBorderProperties(SkColor* color, float* width) const override; + void GetAllTilesForTracing(std::set<const Tile*>* tiles) const override; + void AsValueInto(base::debug::TracedValue* dict) const override; virtual void UpdateIdealScales(); float MaximumTilingContentsScale() const; diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index 9b767ce..73906af 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc @@ -38,7 +38,7 @@ class MockCanvas : public SkCanvas { public: explicit MockCanvas(int w, int h) : SkCanvas(w, h) {} - virtual void drawRect(const SkRect& rect, const SkPaint& paint) override { + void drawRect(const SkRect& rect, const SkPaint& paint) override { // Capture calls before SkCanvas quickReject() kicks in. rects_.push_back(rect); } @@ -2322,7 +2322,7 @@ TEST_F(PictureLayerImplTest, PinchingTooSmall) { class DeferredInitPictureLayerImplTest : public PictureLayerImplTest { public: - virtual void InitializeRenderer() override { + void InitializeRenderer() override { bool delegated_rendering = false; host_impl_.InitializeRenderer(FakeOutputSurface::CreateDeferredGL( scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice), @@ -3643,7 +3643,7 @@ class PictureLayerImplTestWithDelegatingRenderer : public PictureLayerImplTest { public: PictureLayerImplTestWithDelegatingRenderer() : PictureLayerImplTest() {} - virtual void InitializeRenderer() override { + void InitializeRenderer() override { host_impl_.InitializeRenderer(FakeOutputSurface::CreateDelegating3d()); } }; diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc index 265d4cf..78182d9 100644 --- a/cc/layers/picture_layer_unittest.cc +++ b/cc/layers/picture_layer_unittest.cc @@ -20,14 +20,12 @@ namespace { class MockContentLayerClient : public ContentLayerClient { public: - virtual void PaintContents( + 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; }; }; TEST(PictureLayerTest, NoTilesIfEmptyBounds) { diff --git a/cc/layers/render_surface_unittest.cc b/cc/layers/render_surface_unittest.cc index b57152a..68398fe 100644 --- a/cc/layers/render_surface_unittest.cc +++ b/cc/layers/render_surface_unittest.cc @@ -135,7 +135,7 @@ TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectSharedQuadState) { class TestRenderPassSink : public RenderPassSink { public: - virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override { + void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override { render_passes_.push_back(render_pass.Pass()); } diff --git a/cc/layers/scrollbar_layer_impl_base.h b/cc/layers/scrollbar_layer_impl_base.h index 85dc643..4a96b49 100644 --- a/cc/layers/scrollbar_layer_impl_base.h +++ b/cc/layers/scrollbar_layer_impl_base.h @@ -46,8 +46,8 @@ class CC_EXPORT ScrollbarLayerImplBase : public LayerImpl { bool CanScrollOrientation() const; - virtual void PushPropertiesTo(LayerImpl* layer) override; - virtual ScrollbarLayerImplBase* ToScrollbarLayer() override; + void PushPropertiesTo(LayerImpl* layer) override; + ScrollbarLayerImplBase* ToScrollbarLayer() override; void PushScrollClipPropertiesTo(LayerImpl* layer); bool SetVisibleToTotalLengthRatio(float ratio); @@ -66,7 +66,7 @@ class CC_EXPORT ScrollbarLayerImplBase : public LayerImpl { ScrollbarOrientation orientation, bool is_left_side_vertical_scrollbar, bool is_overlay); - virtual ~ScrollbarLayerImplBase(); + ~ScrollbarLayerImplBase() override; gfx::Rect ScrollbarLayerRectToContentRect(const gfx::RectF& layer_rect) const; diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc index fdffcfa..25fa708 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -568,7 +568,7 @@ class ScrollbarLayerTestMaxTextureSize : public LayerTreeTest { void SetScrollbarBounds(const gfx::Size& bounds) { bounds_ = bounds; } - virtual void BeginTest() override { + void BeginTest() override { scroll_layer_ = Layer::Create(); layer_tree_host()->root_layer()->AddChild(scroll_layer_); @@ -583,7 +583,7 @@ class ScrollbarLayerTestMaxTextureSize : public LayerTreeTest { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { const int kMaxTextureSize = layer_tree_host()->GetRendererCapabilities().max_texture_size; @@ -598,7 +598,7 @@ class ScrollbarLayerTestMaxTextureSize : public LayerTreeTest { EndTest(); } - virtual void AfterTest() override {} + void AfterTest() override {} private: scoped_refptr<PaintedScrollbarLayer> scrollbar_layer_; @@ -635,7 +635,7 @@ class FakeLayerTreeHost : public LayerTreeHost { InitializeSingleThreaded(client, base::MessageLoopProxy::current()); } - virtual UIResourceId CreateUIResource(UIResourceClient* content) override { + UIResourceId CreateUIResource(UIResourceClient* content) override { total_ui_resource_created_++; UIResourceId nid = next_id_++; ui_resource_bitmap_map_.insert( @@ -644,7 +644,7 @@ class FakeLayerTreeHost : public LayerTreeHost { } // Deletes a UI resource. May safely be called more than once. - virtual void DeleteUIResource(UIResourceId id) override { + void DeleteUIResource(UIResourceId id) override { UIResourceBitmapMap::iterator iter = ui_resource_bitmap_map_.find(id); if (iter != ui_resource_bitmap_map_.end()) { ui_resource_bitmap_map_.erase(iter); diff --git a/cc/layers/solid_color_layer.h b/cc/layers/solid_color_layer.h index 987c005..8dc9860 100644 --- a/cc/layers/solid_color_layer.h +++ b/cc/layers/solid_color_layer.h @@ -17,16 +17,15 @@ class CC_EXPORT SolidColorLayer : public Layer { public: static scoped_refptr<SolidColorLayer> Create(); - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; - virtual void SetBackgroundColor(SkColor color) override; + void SetBackgroundColor(SkColor color) override; protected: SolidColorLayer(); private: - virtual ~SolidColorLayer(); + ~SolidColorLayer() override; DISALLOW_COPY_AND_ASSIGN(SolidColorLayer); }; diff --git a/cc/layers/solid_color_layer_impl.h b/cc/layers/solid_color_layer_impl.h index 0116479..34a3819 100644 --- a/cc/layers/solid_color_layer_impl.h +++ b/cc/layers/solid_color_layer_impl.h @@ -25,20 +25,19 @@ class CC_EXPORT SolidColorLayerImpl : public LayerImpl { SkColor color, AppendQuadsData* append_quads_data); - virtual ~SolidColorLayerImpl(); + ~SolidColorLayerImpl() override; // LayerImpl overrides. - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; protected: SolidColorLayerImpl(LayerTreeImpl* tree_impl, int id); private: - virtual const char* LayerTypeAsString() const override; + const char* LayerTypeAsString() const override; DISALLOW_COPY_AND_ASSIGN(SolidColorLayerImpl); }; diff --git a/cc/layers/solid_color_scrollbar_layer.h b/cc/layers/solid_color_scrollbar_layer.h index 0e48173..fc6306e 100644 --- a/cc/layers/solid_color_scrollbar_layer.h +++ b/cc/layers/solid_color_scrollbar_layer.h @@ -14,8 +14,7 @@ namespace cc { class CC_EXPORT SolidColorScrollbarLayer : public ScrollbarLayerInterface, public Layer { public: - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; static scoped_refptr<SolidColorScrollbarLayer> Create( ScrollbarOrientation orientation, @@ -25,20 +24,20 @@ class CC_EXPORT SolidColorScrollbarLayer : public ScrollbarLayerInterface, int scroll_layer_id); // Layer overrides. - virtual bool OpacityCanAnimateOnImplThread() const override; - virtual ScrollbarLayerInterface* ToScrollbarLayer() override; + bool OpacityCanAnimateOnImplThread() const override; + ScrollbarLayerInterface* ToScrollbarLayer() override; - virtual void PushPropertiesTo(LayerImpl* layer) override; - virtual void PushScrollClipPropertiesTo(LayerImpl* layer) override; + void PushPropertiesTo(LayerImpl* layer) override; + void PushScrollClipPropertiesTo(LayerImpl* layer) override; - virtual void SetNeedsDisplayRect(const gfx::Rect& rect) override; + void SetNeedsDisplayRect(const gfx::Rect& rect) override; // ScrollbarLayerInterface - virtual int ScrollLayerId() const override; - virtual void SetScrollLayer(int layer_id) override; - virtual void SetClipLayer(int layer_id) override; + int ScrollLayerId() const override; + void SetScrollLayer(int layer_id) override; + void SetClipLayer(int layer_id) override; - virtual ScrollbarOrientation orientation() const override; + ScrollbarOrientation orientation() const override; protected: SolidColorScrollbarLayer(ScrollbarOrientation orientation, @@ -46,7 +45,7 @@ class CC_EXPORT SolidColorScrollbarLayer : public ScrollbarLayerInterface, int track_start, bool is_left_side_vertical_scrollbar, int scroll_layer_id); - virtual ~SolidColorScrollbarLayer(); + ~SolidColorScrollbarLayer() override; private: int scroll_layer_id_; diff --git a/cc/layers/solid_color_scrollbar_layer_impl.h b/cc/layers/solid_color_scrollbar_layer_impl.h index 32695d0..1abf552 100644 --- a/cc/layers/solid_color_scrollbar_layer_impl.h +++ b/cc/layers/solid_color_scrollbar_layer_impl.h @@ -20,16 +20,15 @@ class CC_EXPORT SolidColorScrollbarLayerImpl : public ScrollbarLayerImplBase { int track_start, bool is_left_side_vertical_scrollbar, bool is_overlay); - virtual ~SolidColorScrollbarLayerImpl(); + ~SolidColorScrollbarLayerImpl() override; // LayerImpl overrides. - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) 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; protected: SolidColorScrollbarLayerImpl(LayerTreeImpl* tree_impl, @@ -41,11 +40,11 @@ class CC_EXPORT SolidColorScrollbarLayerImpl : public ScrollbarLayerImplBase { bool is_overlay); // ScrollbarLayerImplBase implementation. - virtual int ThumbThickness() const override; - virtual int ThumbLength() const override; - virtual float TrackLength() const override; - virtual int TrackStart() const override; - virtual bool IsThumbResizable() const override; + int ThumbThickness() const override; + int ThumbLength() const override; + float TrackLength() const override; + int TrackStart() const override; + bool IsThumbResizable() const override; private: int thumb_thickness_; diff --git a/cc/layers/surface_layer.h b/cc/layers/surface_layer.h index eace365..0b886eb 100644 --- a/cc/layers/surface_layer.h +++ b/cc/layers/surface_layer.h @@ -20,16 +20,15 @@ class CC_EXPORT SurfaceLayer : public Layer { void SetSurfaceId(SurfaceId surface_id); // Layer overrides. - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) override; protected: SurfaceLayer(); - virtual bool HasDrawableContent() const override; + bool HasDrawableContent() const override; private: - virtual ~SurfaceLayer(); + ~SurfaceLayer() override; SurfaceId surface_id_; diff --git a/cc/layers/surface_layer_impl.h b/cc/layers/surface_layer_impl.h index 5353a21..9ef3c6d 100644 --- a/cc/layers/surface_layer_impl.h +++ b/cc/layers/surface_layer_impl.h @@ -17,26 +17,24 @@ class CC_EXPORT SurfaceLayerImpl : public LayerImpl { static scoped_ptr<SurfaceLayerImpl> Create(LayerTreeImpl* tree_impl, int id) { return make_scoped_ptr(new SurfaceLayerImpl(tree_impl, id)); } - virtual ~SurfaceLayerImpl(); + ~SurfaceLayerImpl() override; void SetSurfaceId(SurfaceId surface_id); // LayerImpl overrides. - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; protected: SurfaceLayerImpl(LayerTreeImpl* tree_impl, int id); private: - virtual void GetDebugBorderProperties(SkColor* color, - float* width) const override; - virtual void AsValueInto(base::debug::TracedValue* dict) const override; - virtual const char* LayerTypeAsString() const override; + void GetDebugBorderProperties(SkColor* color, float* width) const override; + void AsValueInto(base::debug::TracedValue* dict) const override; + const char* LayerTypeAsString() const override; SurfaceId surface_id_; diff --git a/cc/layers/texture_layer.h b/cc/layers/texture_layer.h index 61791ac..fa52a8c 100644 --- a/cc/layers/texture_layer.h +++ b/cc/layers/texture_layer.h @@ -94,8 +94,7 @@ class CC_EXPORT TextureLayer : public Layer { // Resets the texture. void ClearTexture(); - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; // Sets whether this texture should be Y-flipped at draw time. Defaults to // true. @@ -134,18 +133,18 @@ class CC_EXPORT TextureLayer : public Layer { // TODO(danakj): Remove this when pepper doesn't need it. crbug.com/350204 void SetTextureMailboxWithoutReleaseCallback(const TextureMailbox& mailbox); - virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override; + void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override; - virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override; - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; - virtual void PushPropertiesTo(LayerImpl* layer) override; - virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; + void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; + void PushPropertiesTo(LayerImpl* layer) override; + SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; protected: explicit TextureLayer(TextureLayerClient* client); - virtual ~TextureLayer(); - virtual bool HasDrawableContent() const override; + ~TextureLayer() override; + bool HasDrawableContent() const override; private: void SetTextureMailboxInternal( diff --git a/cc/layers/texture_layer_impl.h b/cc/layers/texture_layer_impl.h index bbf0817..6d38ae1 100644 --- a/cc/layers/texture_layer_impl.h +++ b/cc/layers/texture_layer_impl.h @@ -20,19 +20,19 @@ class CC_EXPORT TextureLayerImpl : public LayerImpl { static scoped_ptr<TextureLayerImpl> Create(LayerTreeImpl* tree_impl, int id) { return make_scoped_ptr(new TextureLayerImpl(tree_impl, id)); } - virtual ~TextureLayerImpl(); + ~TextureLayerImpl() override; - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* layer_tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; + scoped_ptr<LayerImpl> CreateLayerImpl( + LayerTreeImpl* layer_tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) override; - virtual bool WillDraw(DrawMode draw_mode, - ResourceProvider* resource_provider) override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; - virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; - virtual void ReleaseResources() override; + bool WillDraw(DrawMode draw_mode, + ResourceProvider* resource_provider) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; + SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; + void ReleaseResources() override; // These setter methods don't cause any implicit damage, so the texture client // must explicitly invalidate if they intend to cause a visible change in the @@ -56,7 +56,7 @@ class CC_EXPORT TextureLayerImpl : public LayerImpl { private: TextureLayerImpl(LayerTreeImpl* tree_impl, int id); - virtual const char* LayerTypeAsString() const override; + const char* LayerTypeAsString() const override; void FreeTextureMailbox(); ResourceProvider::ResourceId external_texture_resource_; diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc index 99c1e9e..d355b62 100644 --- a/cc/layers/texture_layer_unittest.cc +++ b/cc/layers/texture_layer_unittest.cc @@ -65,7 +65,7 @@ class FakeTextureLayerClient : public TextureLayerClient { public: FakeTextureLayerClient() : mailbox_changed_(true) {} - virtual bool PrepareTextureMailbox( + bool PrepareTextureMailbox( TextureMailbox* mailbox, scoped_ptr<SingleReleaseCallback>* release_callback, bool use_shared_memory) override { @@ -293,7 +293,7 @@ class TestMailboxHolder : public TextureLayer::TextureMailboxHolder { using TextureLayer::TextureMailboxHolder::Create; protected: - virtual ~TestMailboxHolder() {} + ~TestMailboxHolder() override {} }; class TextureLayerWithMailboxTest : public TextureLayerTest { @@ -726,7 +726,7 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { callback.Pass()); } - virtual void BeginTest() override { + void BeginTest() override { EXPECT_EQ(true, main_thread_.CalledOnValidThread()); gfx::Size bounds(100, 100); @@ -750,7 +750,7 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() override { + void DidCommit() override { ++commit_count_; switch (commit_count_) { case 1: @@ -820,7 +820,7 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { } } - virtual void AfterTest() override {} + void AfterTest() override {} private: base::ThreadChecker main_thread_; @@ -849,7 +849,7 @@ class TextureLayerMailboxIsActivatedDuringCommit : public LayerTreeTest { callback.Pass()); } - virtual void BeginTest() override { + void BeginTest() override { gfx::Size bounds(100, 100); root_ = Layer::Create(); root_->SetBounds(bounds); @@ -866,11 +866,11 @@ class TextureLayerMailboxIsActivatedDuringCommit : public LayerTreeTest { 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 mailbox has been activated. Set a new mailbox, and @@ -889,7 +889,7 @@ class TextureLayerMailboxIsActivatedDuringCommit : public LayerTreeTest { } } - 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 mailbox should have happened before now. @@ -913,8 +913,7 @@ class TextureLayerMailboxIsActivatedDuringCommit : public LayerTreeTest { } } - - virtual void AfterTest() override {} + void AfterTest() override {} int activate_count_; scoped_refptr<Layer> root_; @@ -1129,7 +1128,7 @@ class TextureLayerNoExtraCommitForMailboxTest public TextureLayerClient { public: // TextureLayerClient implementation. - virtual bool PrepareTextureMailbox( + bool PrepareTextureMailbox( TextureMailbox* texture_mailbox, scoped_ptr<SingleReleaseCallback>* release_callback, bool use_shared_memory) override { @@ -1153,7 +1152,7 @@ class TextureLayerNoExtraCommitForMailboxTest EndTest(); } - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<Layer> root = Layer::Create(); root->SetBounds(gfx::Size(10, 10)); root->SetIsDrawable(true); @@ -1167,11 +1166,9 @@ class TextureLayerNoExtraCommitForMailboxTest LayerTreeTest::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: EXPECT_FALSE(proxy()->MainFrameWillHappenForTesting()); @@ -1187,8 +1184,7 @@ class TextureLayerNoExtraCommitForMailboxTest } } - 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(); @@ -1205,7 +1201,7 @@ class TextureLayerNoExtraCommitForMailboxTest host_impl->ReclaimResources(&ack); } - virtual void AfterTest() override {} + void AfterTest() override {} private: scoped_refptr<TextureLayer> texture_layer_; @@ -1229,7 +1225,7 @@ class TextureLayerChangeInvisibleMailboxTest } // TextureLayerClient implementation. - virtual bool PrepareTextureMailbox( + bool PrepareTextureMailbox( TextureMailbox* mailbox, scoped_ptr<SingleReleaseCallback>* release_callback, bool use_shared_memory) override { @@ -1251,7 +1247,7 @@ class TextureLayerChangeInvisibleMailboxTest ++mailbox_returned_; } - virtual void SetupTree() override { + void SetupTree() override { scoped_refptr<Layer> root = Layer::Create(); root->SetBounds(gfx::Size(10, 10)); root->SetIsDrawable(true); @@ -1276,11 +1272,9 @@ class TextureLayerChangeInvisibleMailboxTest LayerTreeTest::SetupTree(); } - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { ++commit_count_; switch (commit_count_) { case 1: @@ -1324,8 +1318,7 @@ class TextureLayerChangeInvisibleMailboxTest } } - 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(); @@ -1342,7 +1335,7 @@ class TextureLayerChangeInvisibleMailboxTest host_impl->ReclaimResources(&ack); } - virtual void AfterTest() override {} + void AfterTest() override {} private: scoped_refptr<SolidColorLayer> solid_layer_; @@ -1366,7 +1359,7 @@ class TextureLayerReleaseResourcesBase public TextureLayerClient { public: // TextureLayerClient implementation. - virtual bool PrepareTextureMailbox( + bool PrepareTextureMailbox( TextureMailbox* mailbox, scoped_ptr<SingleReleaseCallback>* release_callback, bool use_shared_memory) override { @@ -1381,7 +1374,7 @@ class TextureLayerReleaseResourcesBase mailbox_released_ = true; } - virtual void SetupTree() override { + void SetupTree() override { LayerTreeTest::SetupTree(); scoped_refptr<TextureLayer> texture_layer = @@ -1392,18 +1385,14 @@ class TextureLayerReleaseResourcesBase layer_tree_host()->root_layer()->AddChild(texture_layer); } - virtual void BeginTest() override { + void BeginTest() override { mailbox_released_ = false; PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { - EndTest(); - } + void DidCommitAndDrawFrame() override { EndTest(); } - virtual void AfterTest() override { - EXPECT_TRUE(mailbox_released_); - } + void AfterTest() override { EXPECT_TRUE(mailbox_released_); } private: bool mailbox_released_; @@ -1412,7 +1401,7 @@ class TextureLayerReleaseResourcesBase class TextureLayerReleaseResourcesAfterCommit : public TextureLayerReleaseResourcesBase { public: - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { LayerTreeImpl* tree = nullptr; if (host_impl->settings().impl_side_painting) tree = host_impl->pending_tree(); @@ -1427,7 +1416,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerReleaseResourcesAfterCommit); class TextureLayerReleaseResourcesAfterActivate : public TextureLayerReleaseResourcesBase { public: - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { + void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { host_impl->active_tree()->root_layer()->children()[0]->ReleaseResources(); } }; @@ -1454,7 +1443,7 @@ class TextureLayerWithMailboxMainThreadDeleted : public LayerTreeTest { callback.Pass()); } - virtual void SetupTree() override { + void SetupTree() override { gfx::Size bounds(100, 100); root_ = Layer::Create(); root_->SetBounds(bounds); @@ -1468,7 +1457,7 @@ class TextureLayerWithMailboxMainThreadDeleted : public LayerTreeTest { layer_tree_host()->SetViewportSize(bounds); } - virtual void BeginTest() override { + void BeginTest() override { EXPECT_EQ(true, main_thread_.CalledOnValidThread()); callback_count_ = 0; @@ -1480,7 +1469,7 @@ class TextureLayerWithMailboxMainThreadDeleted : public LayerTreeTest { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: // Delete the TextureLayer on the main thread while the mailbox is in @@ -1491,9 +1480,7 @@ class TextureLayerWithMailboxMainThreadDeleted : public LayerTreeTest { } } - virtual void AfterTest() override { - EXPECT_EQ(1, callback_count_); - } + void AfterTest() override { EXPECT_EQ(1, callback_count_); } private: base::ThreadChecker main_thread_; @@ -1525,7 +1512,7 @@ class TextureLayerWithMailboxImplThreadDeleted : public LayerTreeTest { callback.Pass()); } - virtual void SetupTree() override { + void SetupTree() override { gfx::Size bounds(100, 100); root_ = Layer::Create(); root_->SetBounds(bounds); @@ -1539,7 +1526,7 @@ class TextureLayerWithMailboxImplThreadDeleted : public LayerTreeTest { layer_tree_host()->SetViewportSize(bounds); } - virtual void BeginTest() override { + void BeginTest() override { EXPECT_EQ(true, main_thread_.CalledOnValidThread()); callback_count_ = 0; @@ -1551,7 +1538,7 @@ class TextureLayerWithMailboxImplThreadDeleted : public LayerTreeTest { PostSetNeedsCommitToMainThread(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: // Remove the TextureLayer on the main thread while the mailbox is in @@ -1565,9 +1552,7 @@ class TextureLayerWithMailboxImplThreadDeleted : public LayerTreeTest { } } - virtual void AfterTest() override { - EXPECT_EQ(1, callback_count_); - } + void AfterTest() override { EXPECT_EQ(1, callback_count_); } private: base::ThreadChecker main_thread_; diff --git a/cc/layers/tiled_layer.h b/cc/layers/tiled_layer.h index 8a765d0..d48ebe4 100644 --- a/cc/layers/tiled_layer.h +++ b/cc/layers/tiled_layer.h @@ -25,21 +25,20 @@ class CC_EXPORT TiledLayer : public ContentsScalingLayer { }; // Layer implementation. - virtual void SetIsMask(bool is_mask) override; - virtual void PushPropertiesTo(LayerImpl* layer) override; - virtual void ReduceMemoryUsage() override; - virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override; - virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override; - virtual void SetTexturePriorities(const PriorityCalculator& priority_calc) - override; - virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; - virtual void OnOutputSurfaceCreated() override; + void SetIsMask(bool is_mask) override; + void PushPropertiesTo(LayerImpl* layer) override; + void ReduceMemoryUsage() override; + void SetNeedsDisplayRect(const gfx::Rect& dirty_rect) override; + void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override; + void SetTexturePriorities(const PriorityCalculator& priority_calc) override; + SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; + void OnOutputSurfaceCreated() override; protected: TiledLayer(); - virtual ~TiledLayer(); + ~TiledLayer() override; void UpdateTileSizeAndTilingOption(); void UpdateBounds(); @@ -67,7 +66,7 @@ class CC_EXPORT TiledLayer : public ContentsScalingLayer { bool SkipsDraw() const { return skips_draw_; } - virtual bool HasDrawableContent() const override; + bool HasDrawableContent() const override; // Virtual for testing virtual PrioritizedResourceManager* ResourceManager(); @@ -75,8 +74,7 @@ class CC_EXPORT TiledLayer : public ContentsScalingLayer { const PrioritizedResource* ResourceAtForTesting(int i, int j) const; private: - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; void CreateTilerIfNeeded(); void set_tiling_option(TilingOption tiling_option) { diff --git a/cc/layers/tiled_layer_impl.h b/cc/layers/tiled_layer_impl.h index fb6502c..e3ace34 100644 --- a/cc/layers/tiled_layer_impl.h +++ b/cc/layers/tiled_layer_impl.h @@ -20,20 +20,19 @@ class CC_EXPORT TiledLayerImpl : public LayerImpl { static scoped_ptr<TiledLayerImpl> Create(LayerTreeImpl* tree_impl, int id) { return make_scoped_ptr(new TiledLayerImpl(tree_impl, id)); } - virtual ~TiledLayerImpl(); + ~TiledLayerImpl() override; - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) override; - virtual bool WillDraw(DrawMode draw_mode, - ResourceProvider* resource_provider) override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; + bool WillDraw(DrawMode draw_mode, + ResourceProvider* resource_provider) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; - 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; void set_skips_draw(bool skips_draw) { skips_draw_ = skips_draw; } void SetTilingData(const LayerTilingData& tiler); @@ -43,12 +42,12 @@ class CC_EXPORT TiledLayerImpl : public LayerImpl { bool contents_swizzled); void PushInvalidTile(int i, int j); - virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; - virtual void ReleaseResources() override; + SimpleEnclosedRegion VisibleContentOpaqueRegion() const override; + void ReleaseResources() override; const LayerTilingData* TilingForTesting() const { return tiler_.get(); } - virtual size_t GPUMemoryUsageInBytes() const override; + size_t GPUMemoryUsageInBytes() const override; protected: TiledLayerImpl(LayerTreeImpl* tree_impl, int id); @@ -56,12 +55,11 @@ class CC_EXPORT TiledLayerImpl : public LayerImpl { bool HasTileAt(int i, int j) const; bool HasResourceIdForTileAt(int i, int j) const; - virtual void GetDebugBorderProperties(SkColor* color, float* width) const - override; - virtual void AsValueInto(base::debug::TracedValue* dict) const override; + void GetDebugBorderProperties(SkColor* color, float* width) const override; + void AsValueInto(base::debug::TracedValue* dict) const override; private: - virtual const char* LayerTypeAsString() const override; + const char* LayerTypeAsString() const override; DrawableTile* TileAt(int i, int j) const; DrawableTile* CreateTile(int i, int j); diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc index 80f42ed..925cdc8 100644 --- a/cc/layers/tiled_layer_unittest.cc +++ b/cc/layers/tiled_layer_unittest.cc @@ -57,7 +57,7 @@ class SynchronousOutputSurfaceLayerTreeHost : public LayerTreeHost { client, manager, settings, impl_task_runner)); } - virtual ~SynchronousOutputSurfaceLayerTreeHost() {} + ~SynchronousOutputSurfaceLayerTreeHost() override {} bool EnsureOutputSurfaceCreated() { base::MessageLoop::current()->PostDelayedTask( @@ -68,8 +68,7 @@ class SynchronousOutputSurfaceLayerTreeHost : public LayerTreeHost { return output_surface_created_; } - virtual void OnCreateAndInitializeOutputSurfaceAttempted( - bool success) override { + void OnCreateAndInitializeOutputSurfaceAttempted(bool success) override { LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(success); output_surface_created_ = success; run_loop_.Quit(); @@ -1649,7 +1648,7 @@ class TrackingLayerPainter : public LayerPainter { return make_scoped_ptr(new TrackingLayerPainter()); } - virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override { + void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override { painted_rect_ = content_rect; } @@ -1675,10 +1674,8 @@ class UpdateTrackingTiledLayer : public FakeTiledLayer { } private: - virtual LayerUpdater* Updater() const override { - return layer_updater_.get(); - } - virtual ~UpdateTrackingTiledLayer() {} + LayerUpdater* Updater() const override { return layer_updater_.get(); } + ~UpdateTrackingTiledLayer() override {} TrackingLayerPainter* tracking_layer_painter_; scoped_refptr<BitmapContentLayerUpdater> layer_updater_; diff --git a/cc/layers/ui_resource_layer.cc b/cc/layers/ui_resource_layer.cc index 4293b09..944cf7d 100644 --- a/cc/layers/ui_resource_layer.cc +++ b/cc/layers/ui_resource_layer.cc @@ -23,7 +23,7 @@ class ScopedUIResourceHolder : public UIResourceLayer::UIResourceHolder { const SkBitmap& skbitmap) { return make_scoped_ptr(new ScopedUIResourceHolder(host, skbitmap)); } - virtual UIResourceId id() override { return resource_->id(); } + UIResourceId id() override { return resource_->id(); } private: ScopedUIResourceHolder(LayerTreeHost* host, const SkBitmap& skbitmap) { @@ -39,7 +39,7 @@ class SharedUIResourceHolder : public UIResourceLayer::UIResourceHolder { return make_scoped_ptr(new SharedUIResourceHolder(id)); } - virtual UIResourceId id() override { return id_; } + UIResourceId id() override { return id_; } private: explicit SharedUIResourceHolder(UIResourceId id) : id_(id) {} diff --git a/cc/layers/ui_resource_layer.h b/cc/layers/ui_resource_layer.h index f79389b..e22318c 100644 --- a/cc/layers/ui_resource_layer.h +++ b/cc/layers/ui_resource_layer.h @@ -20,9 +20,9 @@ class CC_EXPORT UIResourceLayer : public Layer { public: static scoped_refptr<UIResourceLayer> Create(); - virtual void PushPropertiesTo(LayerImpl* layer) override; + void PushPropertiesTo(LayerImpl* layer) override; - virtual void SetLayerTreeHost(LayerTreeHost* host) override; + void SetLayerTreeHost(LayerTreeHost* host) override; void SetBitmap(const SkBitmap& skbitmap); @@ -47,9 +47,9 @@ class CC_EXPORT UIResourceLayer : public Layer { protected: UIResourceLayer(); - virtual ~UIResourceLayer(); + ~UIResourceLayer() override; - virtual bool HasDrawableContent() const override; + bool HasDrawableContent() const override; scoped_ptr<UIResourceHolder> ui_resource_holder_; SkBitmap bitmap_; @@ -59,8 +59,7 @@ class CC_EXPORT UIResourceLayer : public Layer { float vertex_opacity_[4]; private: - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; void RecreateUIResourceHolder(); diff --git a/cc/layers/ui_resource_layer_impl.h b/cc/layers/ui_resource_layer_impl.h index a0cb6ec..515a0f1 100644 --- a/cc/layers/ui_resource_layer_impl.h +++ b/cc/layers/ui_resource_layer_impl.h @@ -26,7 +26,7 @@ class CC_EXPORT UIResourceLayerImpl : public LayerImpl { int id) { return make_scoped_ptr(new UIResourceLayerImpl(tree_impl, id)); } - virtual ~UIResourceLayerImpl(); + ~UIResourceLayerImpl() override; void SetUIResourceId(UIResourceId uid); @@ -39,17 +39,16 @@ class CC_EXPORT UIResourceLayerImpl : public LayerImpl { // opacity value. void SetVertexOpacity(const float vertex_opacity[4]); - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) override; - virtual bool WillDraw(DrawMode draw_mode, - ResourceProvider* resource_provider) override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; + bool WillDraw(DrawMode draw_mode, + ResourceProvider* resource_provider) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; - virtual base::DictionaryValue* LayerTreeAsJson() const override; + base::DictionaryValue* LayerTreeAsJson() const override; protected: UIResourceLayerImpl(LayerTreeImpl* tree_impl, int id); @@ -64,7 +63,7 @@ class CC_EXPORT UIResourceLayerImpl : public LayerImpl { float vertex_opacity_[4]; private: - virtual const char* LayerTypeAsString() const override; + const char* LayerTypeAsString() const override; DISALLOW_COPY_AND_ASSIGN(UIResourceLayerImpl); }; diff --git a/cc/layers/video_frame_provider_client_impl.h b/cc/layers/video_frame_provider_client_impl.h index c2d6599..b6eb86f 100644 --- a/cc/layers/video_frame_provider_client_impl.h +++ b/cc/layers/video_frame_provider_client_impl.h @@ -39,14 +39,14 @@ class VideoFrameProviderClientImpl // VideoFrameProvider::Client implementation. These methods are all callable // on any thread. - virtual void StopUsingProvider() override; - virtual void DidReceiveFrame() override; - virtual void DidUpdateMatrix(const float* matrix) override; + void StopUsingProvider() override; + void DidReceiveFrame() override; + void DidUpdateMatrix(const float* matrix) override; private: explicit VideoFrameProviderClientImpl(VideoFrameProvider* provider); friend class base::RefCounted<VideoFrameProviderClientImpl>; - virtual ~VideoFrameProviderClientImpl(); + ~VideoFrameProviderClientImpl() override; VideoLayerImpl* active_video_layer_; diff --git a/cc/layers/video_layer.h b/cc/layers/video_layer.h index c7ca647..bbcff36 100644 --- a/cc/layers/video_layer.h +++ b/cc/layers/video_layer.h @@ -23,15 +23,14 @@ class CC_EXPORT VideoLayer : public Layer { static scoped_refptr<VideoLayer> Create(VideoFrameProvider* provider, media::VideoRotation video_rotation); - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; private: VideoLayer(VideoFrameProvider* provider, media::VideoRotation video_rotation); - virtual ~VideoLayer(); + ~VideoLayer() override; // This pointer is only for passing to VideoLayerImpl's constructor. It should // never be dereferenced by this class. diff --git a/cc/layers/video_layer_impl.h b/cc/layers/video_layer_impl.h index 232a1c7..1843ec7 100644 --- a/cc/layers/video_layer_impl.h +++ b/cc/layers/video_layer_impl.h @@ -27,20 +27,19 @@ class CC_EXPORT VideoLayerImpl : public LayerImpl { int id, VideoFrameProvider* provider, media::VideoRotation video_rotation); - virtual ~VideoLayerImpl(); + ~VideoLayerImpl() override; // LayerImpl implementation. - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void PushPropertiesTo(LayerImpl* layer) override; - virtual bool WillDraw(DrawMode draw_mode, - ResourceProvider* resource_provider) override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; - virtual void DidDraw(ResourceProvider* resource_provider) override; - virtual void DidBecomeActive() override; - virtual void ReleaseResources() override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void PushPropertiesTo(LayerImpl* layer) override; + bool WillDraw(DrawMode draw_mode, + ResourceProvider* resource_provider) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; + void DidDraw(ResourceProvider* resource_provider) override; + void DidBecomeActive() override; + void ReleaseResources() override; void SetNeedsRedraw(); @@ -54,7 +53,7 @@ class CC_EXPORT VideoLayerImpl : public LayerImpl { int id, media::VideoRotation video_rotation); - virtual const char* LayerTypeAsString() const override; + const char* LayerTypeAsString() const override; scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl_; diff --git a/cc/output/bsp_walk_action.h b/cc/output/bsp_walk_action.h index 342e635..ac8fa41 100644 --- a/cc/output/bsp_walk_action.h +++ b/cc/output/bsp_walk_action.h @@ -23,7 +23,7 @@ class CC_EXPORT BspWalkAction { class CC_EXPORT BspWalkActionToVector : public BspWalkAction { public: explicit BspWalkActionToVector(std::vector<DrawPolygon*>* in_list); - virtual void operator()(DrawPolygon* item) override; + void operator()(DrawPolygon* item) override; private: std::vector<DrawPolygon*>* list_; diff --git a/cc/output/delegating_renderer.h b/cc/output/delegating_renderer.h index 1acebc5..89b47ad 100644 --- a/cc/output/delegating_renderer.h +++ b/cc/output/delegating_renderer.h @@ -22,20 +22,20 @@ class CC_EXPORT DelegatingRenderer : public Renderer { const LayerTreeSettings* settings, OutputSurface* output_surface, ResourceProvider* resource_provider); - virtual ~DelegatingRenderer(); + ~DelegatingRenderer() override; - virtual const RendererCapabilitiesImpl& Capabilities() const override; + const RendererCapabilitiesImpl& Capabilities() const override; - virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, - float device_scale_factor, - const gfx::Rect& device_viewport_rect, - const gfx::Rect& device_clip_rect, - bool disable_picture_quad_image_filtering) override; + void DrawFrame(RenderPassList* render_passes_in_draw_order, + float device_scale_factor, + const gfx::Rect& device_viewport_rect, + const gfx::Rect& device_clip_rect, + bool disable_picture_quad_image_filtering) override; - virtual void Finish() override {} + void Finish() override {} - virtual void SwapBuffers(const CompositorFrameMetadata& metadata) override; - virtual void ReceiveSwapBuffersAck(const CompositorFrameAck&) override; + void SwapBuffers(const CompositorFrameMetadata& metadata) override; + void ReceiveSwapBuffersAck(const CompositorFrameAck&) override; private: DelegatingRenderer(RendererClient* client, @@ -43,7 +43,7 @@ class CC_EXPORT DelegatingRenderer : public Renderer { OutputSurface* output_surface, ResourceProvider* resource_provider); - virtual void DidChangeVisibility() override; + void DidChangeVisibility() override; OutputSurface* output_surface_; ResourceProvider* resource_provider_; diff --git a/cc/output/delegating_renderer_unittest.cc b/cc/output/delegating_renderer_unittest.cc index 4c9deb2..fffa0ac 100644 --- a/cc/output/delegating_renderer_unittest.cc +++ b/cc/output/delegating_renderer_unittest.cc @@ -17,8 +17,7 @@ class DelegatingRendererTest : public LayerTreeTest { DelegatingRendererTest() : LayerTreeTest(), output_surface_(NULL) {} virtual ~DelegatingRendererTest() {} - virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) - override { + scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) override { scoped_ptr<FakeOutputSurface> output_surface = FakeOutputSurface::CreateDelegating3d(); output_surface_ = output_surface.get(); @@ -32,17 +31,16 @@ class DelegatingRendererTest : public LayerTreeTest { class DelegatingRendererTestDraw : public DelegatingRendererTest { public: - virtual void BeginTest() override { + void BeginTest() override { layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f); PostSetNeedsCommitToMainThread(); } - virtual void AfterTest() override {} + void AfterTest() override {} - 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(0u, output_surface_->num_sent_frames()); const CompositorFrame& last_frame = output_surface_->last_sent_frame(); @@ -53,12 +51,11 @@ class DelegatingRendererTestDraw : public DelegatingRendererTest { return DRAW_SUCCESS; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_EQ(0u, output_surface_->num_sent_frames()); } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { EXPECT_TRUE(result); EXPECT_EQ(1u, output_surface_->num_sent_frames()); @@ -83,15 +80,13 @@ SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(DelegatingRendererTestDraw); class DelegatingRendererTestResources : public DelegatingRendererTest { public: - virtual void BeginTest() override { - PostSetNeedsCommitToMainThread(); - } + void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void AfterTest() override {} + void AfterTest() override {} - 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 { frame->render_passes.clear(); frame->render_passes_by_id.clear(); @@ -111,12 +106,11 @@ class DelegatingRendererTestResources : public DelegatingRendererTest { return draw_result; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { + void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { EXPECT_EQ(0u, output_surface_->num_sent_frames()); } - virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) override { + void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { EXPECT_TRUE(result); EXPECT_EQ(1u, output_surface_->num_sent_frames()); diff --git a/cc/output/direct_renderer.h b/cc/output/direct_renderer.h index d4c4ba6..4966e63 100644 --- a/cc/output/direct_renderer.h +++ b/cc/output/direct_renderer.h @@ -23,16 +23,16 @@ class ResourceProvider; // delegate rendering to another compositor. class CC_EXPORT DirectRenderer : public Renderer { public: - virtual ~DirectRenderer(); + ~DirectRenderer() override; - virtual void DecideRenderPassAllocationsForFrame( + void DecideRenderPassAllocationsForFrame( const RenderPassList& render_passes_in_draw_order) override; - virtual bool HasAllocatedResourcesForTesting(RenderPassId id) const override; - virtual void DrawFrame(RenderPassList* render_passes_in_draw_order, - float device_scale_factor, - const gfx::Rect& device_viewport_rect, - const gfx::Rect& device_clip_rect, - bool disable_picture_quad_image_filtering) override; + bool HasAllocatedResourcesForTesting(RenderPassId id) const override; + void DrawFrame(RenderPassList* render_passes_in_draw_order, + float device_scale_factor, + const gfx::Rect& device_viewport_rect, + const gfx::Rect& device_clip_rect, + bool disable_picture_quad_image_filtering) override; struct CC_EXPORT DrawingFrame { DrawingFrame(); diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index e8a2c9d..61d233a 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -56,8 +56,8 @@ class FallbackFence : public ResourceProvider::Fence { : gl_(gl), has_passed_(true) {} // Overridden from ResourceProvider::Fence: - virtual void Set() override { has_passed_ = false; } - virtual bool HasPassed() override { + void Set() override { has_passed_ = false; } + bool HasPassed() override { if (!has_passed_) { has_passed_ = true; Synchronize(); @@ -66,7 +66,7 @@ class FallbackFence : public ResourceProvider::Fence { } private: - virtual ~FallbackFence() {} + ~FallbackFence() override {} void Synchronize() { TRACE_EVENT0("cc", "FallbackFence::Synchronize"); @@ -251,16 +251,14 @@ class GLRenderer::SyncQuery { : query_(query) {} // Overridden from ResourceProvider::Fence: - virtual void Set() override { + void Set() override { DCHECK(query_); query_->Set(); } - virtual bool HasPassed() override { - return !query_ || !query_->IsPending(); - } + bool HasPassed() override { return !query_ || !query_->IsPending(); } private: - virtual ~Fence() {} + ~Fence() override {} base::WeakPtr<SyncQuery> query_; diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h index 8e53d70..a379dc0 100644 --- a/cc/output/gl_renderer.h +++ b/cc/output/gl_renderer.h @@ -55,15 +55,15 @@ class CC_EXPORT GLRenderer : public DirectRenderer { TextureMailboxDeleter* texture_mailbox_deleter, int highp_threshold_min); - virtual ~GLRenderer(); + ~GLRenderer() override; - virtual const RendererCapabilitiesImpl& Capabilities() const override; + const RendererCapabilitiesImpl& Capabilities() const override; // Waits for rendering to finish. - virtual void Finish() override; + void Finish() override; - virtual void DoNoOp() override; - virtual void SwapBuffers(const CompositorFrameMetadata& metadata) override; + void DoNoOp() override; + void SwapBuffers(const CompositorFrameMetadata& metadata) override; virtual bool IsContextLost(); @@ -80,7 +80,7 @@ class CC_EXPORT GLRenderer : public DirectRenderer { TextureMailboxDeleter* texture_mailbox_deleter, int highp_threshold_min); - virtual void DidChangeVisibility() override; + void DidChangeVisibility() override; bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; } @@ -101,26 +101,26 @@ class CC_EXPORT GLRenderer : public DirectRenderer { void SetBlendEnabled(bool enabled); bool blend_enabled() const { return blend_shadow_; } - virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) override; - virtual bool BindFramebufferToTexture(DrawingFrame* frame, - const ScopedResource* resource, - const gfx::Rect& target_rect) override; - virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) override; - virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) override; - virtual void DiscardPixels(bool has_external_stencil_test, - bool draw_rect_covers_full_surface) override; - virtual void ClearFramebuffer(DrawingFrame* frame, - bool has_external_stencil_test) override; - virtual void DoDrawQuad(DrawingFrame* frame, const class DrawQuad*) override; - virtual void BeginDrawingFrame(DrawingFrame* frame) override; - virtual void FinishDrawingFrame(DrawingFrame* frame) override; - virtual bool FlippedFramebuffer() const override; - virtual void EnsureScissorTestEnabled() override; - virtual void EnsureScissorTestDisabled() override; - virtual void CopyCurrentRenderPassToBitmap( + void BindFramebufferToOutputSurface(DrawingFrame* frame) override; + bool BindFramebufferToTexture(DrawingFrame* frame, + const ScopedResource* resource, + const gfx::Rect& target_rect) override; + void SetDrawViewport(const gfx::Rect& window_space_viewport) override; + void SetScissorTestRect(const gfx::Rect& scissor_rect) override; + void DiscardPixels(bool has_external_stencil_test, + bool draw_rect_covers_full_surface) override; + void ClearFramebuffer(DrawingFrame* frame, + bool has_external_stencil_test) override; + void DoDrawQuad(DrawingFrame* frame, const class DrawQuad*) override; + void BeginDrawingFrame(DrawingFrame* frame) override; + void FinishDrawingFrame(DrawingFrame* frame) override; + bool FlippedFramebuffer() const override; + void EnsureScissorTestEnabled() override; + void EnsureScissorTestDisabled() override; + void CopyCurrentRenderPassToBitmap( DrawingFrame* frame, scoped_ptr<CopyOutputRequest> request) override; - virtual void FinishDrawingQuadList() override; + void FinishDrawingQuadList() override; // Check if quad needs antialiasing and if so, inflate the quad and // fill edge array for fragment shader. local_quad is set to @@ -223,8 +223,8 @@ class CC_EXPORT GLRenderer : public DirectRenderer { void RestoreGLState(); void RestoreFramebuffer(DrawingFrame* frame); - virtual void DiscardBackbuffer() override; - virtual void EnsureBackbuffer() override; + void DiscardBackbuffer() override; + void EnsureBackbuffer() override; void EnforceMemoryPolicy(); void ScheduleOverlays(DrawingFrame* frame); diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc index d6f7522..42e4b5e 100644 --- a/cc/output/gl_renderer_unittest.cc +++ b/cc/output/gl_renderer_unittest.cc @@ -362,38 +362,34 @@ class ForbidSynchronousCallContext : public TestWebGraphicsContext3D { public: ForbidSynchronousCallContext() {} - virtual void getAttachedShaders(GLuint program, - GLsizei max_count, - GLsizei* count, - GLuint* shaders) override { + void getAttachedShaders(GLuint program, + GLsizei max_count, + GLsizei* count, + GLuint* shaders) override { ADD_FAILURE(); } - virtual GLint getAttribLocation(GLuint program, const GLchar* name) override { + GLint getAttribLocation(GLuint program, const GLchar* name) override { ADD_FAILURE(); return 0; } - virtual void getBooleanv(GLenum pname, GLboolean* value) override { - ADD_FAILURE(); - } - virtual void getBufferParameteriv(GLenum target, - GLenum pname, - GLint* value) override { + void getBooleanv(GLenum pname, GLboolean* value) override { ADD_FAILURE(); } + void getBufferParameteriv(GLenum target, + GLenum pname, + GLint* value) override { ADD_FAILURE(); } - virtual GLenum getError() override { + GLenum getError() override { ADD_FAILURE(); return GL_NO_ERROR; } - virtual void getFloatv(GLenum pname, GLfloat* value) override { + void getFloatv(GLenum pname, GLfloat* value) override { ADD_FAILURE(); } + void getFramebufferAttachmentParameteriv(GLenum target, + GLenum attachment, + GLenum pname, + GLint* value) override { ADD_FAILURE(); } - virtual void getFramebufferAttachmentParameteriv(GLenum target, - GLenum attachment, - GLenum pname, - GLint* value) override { - ADD_FAILURE(); - } - virtual void getIntegerv(GLenum pname, GLint* value) override { + void getIntegerv(GLenum pname, GLint* value) override { if (pname == GL_MAX_TEXTURE_SIZE) { // MAX_TEXTURE_SIZE is cached client side, so it's OK to query. *value = 1024; @@ -404,9 +400,7 @@ class ForbidSynchronousCallContext : public TestWebGraphicsContext3D { // We allow querying the shader compilation and program link status in debug // mode, but not release. - virtual void getProgramiv(GLuint program, - GLenum pname, - GLint* value) override { + void getProgramiv(GLuint program, GLenum pname, GLint* value) override { #ifndef NDEBUG *value = 1; #else @@ -414,7 +408,7 @@ class ForbidSynchronousCallContext : public TestWebGraphicsContext3D { #endif } - virtual void getShaderiv(GLuint shader, GLenum pname, GLint* value) override { + void getShaderiv(GLuint shader, GLenum pname, GLint* value) override { #ifndef NDEBUG *value = 1; #else @@ -422,55 +416,41 @@ class ForbidSynchronousCallContext : public TestWebGraphicsContext3D { #endif } - virtual void getRenderbufferParameteriv(GLenum target, - GLenum pname, - GLint* value) override { + void getRenderbufferParameteriv(GLenum target, + GLenum pname, + GLint* value) override { ADD_FAILURE(); } - virtual void getShaderPrecisionFormat(GLenum shadertype, - GLenum precisiontype, - GLint* range, - GLint* precision) override { + void getShaderPrecisionFormat(GLenum shadertype, + GLenum precisiontype, + GLint* range, + GLint* precision) override { ADD_FAILURE(); } - virtual void getTexParameterfv(GLenum target, - GLenum pname, - GLfloat* value) override { + void getTexParameterfv(GLenum target, GLenum pname, GLfloat* value) override { ADD_FAILURE(); } - virtual void getTexParameteriv(GLenum target, - GLenum pname, - GLint* value) override { + void getTexParameteriv(GLenum target, GLenum pname, GLint* value) override { ADD_FAILURE(); } - virtual void getUniformfv(GLuint program, - GLint location, - GLfloat* value) override { + void getUniformfv(GLuint program, GLint location, GLfloat* value) override { ADD_FAILURE(); } - virtual void getUniformiv(GLuint program, - GLint location, - GLint* value) override { + void getUniformiv(GLuint program, GLint location, GLint* value) override { ADD_FAILURE(); } - virtual GLint getUniformLocation(GLuint program, - const GLchar* name) override { + GLint getUniformLocation(GLuint program, const GLchar* name) override { ADD_FAILURE(); return 0; } - virtual void getVertexAttribfv(GLuint index, - GLenum pname, - GLfloat* value) override { + void getVertexAttribfv(GLuint index, GLenum pname, GLfloat* value) override { ADD_FAILURE(); } - virtual void getVertexAttribiv(GLuint index, - GLenum pname, - GLint* value) override { + void getVertexAttribiv(GLuint index, GLenum pname, GLint* value) override { ADD_FAILURE(); } - virtual GLsizeiptr getVertexAttribOffset(GLuint index, - GLenum pname) override { + GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname) override { ADD_FAILURE(); return 0; } @@ -505,14 +485,12 @@ class LoseContextOnFirstGetContext : public TestWebGraphicsContext3D { public: LoseContextOnFirstGetContext() {} - virtual void getProgramiv(GLuint program, - GLenum pname, - GLint* value) override { + void getProgramiv(GLuint program, GLenum pname, GLint* value) override { context_lost_ = true; *value = 0; } - virtual void getShaderiv(GLuint shader, GLenum pname, GLint* value) override { + void getShaderiv(GLuint shader, GLenum pname, GLint* value) override { context_lost_ = true; *value = 0; } @@ -707,17 +685,15 @@ class VisibilityChangeIsLastCallTrackingContext : last_call_was_set_visibility_(false) {} // TestWebGraphicsContext3D methods. - virtual void flush() override { last_call_was_set_visibility_ = false; } - virtual void deleteTexture(GLuint) override { - last_call_was_set_visibility_ = false; - } - virtual void deleteFramebuffer(GLuint) override { + void flush() override { last_call_was_set_visibility_ = false; } + void deleteTexture(GLuint) override { last_call_was_set_visibility_ = false; } + void deleteFramebuffer(GLuint) override { last_call_was_set_visibility_ = false; } - virtual void deleteQueryEXT(GLuint) override { + void deleteQueryEXT(GLuint) override { last_call_was_set_visibility_ = false; } - virtual void deleteRenderbuffer(GLuint) override { + void deleteRenderbuffer(GLuint) override { last_call_was_set_visibility_ = false; } @@ -989,14 +965,14 @@ class ScissorTestOnClearCheckingContext : public TestWebGraphicsContext3D { public: ScissorTestOnClearCheckingContext() : scissor_enabled_(false) {} - virtual void clear(GLbitfield) override { EXPECT_FALSE(scissor_enabled_); } + void clear(GLbitfield) override { EXPECT_FALSE(scissor_enabled_); } - virtual void enable(GLenum cap) override { + void enable(GLenum cap) override { if (cap == GL_SCISSOR_TEST) scissor_enabled_ = true; } - virtual void disable(GLenum cap) override { + void disable(GLenum cap) override { if (cap == GL_SCISSOR_TEST) scissor_enabled_ = false; } @@ -1078,9 +1054,9 @@ class DiscardCheckingContext : public TestWebGraphicsContext3D { set_have_discard_framebuffer(true); } - virtual void discardFramebufferEXT(GLenum target, - GLsizei numAttachments, - const GLenum* attachments) override { + void discardFramebufferEXT(GLenum target, + GLsizei numAttachments, + const GLenum* attachments) override { ++discarded_; } @@ -1099,7 +1075,7 @@ class NonReshapableOutputSurface : public FakeOutputSurface { false) { surface_size_ = gfx::Size(500, 500); } - virtual void Reshape(const gfx::Size& size, float scale_factor) override {} + void Reshape(const gfx::Size& size, float scale_factor) override {} void set_fixed_size(const gfx::Size& size) { surface_size_ = size; } }; @@ -1264,13 +1240,12 @@ class FlippedScissorAndViewportContext : public TestWebGraphicsContext3D { public: FlippedScissorAndViewportContext() : did_call_viewport_(false), did_call_scissor_(false) {} - virtual ~FlippedScissorAndViewportContext() { + ~FlippedScissorAndViewportContext() override { EXPECT_TRUE(did_call_viewport_); EXPECT_TRUE(did_call_scissor_); } - virtual void viewport(GLint x, GLint y, GLsizei width, GLsizei height) - override { + void viewport(GLint x, GLint y, GLsizei width, GLsizei height) override { EXPECT_EQ(10, x); EXPECT_EQ(390, y); EXPECT_EQ(100, width); @@ -1278,8 +1253,7 @@ class FlippedScissorAndViewportContext : public TestWebGraphicsContext3D { did_call_viewport_ = true; } - virtual void scissor(GLint x, GLint y, GLsizei width, GLsizei height) - override { + void scissor(GLint x, GLint y, GLsizei width, GLsizei height) override { EXPECT_EQ(30, x); EXPECT_EQ(450, y); EXPECT_EQ(20, width); diff --git a/cc/output/output_surface_unittest.cc b/cc/output/output_surface_unittest.cc index b70e344..b1f4149 100644 --- a/cc/output/output_surface_unittest.cc +++ b/cc/output/output_surface_unittest.cc @@ -32,7 +32,7 @@ class TestOutputSurface : public OutputSurface { scoped_ptr<SoftwareOutputDevice> software_device) : OutputSurface(context_provider, software_device.Pass()) {} - virtual void SwapBuffers(CompositorFrame* frame) override { + void SwapBuffers(CompositorFrame* frame) override { client_->DidSwapBuffers(); client_->DidSwapBuffersComplete(); } @@ -63,11 +63,11 @@ class TestOutputSurface : public OutputSurface { class TestSoftwareOutputDevice : public SoftwareOutputDevice { public: TestSoftwareOutputDevice(); - virtual ~TestSoftwareOutputDevice(); + ~TestSoftwareOutputDevice() override; // Overriden from cc:SoftwareOutputDevice - virtual void DiscardBackbuffer() override; - virtual void EnsureBackbuffer() override; + void DiscardBackbuffer() override; + void EnsureBackbuffer() override; int discard_backbuffer_count() { return discard_backbuffer_count_; } int ensure_backbuffer_count() { return ensure_backbuffer_count_; } diff --git a/cc/output/overlay_strategy_single_on_top.h b/cc/output/overlay_strategy_single_on_top.h index 1bf6bd8..e5518cc 100644 --- a/cc/output/overlay_strategy_single_on_top.h +++ b/cc/output/overlay_strategy_single_on_top.h @@ -19,8 +19,8 @@ class CC_EXPORT OverlayStrategySingleOnTop : public OverlayProcessor::Strategy { public: OverlayStrategySingleOnTop(OverlayCandidateValidator* capability_checker, ResourceProvider* resource_provider); - virtual bool Attempt(RenderPassList* render_passes_in_draw_order, - OverlayCandidateList* candidate_list) override; + bool Attempt(RenderPassList* render_passes_in_draw_order, + OverlayCandidateList* candidate_list) override; private: OverlayCandidateValidator* capability_checker_; diff --git a/cc/output/overlay_unittest.cc b/cc/output/overlay_unittest.cc index 245caec..92b19c7 100644 --- a/cc/output/overlay_unittest.cc +++ b/cc/output/overlay_unittest.cc @@ -40,7 +40,7 @@ void MailboxReleased(unsigned sync_point, class SingleOverlayValidator : public OverlayCandidateValidator { public: - virtual void CheckOverlaySupport(OverlayCandidateList* surfaces) override; + void CheckOverlaySupport(OverlayCandidateList* surfaces) override; }; void SingleOverlayValidator::CheckOverlaySupport( @@ -62,7 +62,7 @@ class SingleOverlayProcessor : public OverlayProcessor { SingleOverlayProcessor(OutputSurface* surface, ResourceProvider* resource_provider); // Virtual to allow testing different strategies. - virtual void Initialize() override; + void Initialize() override; }; SingleOverlayProcessor::SingleOverlayProcessor( @@ -103,7 +103,7 @@ class OverlayOutputSurface : public OutputSurface { : OutputSurface(context_provider) {} // OutputSurface implementation - virtual void SwapBuffers(CompositorFrame* frame) override; + void SwapBuffers(CompositorFrame* frame) override; void InitWithSingleOverlayValidator() { overlay_candidate_validator_.reset(new SingleOverlayValidator); @@ -568,7 +568,7 @@ class OverlayInfoRendererGL : public GLRenderer { class FakeRendererClient : public RendererClient { public: // RendererClient methods. - virtual void SetFullRootLayerDamage() override {} + void SetFullRootLayerDamage() override {} }; class MockOverlayScheduler { diff --git a/cc/output/renderer_unittest.cc b/cc/output/renderer_unittest.cc index 8f0a0ef..229558d 100644 --- a/cc/output/renderer_unittest.cc +++ b/cc/output/renderer_unittest.cc @@ -19,10 +19,10 @@ class TestOutputSurface : public OutputSurface { public: explicit TestOutputSurface( const scoped_refptr<ContextProvider>& context_provider); - virtual ~TestOutputSurface() override; + ~TestOutputSurface() override; // OutputSurface implementation - virtual void SwapBuffers(CompositorFrame* frame) override; + void SwapBuffers(CompositorFrame* frame) override; }; TestOutputSurface::TestOutputSurface( diff --git a/cc/output/software_renderer.h b/cc/output/software_renderer.h index deac838..d8b5a9d 100644 --- a/cc/output/software_renderer.h +++ b/cc/output/software_renderer.h @@ -33,34 +33,32 @@ class CC_EXPORT SoftwareRenderer : public DirectRenderer { OutputSurface* output_surface, ResourceProvider* resource_provider); - virtual ~SoftwareRenderer(); - virtual const RendererCapabilitiesImpl& Capabilities() const override; - virtual void Finish() override; - virtual void SwapBuffers(const CompositorFrameMetadata& metadata) override; - virtual void ReceiveSwapBuffersAck( - const CompositorFrameAck& ack) override; - virtual void DiscardBackbuffer() override; - virtual void EnsureBackbuffer() override; + ~SoftwareRenderer() override; + const RendererCapabilitiesImpl& Capabilities() const override; + void Finish() override; + void SwapBuffers(const CompositorFrameMetadata& metadata) override; + void ReceiveSwapBuffersAck(const CompositorFrameAck& ack) override; + void DiscardBackbuffer() override; + void EnsureBackbuffer() override; protected: - virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) override; - virtual bool BindFramebufferToTexture( - DrawingFrame* frame, - const ScopedResource* texture, - const gfx::Rect& target_rect) override; - virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) override; - virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) override; - virtual void DiscardPixels(bool has_external_stencil_test, - bool draw_rect_covers_full_surface) override; - virtual void ClearFramebuffer(DrawingFrame* frame, - bool has_external_stencil_test) override; - virtual void DoDrawQuad(DrawingFrame* frame, const DrawQuad* quad) override; - virtual void BeginDrawingFrame(DrawingFrame* frame) override; - virtual void FinishDrawingFrame(DrawingFrame* frame) override; - virtual bool FlippedFramebuffer() const override; - virtual void EnsureScissorTestEnabled() override; - virtual void EnsureScissorTestDisabled() override; - virtual void CopyCurrentRenderPassToBitmap( + void BindFramebufferToOutputSurface(DrawingFrame* frame) override; + bool BindFramebufferToTexture(DrawingFrame* frame, + const ScopedResource* texture, + const gfx::Rect& target_rect) override; + void SetDrawViewport(const gfx::Rect& window_space_viewport) override; + void SetScissorTestRect(const gfx::Rect& scissor_rect) override; + void DiscardPixels(bool has_external_stencil_test, + bool draw_rect_covers_full_surface) override; + void ClearFramebuffer(DrawingFrame* frame, + bool has_external_stencil_test) override; + void DoDrawQuad(DrawingFrame* frame, const DrawQuad* quad) override; + void BeginDrawingFrame(DrawingFrame* frame) override; + void FinishDrawingFrame(DrawingFrame* frame) override; + bool FlippedFramebuffer() const override; + void EnsureScissorTestEnabled() override; + void EnsureScissorTestDisabled() override; + void CopyCurrentRenderPassToBitmap( DrawingFrame* frame, scoped_ptr<CopyOutputRequest> request) override; @@ -69,7 +67,7 @@ class CC_EXPORT SoftwareRenderer : public DirectRenderer { OutputSurface* output_surface, ResourceProvider* resource_provider); - virtual void DidChangeVisibility() override; + void DidChangeVisibility() override; private: void ClearCanvas(SkColor color); diff --git a/cc/output/software_renderer_unittest.cc b/cc/output/software_renderer_unittest.cc index 2896be1..1e373b2 100644 --- a/cc/output/software_renderer_unittest.cc +++ b/cc/output/software_renderer_unittest.cc @@ -55,7 +55,7 @@ class SoftwareRendererTest : public testing::Test, public RendererClient { SoftwareRenderer* renderer() const { return renderer_.get(); } // RendererClient implementation. - virtual void SetFullRootLayerDamage() override {} + void SetFullRootLayerDamage() override {} scoped_ptr<SkBitmap> DrawAndCopyOutput(RenderPassList* list, float device_scale_factor, diff --git a/cc/quads/checkerboard_draw_quad.h b/cc/quads/checkerboard_draw_quad.h index 71253e3..64c583f 100644 --- a/cc/quads/checkerboard_draw_quad.h +++ b/cc/quads/checkerboard_draw_quad.h @@ -30,13 +30,12 @@ class CC_EXPORT CheckerboardDrawQuad : public DrawQuad { SkColor color; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const CheckerboardDrawQuad* MaterialCast(const DrawQuad*); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/content_draw_quad_base.h b/cc/quads/content_draw_quad_base.h index d6b1995..6917e6b 100644 --- a/cc/quads/content_draw_quad_base.h +++ b/cc/quads/content_draw_quad_base.h @@ -41,8 +41,8 @@ class CC_EXPORT ContentDrawQuadBase : public DrawQuad { protected: ContentDrawQuadBase(); - virtual ~ContentDrawQuadBase(); - virtual void ExtendValue(base::debug::TracedValue* value) const override; + ~ContentDrawQuadBase() override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/debug_border_draw_quad.h b/cc/quads/debug_border_draw_quad.h index e2b6f70..a511ce1 100644 --- a/cc/quads/debug_border_draw_quad.h +++ b/cc/quads/debug_border_draw_quad.h @@ -33,13 +33,12 @@ class CC_EXPORT DebugBorderDrawQuad : public DrawQuad { SkColor color; int width; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const DebugBorderDrawQuad* MaterialCast(const DrawQuad*); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/io_surface_draw_quad.h b/cc/quads/io_surface_draw_quad.h index 3829156..9c8b50b 100644 --- a/cc/quads/io_surface_draw_quad.h +++ b/cc/quads/io_surface_draw_quad.h @@ -43,13 +43,12 @@ class CC_EXPORT IOSurfaceDrawQuad : public DrawQuad { unsigned io_surface_resource_id; Orientation orientation; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const IOSurfaceDrawQuad* MaterialCast(const DrawQuad*); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/list_container_unittest.cc b/cc/quads/list_container_unittest.cc index 8b68852..31a479b 100644 --- a/cc/quads/list_container_unittest.cc +++ b/cc/quads/list_container_unittest.cc @@ -29,13 +29,12 @@ bool isConstSharedQuadStatePointer(SharedQuadState* ptr) { class SimpleDrawQuad : public DrawQuad { public: - virtual ~SimpleDrawQuad() {} - virtual void IterateResources( - const ResourceIteratorCallback& callback) override {} + ~SimpleDrawQuad() override {} + void IterateResources(const ResourceIteratorCallback& callback) override {} void set_value(int val) { value = val; } int get_value() { return value; } - virtual void ExtendValue(base::debug::TracedValue* value) const override {} + void ExtendValue(base::debug::TracedValue* value) const override {} private: int value; diff --git a/cc/quads/picture_draw_quad.h b/cc/quads/picture_draw_quad.h index 5d75e05..d2a7271 100644 --- a/cc/quads/picture_draw_quad.h +++ b/cc/quads/picture_draw_quad.h @@ -20,7 +20,7 @@ namespace cc { class CC_EXPORT PictureDrawQuad : public ContentDrawQuadBase { public: PictureDrawQuad(); - virtual ~PictureDrawQuad(); + ~PictureDrawQuad() override; void SetNew(const SharedQuadState* shared_quad_state, const gfx::Rect& rect, @@ -50,13 +50,12 @@ class CC_EXPORT PictureDrawQuad : public ContentDrawQuadBase { scoped_refptr<PicturePileImpl> picture_pile; ResourceFormat texture_format; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const PictureDrawQuad* MaterialCast(const DrawQuad* quad); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/render_pass_draw_quad.h b/cc/quads/render_pass_draw_quad.h index 25417f6..95ca2f2 100644 --- a/cc/quads/render_pass_draw_quad.h +++ b/cc/quads/render_pass_draw_quad.h @@ -18,7 +18,7 @@ namespace cc { class CC_EXPORT RenderPassDrawQuad : public DrawQuad { public: RenderPassDrawQuad(); - virtual ~RenderPassDrawQuad(); + ~RenderPassDrawQuad() override; void SetNew(const SharedQuadState* shared_quad_state, const gfx::Rect& rect, @@ -65,13 +65,12 @@ class CC_EXPORT RenderPassDrawQuad : public DrawQuad { // Helper function to generate the normalized uv rect. gfx::RectF MaskUVRect() const; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const RenderPassDrawQuad* MaterialCast(const DrawQuad*); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/solid_color_draw_quad.h b/cc/quads/solid_color_draw_quad.h index 256cc526..f70e5e3 100644 --- a/cc/quads/solid_color_draw_quad.h +++ b/cc/quads/solid_color_draw_quad.h @@ -33,13 +33,12 @@ class CC_EXPORT SolidColorDrawQuad : public DrawQuad { SkColor color; bool force_anti_aliasing_off; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const SolidColorDrawQuad* MaterialCast(const DrawQuad*); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/stream_video_draw_quad.h b/cc/quads/stream_video_draw_quad.h index f4cb0f5..cdba60c 100644 --- a/cc/quads/stream_video_draw_quad.h +++ b/cc/quads/stream_video_draw_quad.h @@ -34,13 +34,12 @@ class CC_EXPORT StreamVideoDrawQuad : public DrawQuad { unsigned resource_id; gfx::Transform matrix; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const StreamVideoDrawQuad* MaterialCast(const DrawQuad*); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/surface_draw_quad.h b/cc/quads/surface_draw_quad.h index 2fa35f1..bdf7838 100644 --- a/cc/quads/surface_draw_quad.h +++ b/cc/quads/surface_draw_quad.h @@ -30,13 +30,12 @@ class CC_EXPORT SurfaceDrawQuad : public DrawQuad { SurfaceId surface_id; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const SurfaceDrawQuad* MaterialCast(const DrawQuad* quad); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/texture_draw_quad.h b/cc/quads/texture_draw_quad.h index 3a3bb54..3e0632c 100644 --- a/cc/quads/texture_draw_quad.h +++ b/cc/quads/texture_draw_quad.h @@ -49,13 +49,12 @@ class CC_EXPORT TextureDrawQuad : public DrawQuad { float vertex_opacity[4]; bool flipped; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const TextureDrawQuad* MaterialCast(const DrawQuad*); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/tile_draw_quad.h b/cc/quads/tile_draw_quad.h index e8941d5..d776057 100644 --- a/cc/quads/tile_draw_quad.h +++ b/cc/quads/tile_draw_quad.h @@ -12,7 +12,7 @@ namespace cc { class CC_EXPORT TileDrawQuad : public ContentDrawQuadBase { public: TileDrawQuad(); - virtual ~TileDrawQuad(); + ~TileDrawQuad() override; void SetNew(const SharedQuadState* shared_quad_state, const gfx::Rect& rect, @@ -35,13 +35,12 @@ class CC_EXPORT TileDrawQuad : public ContentDrawQuadBase { unsigned resource_id; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const TileDrawQuad* MaterialCast(const DrawQuad*); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h index e0fc758..e1c5410 100644 --- a/cc/quads/yuv_video_draw_quad.h +++ b/cc/quads/yuv_video_draw_quad.h @@ -21,7 +21,7 @@ class CC_EXPORT YUVVideoDrawQuad : public DrawQuad { COLOR_SPACE_LAST = REC_601_JPEG }; - virtual ~YUVVideoDrawQuad(); + ~YUVVideoDrawQuad() override; YUVVideoDrawQuad(); @@ -55,13 +55,12 @@ class CC_EXPORT YUVVideoDrawQuad : public DrawQuad { unsigned a_plane_resource_id; ColorSpace color_space; - virtual void IterateResources(const ResourceIteratorCallback& callback) - override; + void IterateResources(const ResourceIteratorCallback& callback) override; static const YUVVideoDrawQuad* MaterialCast(const DrawQuad*); private: - virtual void ExtendValue(base::debug::TracedValue* value) const override; + void ExtendValue(base::debug::TracedValue* value) const override; }; } // namespace cc diff --git a/cc/resources/bitmap_content_layer_updater.h b/cc/resources/bitmap_content_layer_updater.h index 0010c41..5ddc35f 100644 --- a/cc/resources/bitmap_content_layer_updater.h +++ b/cc/resources/bitmap_content_layer_updater.h @@ -27,12 +27,12 @@ class CC_EXPORT BitmapContentLayerUpdater : public ContentLayerUpdater { public: Resource(BitmapContentLayerUpdater* updater, scoped_ptr<PrioritizedResource> resource); - virtual ~Resource(); + ~Resource() override; - virtual void Update(ResourceUpdateQueue* queue, - const gfx::Rect& source_rect, - const gfx::Vector2d& dest_offset, - bool partial_update) override; + void Update(ResourceUpdateQueue* queue, + const gfx::Rect& source_rect, + const gfx::Vector2d& dest_offset, + bool partial_update) override; private: BitmapContentLayerUpdater* updater_; @@ -45,27 +45,27 @@ class CC_EXPORT BitmapContentLayerUpdater : public ContentLayerUpdater { RenderingStatsInstrumentation* stats_instrumenation, int layer_id); - virtual scoped_ptr<LayerUpdater::Resource> CreateResource( + scoped_ptr<LayerUpdater::Resource> CreateResource( PrioritizedResourceManager* manager) override; - virtual void PrepareToUpdate(const gfx::Size& content_size, - const gfx::Rect& paint_rect, - const gfx::Size& tile_size, - float contents_width_scale, - float contents_height_scale) override; + void PrepareToUpdate(const gfx::Size& content_size, + const gfx::Rect& paint_rect, + const gfx::Size& tile_size, + float contents_width_scale, + float contents_height_scale) override; void UpdateTexture(ResourceUpdateQueue* queue, PrioritizedResource* resource, const gfx::Rect& source_rect, const gfx::Vector2d& dest_offset, bool partial_update); - virtual void SetOpaque(bool opaque) override; - virtual void ReduceMemoryUsage() override; + void SetOpaque(bool opaque) override; + void ReduceMemoryUsage() override; protected: BitmapContentLayerUpdater( scoped_ptr<LayerPainter> painter, RenderingStatsInstrumentation* stats_instrumenation, int layer_id); - virtual ~BitmapContentLayerUpdater(); + ~BitmapContentLayerUpdater() override; SkBitmap bitmap_backing_; skia::RefPtr<SkCanvas> canvas_; diff --git a/cc/resources/bitmap_raster_worker_pool.cc b/cc/resources/bitmap_raster_worker_pool.cc index e86129f..fd16ca3 100644 --- a/cc/resources/bitmap_raster_worker_pool.cc +++ b/cc/resources/bitmap_raster_worker_pool.cc @@ -24,10 +24,10 @@ class RasterBufferImpl : public RasterBuffer { : lock_(resource_provider, resource->id()) {} // Overridden from RasterBuffer: - virtual void Playback(const PicturePileImpl* picture_pile, - const gfx::Rect& rect, - float scale, - RenderingStatsInstrumentation* stats) override { + void Playback(const PicturePileImpl* picture_pile, + const gfx::Rect& rect, + float scale, + RenderingStatsInstrumentation* stats) override { picture_pile->RasterToBitmap(lock_.sk_canvas(), rect, scale, stats); } diff --git a/cc/resources/bitmap_raster_worker_pool.h b/cc/resources/bitmap_raster_worker_pool.h index 876bf36..624318b 100644 --- a/cc/resources/bitmap_raster_worker_pool.h +++ b/cc/resources/bitmap_raster_worker_pool.h @@ -23,7 +23,7 @@ class CC_EXPORT BitmapRasterWorkerPool : public RasterWorkerPool, public Rasterizer, public RasterizerTaskClient { public: - virtual ~BitmapRasterWorkerPool(); + ~BitmapRasterWorkerPool() override; static scoped_ptr<RasterWorkerPool> Create( base::SequencedTaskRunner* task_runner, @@ -31,18 +31,18 @@ class CC_EXPORT BitmapRasterWorkerPool : public RasterWorkerPool, ResourceProvider* resource_provider); // Overridden from RasterWorkerPool: - virtual Rasterizer* AsRasterizer() override; + Rasterizer* AsRasterizer() override; // Overridden from Rasterizer: - virtual void SetClient(RasterizerClient* client) override; - virtual void Shutdown() override; - virtual void ScheduleTasks(RasterTaskQueue* queue) override; - virtual void CheckForCompletedTasks() override; + void SetClient(RasterizerClient* client) override; + void Shutdown() override; + void ScheduleTasks(RasterTaskQueue* queue) override; + void CheckForCompletedTasks() override; // Overridden from RasterizerTaskClient: - virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster( + scoped_ptr<RasterBuffer> AcquireBufferForRaster( const Resource* resource) override; - virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; + void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; protected: BitmapRasterWorkerPool(base::SequencedTaskRunner* task_runner, diff --git a/cc/resources/bitmap_skpicture_content_layer_updater.h b/cc/resources/bitmap_skpicture_content_layer_updater.h index 030db6e..ba22b2e 100644 --- a/cc/resources/bitmap_skpicture_content_layer_updater.h +++ b/cc/resources/bitmap_skpicture_content_layer_updater.h @@ -20,10 +20,10 @@ class BitmapSkPictureContentLayerUpdater : public SkPictureContentLayerUpdater { Resource(BitmapSkPictureContentLayerUpdater* updater, scoped_ptr<PrioritizedResource> texture); - virtual void Update(ResourceUpdateQueue* queue, - const gfx::Rect& source_rect, - const gfx::Vector2d& dest_offset, - bool partial_update) override; + void Update(ResourceUpdateQueue* queue, + const gfx::Rect& source_rect, + const gfx::Vector2d& dest_offset, + bool partial_update) override; private: SkBitmap bitmap_; @@ -37,7 +37,7 @@ class BitmapSkPictureContentLayerUpdater : public SkPictureContentLayerUpdater { RenderingStatsInstrumentation* stats_instrumentation, int layer_id); - virtual scoped_ptr<LayerUpdater::Resource> CreateResource( + scoped_ptr<LayerUpdater::Resource> CreateResource( PrioritizedResourceManager* manager) override; void PaintContentsRect(SkCanvas* canvas, const gfx::Rect& source_rect); @@ -47,7 +47,7 @@ class BitmapSkPictureContentLayerUpdater : public SkPictureContentLayerUpdater { scoped_ptr<LayerPainter> painter, RenderingStatsInstrumentation* stats_instrumentation, int layer_id); - virtual ~BitmapSkPictureContentLayerUpdater(); + ~BitmapSkPictureContentLayerUpdater() override; DISALLOW_COPY_AND_ASSIGN(BitmapSkPictureContentLayerUpdater); }; diff --git a/cc/resources/content_layer_updater.h b/cc/resources/content_layer_updater.h index 33d3ee52..e0c54e5 100644 --- a/cc/resources/content_layer_updater.h +++ b/cc/resources/content_layer_updater.h @@ -22,15 +22,15 @@ class RenderingStatsInstrumentation; class CC_EXPORT ContentLayerUpdater : public LayerUpdater { public: void set_rendering_stats_instrumentation(RenderingStatsInstrumentation* rsi); - virtual void SetOpaque(bool opaque) override; - virtual void SetFillsBoundsCompletely(bool fills_bounds) override; - virtual void SetBackgroundColor(SkColor background_color) override; + void SetOpaque(bool opaque) override; + void SetFillsBoundsCompletely(bool fills_bounds) override; + void SetBackgroundColor(SkColor background_color) override; protected: ContentLayerUpdater(scoped_ptr<LayerPainter> painter, RenderingStatsInstrumentation* stats_instrumentation, int layer_id); - virtual ~ContentLayerUpdater(); + ~ContentLayerUpdater() override; // Paints the contents. |content_size| size of the underlying layer in // layer's content space. |paint_rect| bounds to paint in content space of the diff --git a/cc/resources/gpu_raster_worker_pool.cc b/cc/resources/gpu_raster_worker_pool.cc index 2d1e888..a0bc86f 100644 --- a/cc/resources/gpu_raster_worker_pool.cc +++ b/cc/resources/gpu_raster_worker_pool.cc @@ -32,10 +32,10 @@ class RasterBufferImpl : public RasterBuffer { multi_picture_draw_(multi_picture_draw) {} // Overridden from RasterBuffer: - virtual void Playback(const PicturePileImpl* picture_pile, - const gfx::Rect& rect, - float scale, - RenderingStatsInstrumentation* stats) override { + void Playback(const PicturePileImpl* picture_pile, + const gfx::Rect& rect, + float scale, + RenderingStatsInstrumentation* stats) override { if (!lock_.sk_surface()) return; diff --git a/cc/resources/gpu_raster_worker_pool.h b/cc/resources/gpu_raster_worker_pool.h index 48c17b1..a4e4197 100644 --- a/cc/resources/gpu_raster_worker_pool.h +++ b/cc/resources/gpu_raster_worker_pool.h @@ -18,7 +18,7 @@ class CC_EXPORT GpuRasterWorkerPool : public RasterWorkerPool, public Rasterizer, public RasterizerTaskClient { public: - virtual ~GpuRasterWorkerPool(); + ~GpuRasterWorkerPool() override; static scoped_ptr<RasterWorkerPool> Create( base::SequencedTaskRunner* task_runner, @@ -26,18 +26,18 @@ class CC_EXPORT GpuRasterWorkerPool : public RasterWorkerPool, ResourceProvider* resource_provider); // Overridden from RasterWorkerPool: - virtual Rasterizer* AsRasterizer() override; + Rasterizer* AsRasterizer() override; // Overridden from Rasterizer: - virtual void SetClient(RasterizerClient* client) override; - virtual void Shutdown() override; - virtual void ScheduleTasks(RasterTaskQueue* queue) override; - virtual void CheckForCompletedTasks() override; + void SetClient(RasterizerClient* client) override; + void Shutdown() override; + void ScheduleTasks(RasterTaskQueue* queue) override; + void CheckForCompletedTasks() override; // Overridden from RasterizerTaskClient: - virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster( + scoped_ptr<RasterBuffer> AcquireBufferForRaster( const Resource* resource) override; - virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; + void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; private: GpuRasterWorkerPool(base::SequencedTaskRunner* task_runner, diff --git a/cc/resources/image_layer_updater.h b/cc/resources/image_layer_updater.h index 55fdfe5..81225ba 100644 --- a/cc/resources/image_layer_updater.h +++ b/cc/resources/image_layer_updater.h @@ -19,12 +19,12 @@ class CC_EXPORT ImageLayerUpdater : public LayerUpdater { public: Resource(ImageLayerUpdater* updater, scoped_ptr<PrioritizedResource> texture); - virtual ~Resource(); + ~Resource() override; - virtual void Update(ResourceUpdateQueue* queue, - const gfx::Rect& source_rect, - const gfx::Vector2d& dest_offset, - bool partial_update) override; + void Update(ResourceUpdateQueue* queue, + const gfx::Rect& source_rect, + const gfx::Vector2d& dest_offset, + bool partial_update) override; private: ImageLayerUpdater* updater_; @@ -34,7 +34,7 @@ class CC_EXPORT ImageLayerUpdater : public LayerUpdater { static scoped_refptr<ImageLayerUpdater> Create(); - virtual scoped_ptr<LayerUpdater::Resource> CreateResource( + scoped_ptr<LayerUpdater::Resource> CreateResource( PrioritizedResourceManager*) override; void UpdateTexture(ResourceUpdateQueue* queue, @@ -48,7 +48,7 @@ class CC_EXPORT ImageLayerUpdater : public LayerUpdater { private: ImageLayerUpdater() {} - virtual ~ImageLayerUpdater() {} + ~ImageLayerUpdater() override {} SkBitmap bitmap_; diff --git a/cc/resources/one_copy_raster_worker_pool.cc b/cc/resources/one_copy_raster_worker_pool.cc index a297451..66b6ea0 100644 --- a/cc/resources/one_copy_raster_worker_pool.cc +++ b/cc/resources/one_copy_raster_worker_pool.cc @@ -32,7 +32,7 @@ class RasterBufferImpl : public RasterBuffer { resource_provider_, raster_resource_->id())) {} - virtual ~RasterBufferImpl() { + ~RasterBufferImpl() override { // First unlock raster resource. lock_.reset(); @@ -45,10 +45,10 @@ class RasterBufferImpl : public RasterBuffer { } // Overridden from RasterBuffer: - virtual void Playback(const PicturePileImpl* picture_pile, - const gfx::Rect& rect, - float scale, - RenderingStatsInstrumentation* stats) override { + void Playback(const PicturePileImpl* picture_pile, + const gfx::Rect& rect, + float scale, + RenderingStatsInstrumentation* stats) override { gfx::GpuMemoryBuffer* gpu_memory_buffer = lock_->gpu_memory_buffer(); if (!gpu_memory_buffer) return; diff --git a/cc/resources/one_copy_raster_worker_pool.h b/cc/resources/one_copy_raster_worker_pool.h index c240999..c84b559 100644 --- a/cc/resources/one_copy_raster_worker_pool.h +++ b/cc/resources/one_copy_raster_worker_pool.h @@ -27,7 +27,7 @@ class CC_EXPORT OneCopyRasterWorkerPool : public RasterWorkerPool, public Rasterizer, public RasterizerTaskClient { public: - virtual ~OneCopyRasterWorkerPool(); + ~OneCopyRasterWorkerPool() override; static scoped_ptr<RasterWorkerPool> Create( base::SequencedTaskRunner* task_runner, @@ -37,18 +37,18 @@ class CC_EXPORT OneCopyRasterWorkerPool : public RasterWorkerPool, ResourcePool* resource_pool); // Overridden from RasterWorkerPool: - virtual Rasterizer* AsRasterizer() override; + Rasterizer* AsRasterizer() override; // Overridden from Rasterizer: - virtual void SetClient(RasterizerClient* client) override; - virtual void Shutdown() override; - virtual void ScheduleTasks(RasterTaskQueue* queue) override; - virtual void CheckForCompletedTasks() override; + void SetClient(RasterizerClient* client) override; + void Shutdown() override; + void ScheduleTasks(RasterTaskQueue* queue) override; + void CheckForCompletedTasks() override; // Overridden from RasterizerTaskClient: - virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster( + scoped_ptr<RasterBuffer> AcquireBufferForRaster( const Resource* resource) override; - virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; + void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; protected: OneCopyRasterWorkerPool(base::SequencedTaskRunner* task_runner, diff --git a/cc/resources/picture_pile.h b/cc/resources/picture_pile.h index 5395843..d68387f 100644 --- a/cc/resources/picture_pile.h +++ b/cc/resources/picture_pile.h @@ -54,7 +54,7 @@ class CC_EXPORT PicturePile : public PicturePileBase { void SetPixelRecordDistanceForTesting(int d) { pixel_record_distance_ = d; } protected: - virtual ~PicturePile(); + ~PicturePile() override; private: friend class PicturePileImpl; diff --git a/cc/resources/picture_pile_impl.h b/cc/resources/picture_pile_impl.h index 75ee536..a9bef0c7 100644 --- a/cc/resources/picture_pile_impl.h +++ b/cc/resources/picture_pile_impl.h @@ -106,7 +106,7 @@ class CC_EXPORT PicturePileImpl : public PicturePileBase { PicturePileImpl(); explicit PicturePileImpl(const PicturePileBase* other); - virtual ~PicturePileImpl(); + ~PicturePileImpl() override; private: typedef std::map<const Picture*, Region> PictureRegionMap; diff --git a/cc/resources/picture_pile_unittest.cc b/cc/resources/picture_pile_unittest.cc index 338d5a6..881055f 100644 --- a/cc/resources/picture_pile_unittest.cc +++ b/cc/resources/picture_pile_unittest.cc @@ -33,7 +33,7 @@ class TestPicturePile : public PicturePile { typedef PicturePile::PictureMap PictureMap; protected: - virtual ~TestPicturePile() {} + ~TestPicturePile() override {} }; class PicturePileTestBase { diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc index 36bbe0da..9ad641a 100644 --- a/cc/resources/pixel_buffer_raster_worker_pool.cc +++ b/cc/resources/pixel_buffer_raster_worker_pool.cc @@ -30,15 +30,15 @@ class RasterBufferImpl : public RasterBuffer { memory_ = resource_provider_->MapPixelBuffer(resource_->id(), &stride_); } - virtual ~RasterBufferImpl() { + ~RasterBufferImpl() override { resource_provider_->ReleasePixelBuffer(resource_->id()); } // Overridden from RasterBuffer: - virtual void Playback(const PicturePileImpl* picture_pile, - const gfx::Rect& rect, - float scale, - RenderingStatsInstrumentation* stats) override { + void Playback(const PicturePileImpl* picture_pile, + const gfx::Rect& rect, + float scale, + RenderingStatsInstrumentation* stats) override { if (!memory_) return; diff --git a/cc/resources/pixel_buffer_raster_worker_pool.h b/cc/resources/pixel_buffer_raster_worker_pool.h index 78933aa..7fb45ec 100644 --- a/cc/resources/pixel_buffer_raster_worker_pool.h +++ b/cc/resources/pixel_buffer_raster_worker_pool.h @@ -29,7 +29,7 @@ class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool, public Rasterizer, public RasterizerTaskClient { public: - virtual ~PixelBufferRasterWorkerPool(); + ~PixelBufferRasterWorkerPool() override; static scoped_ptr<RasterWorkerPool> Create( base::SequencedTaskRunner* task_runner, @@ -39,18 +39,18 @@ class CC_EXPORT PixelBufferRasterWorkerPool : public RasterWorkerPool, size_t max_transfer_buffer_usage_bytes); // Overridden from RasterWorkerPool: - virtual Rasterizer* AsRasterizer() override; + Rasterizer* AsRasterizer() override; // Overridden from Rasterizer: - virtual void SetClient(RasterizerClient* client) override; - virtual void Shutdown() override; - virtual void ScheduleTasks(RasterTaskQueue* queue) override; - virtual void CheckForCompletedTasks() override; + void SetClient(RasterizerClient* client) override; + void Shutdown() override; + void ScheduleTasks(RasterTaskQueue* queue) override; + void CheckForCompletedTasks() override; // Overridden from RasterizerTaskClient: - virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster( + scoped_ptr<RasterBuffer> AcquireBufferForRaster( const Resource* resource) override; - virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; + void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; private: struct RasterTaskState { diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc index 9b4abe1..a52e019 100644 --- a/cc/resources/raster_worker_pool.cc +++ b/cc/resources/raster_worker_pool.cc @@ -36,13 +36,11 @@ class RasterTaskGraphRunner : public TaskGraphRunner, } } - virtual ~RasterTaskGraphRunner() { NOTREACHED(); } + ~RasterTaskGraphRunner() override { NOTREACHED(); } private: // Overridden from base::DelegateSimpleThread::Delegate: - virtual void Run() override { - TaskGraphRunner::Run(); - } + void Run() override { TaskGraphRunner::Run(); } ScopedPtrDeque<base::DelegateSimpleThread> workers_; }; @@ -63,18 +61,18 @@ class RasterFinishedTaskImpl : public RasterizerTask { on_raster_finished_callback_(on_raster_finished_callback) {} // Overridden from Task: - virtual void RunOnWorkerThread() override { + void RunOnWorkerThread() override { TRACE_EVENT0("cc", "RasterFinishedTaskImpl::RunOnWorkerThread"); RasterFinished(); } // Overridden from RasterizerTask: - virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override {} - virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override {} - virtual void RunReplyOnOriginThread() override {} + void ScheduleOnOriginThread(RasterizerTaskClient* client) override {} + void CompleteOnOriginThread(RasterizerTaskClient* client) override {} + void RunReplyOnOriginThread() override {} protected: - virtual ~RasterFinishedTaskImpl() {} + ~RasterFinishedTaskImpl() override {} void RasterFinished() { task_runner_->PostTask(FROM_HERE, on_raster_finished_callback_); diff --git a/cc/resources/raster_worker_pool_perftest.cc b/cc/resources/raster_worker_pool_perftest.cc index c4e43ac..4264373 100644 --- a/cc/resources/raster_worker_pool_perftest.cc +++ b/cc/resources/raster_worker_pool_perftest.cc @@ -33,31 +33,31 @@ namespace { class PerfGLES2Interface : public gpu::gles2::GLES2InterfaceStub { // Overridden from gpu::gles2::GLES2Interface: - virtual GLuint CreateImageCHROMIUM(ClientBuffer buffer, - GLsizei width, - GLsizei height, - GLenum internalformat) override { + GLuint CreateImageCHROMIUM(ClientBuffer buffer, + GLsizei width, + GLsizei height, + GLenum internalformat) override { return 1u; } - virtual void GenBuffers(GLsizei n, GLuint* buffers) override { + void GenBuffers(GLsizei n, GLuint* buffers) override { for (GLsizei i = 0; i < n; ++i) buffers[i] = 1u; } - virtual void GenTextures(GLsizei n, GLuint* textures) override { + void GenTextures(GLsizei n, GLuint* textures) override { for (GLsizei i = 0; i < n; ++i) textures[i] = 1u; } - virtual void GetIntegerv(GLenum pname, GLint* params) override { + void GetIntegerv(GLenum pname, GLint* params) override { if (pname == GL_MAX_TEXTURE_SIZE) *params = INT_MAX; } - virtual void GenQueriesEXT(GLsizei n, GLuint* queries) override { + void GenQueriesEXT(GLsizei n, GLuint* queries) override { for (GLsizei i = 0; i < n; ++i) queries[i] = 1u; } - virtual void GetQueryObjectuivEXT(GLuint query, - GLenum pname, - GLuint* params) override { + void GetQueryObjectuivEXT(GLuint query, + GLenum pname, + GLuint* params) override { if (pname == GL_QUERY_RESULT_AVAILABLE_EXT) *params = 1; } @@ -67,28 +67,28 @@ class PerfContextProvider : public ContextProvider { public: PerfContextProvider() : context_gl_(new PerfGLES2Interface) {} - virtual bool BindToCurrentThread() override { return true; } - virtual Capabilities ContextCapabilities() override { + bool BindToCurrentThread() override { return true; } + Capabilities ContextCapabilities() override { Capabilities capabilities; capabilities.gpu.image = true; capabilities.gpu.sync_query = true; return capabilities; } - virtual gpu::gles2::GLES2Interface* ContextGL() override { - return context_gl_.get(); + gpu::gles2::GLES2Interface* ContextGL() override { return context_gl_.get(); } + gpu::ContextSupport* ContextSupport() override { return &support_; } + class GrContext* GrContext() override { + return NULL; } - virtual gpu::ContextSupport* ContextSupport() override { return &support_; } - virtual class GrContext* GrContext() override { return NULL; } - virtual bool IsContextLost() override { return false; } - virtual void VerifyContexts() override {} - virtual void DeleteCachedResources() override {} - virtual bool DestroyedOnMainThread() override { return false; } - virtual void SetLostContextCallback(const LostContextCallback& cb) override {} - virtual void SetMemoryPolicyChangedCallback( + bool IsContextLost() override { return false; } + void VerifyContexts() override {} + void DeleteCachedResources() override {} + bool DestroyedOnMainThread() override { return false; } + void SetLostContextCallback(const LostContextCallback& cb) override {} + void SetMemoryPolicyChangedCallback( const MemoryPolicyChangedCallback& cb) override {} private: - virtual ~PerfContextProvider() {} + ~PerfContextProvider() override {} scoped_ptr<PerfGLES2Interface> context_gl_; TestContextSupport support_; @@ -111,12 +111,12 @@ class PerfImageDecodeTaskImpl : public ImageDecodeTask { PerfImageDecodeTaskImpl() {} // Overridden from Task: - virtual void RunOnWorkerThread() override {} + void RunOnWorkerThread() override {} // Overridden from RasterizerTask: - virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override {} - virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override {} - virtual void RunReplyOnOriginThread() override { Reset(); } + void ScheduleOnOriginThread(RasterizerTaskClient* client) override {} + void CompleteOnOriginThread(RasterizerTaskClient* client) override {} + void RunReplyOnOriginThread() override { Reset(); } void Reset() { did_run_ = false; @@ -124,7 +124,7 @@ class PerfImageDecodeTaskImpl : public ImageDecodeTask { } protected: - virtual ~PerfImageDecodeTaskImpl() {} + ~PerfImageDecodeTaskImpl() override {} private: DISALLOW_COPY_AND_ASSIGN(PerfImageDecodeTaskImpl); @@ -137,16 +137,16 @@ class PerfRasterTaskImpl : public RasterTask { : RasterTask(resource.get(), dependencies), resource_(resource.Pass()) {} // Overridden from Task: - virtual void RunOnWorkerThread() override {} + void RunOnWorkerThread() override {} // Overridden from RasterizerTask: - virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override { + void ScheduleOnOriginThread(RasterizerTaskClient* client) override { raster_buffer_ = client->AcquireBufferForRaster(resource()); } - virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override { + void CompleteOnOriginThread(RasterizerTaskClient* client) override { client->ReleaseBufferForRaster(raster_buffer_.Pass()); } - virtual void RunReplyOnOriginThread() override { Reset(); } + void RunReplyOnOriginThread() override { Reset(); } void Reset() { did_run_ = false; @@ -154,7 +154,7 @@ class PerfRasterTaskImpl : public RasterTask { } protected: - virtual ~PerfRasterTaskImpl() {} + ~PerfRasterTaskImpl() override {} private: scoped_ptr<ScopedResource> resource_; @@ -282,10 +282,10 @@ class RasterWorkerPoolPerfTest } // Overriden from RasterizerClient: - virtual void DidFinishRunningTasks(TaskSet task_set) override { + void DidFinishRunningTasks(TaskSet task_set) override { raster_worker_pool_->AsRasterizer()->CheckForCompletedTasks(); } - virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const override { + TaskSetCollection TasksThatShouldBeForcedToComplete() const override { return TaskSetCollection(); } diff --git a/cc/resources/raster_worker_pool_unittest.cc b/cc/resources/raster_worker_pool_unittest.cc index 7e3d1f9..2227128 100644 --- a/cc/resources/raster_worker_pool_unittest.cc +++ b/cc/resources/raster_worker_pool_unittest.cc @@ -58,24 +58,24 @@ class TestRasterTaskImpl : public RasterTask { gfx::Size(1, 1))) {} // Overridden from Task: - virtual void RunOnWorkerThread() override { + void RunOnWorkerThread() override { raster_buffer_->Playback( picture_pile_.get(), gfx::Rect(0, 0, 1, 1), 1.0, NULL); } // Overridden from RasterizerTask: - virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override { + void ScheduleOnOriginThread(RasterizerTaskClient* client) override { raster_buffer_ = client->AcquireBufferForRaster(resource()); } - virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override { + void CompleteOnOriginThread(RasterizerTaskClient* client) override { client->ReleaseBufferForRaster(raster_buffer_.Pass()); } - virtual void RunReplyOnOriginThread() override { + void RunReplyOnOriginThread() override { reply_.Run(PicturePileImpl::Analysis(), !HasFinishedRunning()); } protected: - virtual ~TestRasterTaskImpl() {} + ~TestRasterTaskImpl() override {} private: const Reply reply_; @@ -94,16 +94,16 @@ class BlockingTestRasterTaskImpl : public TestRasterTaskImpl { : TestRasterTaskImpl(resource, reply, dependencies), lock_(lock) {} // Overridden from Task: - virtual void RunOnWorkerThread() override { + void RunOnWorkerThread() override { base::AutoLock lock(*lock_); TestRasterTaskImpl::RunOnWorkerThread(); } // Overridden from RasterizerTask: - virtual void RunReplyOnOriginThread() override {} + void RunReplyOnOriginThread() override {} protected: - virtual ~BlockingTestRasterTaskImpl() {} + ~BlockingTestRasterTaskImpl() override {} private: base::Lock* lock_; @@ -185,13 +185,13 @@ class RasterWorkerPoolTest } // Overriden from RasterWorkerPoolClient: - virtual void DidFinishRunningTasks(TaskSet task_set) override { + void DidFinishRunningTasks(TaskSet task_set) override { if (task_set == ALL) { raster_worker_pool_->AsRasterizer()->CheckForCompletedTasks(); base::MessageLoop::current()->Quit(); } } - virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const override { + TaskSetCollection TasksThatShouldBeForcedToComplete() const override { return TaskSetCollection(); } diff --git a/cc/resources/rasterizer.h b/cc/resources/rasterizer.h index 8013593..526058c 100644 --- a/cc/resources/rasterizer.h +++ b/cc/resources/rasterizer.h @@ -50,7 +50,7 @@ class CC_EXPORT RasterizerTask : public Task { protected: RasterizerTask(); - virtual ~RasterizerTask(); + ~RasterizerTask() override; bool did_schedule_; bool did_complete_; @@ -61,11 +61,11 @@ class CC_EXPORT ImageDecodeTask : public RasterizerTask { typedef std::vector<scoped_refptr<ImageDecodeTask>> Vector; // Overridden from RasterizerTask: - virtual ImageDecodeTask* AsImageDecodeTask() override; + ImageDecodeTask* AsImageDecodeTask() override; protected: ImageDecodeTask(); - virtual ~ImageDecodeTask(); + ~ImageDecodeTask() override; }; class CC_EXPORT RasterTask : public RasterizerTask { @@ -73,14 +73,14 @@ class CC_EXPORT RasterTask : public RasterizerTask { typedef std::vector<scoped_refptr<RasterTask>> Vector; // Overridden from RasterizerTask: - virtual RasterTask* AsRasterTask() override; + RasterTask* AsRasterTask() override; const Resource* resource() const { return resource_; } const ImageDecodeTask::Vector& dependencies() const { return dependencies_; } protected: RasterTask(const Resource* resource, ImageDecodeTask::Vector* dependencies); - virtual ~RasterTask(); + ~RasterTask() override; private: const Resource* resource_; diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc index 578c2e9..1697ac2 100644 --- a/cc/resources/resource_provider.cc +++ b/cc/resources/resource_provider.cc @@ -156,13 +156,13 @@ class TextureIdAllocator : public IdAllocator { TextureIdAllocator(GLES2Interface* gl, size_t texture_id_allocation_chunk_size) : IdAllocator(gl, texture_id_allocation_chunk_size) {} - virtual ~TextureIdAllocator() { + ~TextureIdAllocator() override { gl_->DeleteTextures(id_allocation_chunk_size_ - next_id_index_, ids_.get() + next_id_index_); } // Overridden from IdAllocator: - virtual GLuint NextId() override { + GLuint NextId() override { if (next_id_index_ == id_allocation_chunk_size_) { gl_->GenTextures(id_allocation_chunk_size_, ids_.get()); next_id_index_ = 0; @@ -179,13 +179,13 @@ class BufferIdAllocator : public IdAllocator { public: BufferIdAllocator(GLES2Interface* gl, size_t buffer_id_allocation_chunk_size) : IdAllocator(gl, buffer_id_allocation_chunk_size) {} - virtual ~BufferIdAllocator() { + ~BufferIdAllocator() override { gl_->DeleteBuffers(id_allocation_chunk_size_ - next_id_index_, ids_.get() + next_id_index_); } // Overridden from IdAllocator: - virtual GLuint NextId() override { + GLuint NextId() override { if (next_id_index_ == id_allocation_chunk_size_) { gl_->GenBuffers(id_allocation_chunk_size_, ids_.get()); next_id_index_ = 0; @@ -206,8 +206,8 @@ class QueryFence : public ResourceProvider::Fence { : gl_(gl), query_id_(query_id) {} // Overridden from ResourceProvider::Fence: - virtual void Set() override {} - virtual bool HasPassed() override { + void Set() override {} + bool HasPassed() override { unsigned available = 1; gl_->GetQueryObjectuivEXT( query_id_, GL_QUERY_RESULT_AVAILABLE_EXT, &available); @@ -215,7 +215,7 @@ class QueryFence : public ResourceProvider::Fence { } private: - virtual ~QueryFence() {} + ~QueryFence() override {} gpu::gles2::GLES2Interface* gl_; unsigned query_id_; diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h index dc8e7b6..1e70132 100644 --- a/cc/resources/resource_provider.h +++ b/cc/resources/resource_provider.h @@ -238,7 +238,7 @@ class CC_EXPORT ResourceProvider { ResourceProvider::ResourceId resource_id, GLenum unit, GLenum filter); - virtual ~ScopedSamplerGL(); + ~ScopedSamplerGL() override; GLenum target() const { return target_; } diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc index 3daef66..3aea34f 100644 --- a/cc/resources/resource_provider_unittest.cc +++ b/cc/resources/resource_provider_unittest.cc @@ -170,7 +170,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { return make_scoped_ptr(new ResourceProviderContext(shared_data)); } - virtual GLuint insertSyncPoint() override { + GLuint insertSyncPoint() override { uint32 sync_point = shared_data_->InsertSyncPoint(); // Commit the produceTextureCHROMIUM calls at this point, so that // they're associated with the sync point. @@ -185,17 +185,17 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { return sync_point; } - virtual void waitSyncPoint(GLuint sync_point) override { + void waitSyncPoint(GLuint sync_point) override { last_waited_sync_point_ = std::max(sync_point, last_waited_sync_point_); } unsigned last_waited_sync_point() const { return last_waited_sync_point_; } - virtual void texStorage2DEXT(GLenum target, - GLint levels, - GLuint internalformat, - GLint width, - GLint height) override { + void texStorage2DEXT(GLenum target, + GLint levels, + GLuint internalformat, + GLint width, + GLint height) override { CheckTextureIsBound(target); ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); ASSERT_EQ(1, levels); @@ -212,15 +212,15 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { AllocateTexture(gfx::Size(width, height), format); } - virtual void texImage2D(GLenum target, - GLint level, - GLenum internalformat, - GLsizei width, - GLsizei height, - GLint border, - GLenum format, - GLenum type, - const void* pixels) override { + void texImage2D(GLenum target, + GLint level, + GLenum internalformat, + GLsizei width, + GLsizei height, + GLint border, + GLenum format, + GLenum type, + const void* pixels) override { CheckTextureIsBound(target); ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); ASSERT_FALSE(level); @@ -232,15 +232,15 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { SetPixels(0, 0, width, height, pixels); } - virtual void texSubImage2D(GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - const void* pixels) override { + void texSubImage2D(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const void* pixels) override { CheckTextureIsBound(target); ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); ASSERT_FALSE(level); @@ -253,12 +253,11 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { SetPixels(xoffset, yoffset, width, height, pixels); } - virtual void genMailboxCHROMIUM(GLbyte* mailbox) override { + void genMailboxCHROMIUM(GLbyte* mailbox) override { return shared_data_->GenMailbox(mailbox); } - virtual void produceTextureCHROMIUM(GLenum target, - const GLbyte* mailbox) override { + void produceTextureCHROMIUM(GLenum target, const GLbyte* mailbox) override { CheckTextureIsBound(target); // Delay moving the texture into the mailbox until the next @@ -271,8 +270,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { pending_produce_textures_.push_back(pending.Pass()); } - virtual void consumeTextureCHROMIUM(GLenum target, - const GLbyte* mailbox) override { + void consumeTextureCHROMIUM(GLenum target, const GLbyte* mailbox) override { CheckTextureIsBound(target); base::AutoLock lock_for_texture_access(namespace_->lock); scoped_refptr<TestTexture> texture = @@ -3604,11 +3602,11 @@ INSTANTIATE_TEST_CASE_P( class TextureIdAllocationTrackingContext : public TestWebGraphicsContext3D { public: - virtual GLuint NextTextureId() override { + GLuint NextTextureId() override { base::AutoLock lock(namespace_->lock); return namespace_->next_texture_id++; } - virtual void RetireTextureId(GLuint) override {} + void RetireTextureId(GLuint) override {} GLuint PeekTextureId() { base::AutoLock lock(namespace_->lock); return namespace_->next_texture_id; diff --git a/cc/resources/resource_update_controller_unittest.cc b/cc/resources/resource_update_controller_unittest.cc index 361050d..49f7b47 100644 --- a/cc/resources/resource_update_controller_unittest.cc +++ b/cc/resources/resource_update_controller_unittest.cc @@ -32,20 +32,19 @@ class WebGraphicsContext3DForUploadTest : public TestWebGraphicsContext3D { explicit WebGraphicsContext3DForUploadTest(ResourceUpdateControllerTest* test) : test_(test) {} - virtual void flush() override; - virtual void shallowFlushCHROMIUM() override; - virtual void texSubImage2D(GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - const void* pixels) override; - - virtual void getQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* value) - override; + void flush() override; + void shallowFlushCHROMIUM() override; + void texSubImage2D(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const void* pixels) override; + + void getQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* value) override; private: ResourceUpdateControllerTest* test_; @@ -329,7 +328,7 @@ class FakeResourceUpdateControllerClient void Reset() { ready_to_finalize_called_ = false; } bool ReadyToFinalizeCalled() const { return ready_to_finalize_called_; } - virtual void ReadyToFinalizeTextureUpdates() override { + void ReadyToFinalizeTextureUpdates() override { ready_to_finalize_called_ = true; } @@ -353,7 +352,7 @@ class FakeResourceUpdateController : public ResourceUpdateController { void SetUpdateTextureTime(base::TimeDelta time) { update_textures_time_ = time; } - virtual base::TimeTicks UpdateMoreTexturesCompletionTime() override { + base::TimeTicks UpdateMoreTexturesCompletionTime() override { size_t total_updates = resource_provider_->NumBlockingUploads() + update_more_textures_size_; return now_ + total_updates * update_textures_time_; @@ -361,7 +360,7 @@ class FakeResourceUpdateController : public ResourceUpdateController { void SetUpdateMoreTexturesSize(size_t size) { update_more_textures_size_ = size; } - virtual size_t UpdateMoreTexturesSize() const override { + size_t UpdateMoreTexturesSize() const override { return update_more_textures_size_; } diff --git a/cc/resources/scoped_ui_resource.h b/cc/resources/scoped_ui_resource.h index 9d4b937..f7def7f 100644 --- a/cc/resources/scoped_ui_resource.h +++ b/cc/resources/scoped_ui_resource.h @@ -25,11 +25,10 @@ class CC_EXPORT ScopedUIResource : public UIResourceClient { public: static scoped_ptr<ScopedUIResource> Create(LayerTreeHost* host, const UIResourceBitmap& bitmap); - virtual ~ScopedUIResource(); + ~ScopedUIResource() override; // UIResourceClient implementation. - virtual UIResourceBitmap GetBitmap(UIResourceId uid, - bool resource_lost) override; + UIResourceBitmap GetBitmap(UIResourceId uid, bool resource_lost) override; UIResourceId id() { return id_; } protected: diff --git a/cc/resources/skpicture_content_layer_updater.h b/cc/resources/skpicture_content_layer_updater.h index 55edade..ec49aae 100644 --- a/cc/resources/skpicture_content_layer_updater.h +++ b/cc/resources/skpicture_content_layer_updater.h @@ -23,13 +23,13 @@ class SkPictureContentLayerUpdater : public ContentLayerUpdater { scoped_ptr<LayerPainter> painter, RenderingStatsInstrumentation* stats_instrumentation, int layer_id); - virtual ~SkPictureContentLayerUpdater(); + ~SkPictureContentLayerUpdater() override; - virtual void PrepareToUpdate(const gfx::Size& content_size, - const gfx::Rect& paint_rect, - const gfx::Size& tile_size, - float contents_width_scale, - float contents_height_scale) override; + void PrepareToUpdate(const gfx::Size& content_size, + const gfx::Rect& paint_rect, + const gfx::Size& tile_size, + float contents_width_scale, + float contents_height_scale) override; void DrawPicture(SkCanvas* canvas); private: diff --git a/cc/resources/task_graph_runner_perftest.cc b/cc/resources/task_graph_runner_perftest.cc index 2ce6dc8..7809e58 100644 --- a/cc/resources/task_graph_runner_perftest.cc +++ b/cc/resources/task_graph_runner_perftest.cc @@ -27,12 +27,12 @@ class PerfTaskImpl : public Task { PerfTaskImpl() {} // Overridden from Task: - virtual void RunOnWorkerThread() override {} + void RunOnWorkerThread() override {} void Reset() { did_run_ = false; } private: - virtual ~PerfTaskImpl() {} + ~PerfTaskImpl() override {} DISALLOW_COPY_AND_ASSIGN(PerfTaskImpl); }; diff --git a/cc/resources/task_graph_runner_unittest.cc b/cc/resources/task_graph_runner_unittest.cc index 6e5a785..ad23b66 100644 --- a/cc/resources/task_graph_runner_unittest.cc +++ b/cc/resources/task_graph_runner_unittest.cc @@ -118,7 +118,7 @@ class TaskGraphRunnerTestBase { : test_(test), namespace_index_(namespace_index), id_(id) {} // Overridden from Task: - virtual void RunOnWorkerThread() override { + void RunOnWorkerThread() override { test_->RunTaskOnWorkerThread(namespace_index_, id_); } @@ -127,7 +127,7 @@ class TaskGraphRunnerTestBase { } protected: - virtual ~FakeTaskImpl() {} + ~FakeTaskImpl() override {} private: TaskGraphRunnerTestBase* test_; @@ -145,10 +145,10 @@ class TaskGraphRunnerTestBase { : FakeTaskImpl(test, namespace_index, id) {} // Overridden from FakeTaskImpl: - virtual void CompleteOnOriginThread() override {} + void CompleteOnOriginThread() override {} private: - virtual ~FakeDependentTaskImpl() {} + ~FakeDependentTaskImpl() override {} DISALLOW_COPY_AND_ASSIGN(FakeDependentTaskImpl); }; @@ -189,7 +189,7 @@ class TaskGraphRunnerTest : public TaskGraphRunnerTestBase, private: // Overridden from base::DelegateSimpleThread::Delegate: - virtual void Run() override { task_graph_runner_->Run(); } + void Run() override { task_graph_runner_->Run(); } ScopedPtrDeque<base::DelegateSimpleThread> workers_; }; @@ -299,7 +299,7 @@ class TaskGraphRunnerSingleThreadTest private: // Overridden from base::DelegateSimpleThread::Delegate: - virtual void Run() override { task_graph_runner_->Run(); } + void Run() override { task_graph_runner_->Run(); } scoped_ptr<base::DelegateSimpleThread> worker_; }; diff --git a/cc/resources/texture_uploader_unittest.cc b/cc/resources/texture_uploader_unittest.cc index 335908d..7249172 100644 --- a/cc/resources/texture_uploader_unittest.cc +++ b/cc/resources/texture_uploader_unittest.cc @@ -19,7 +19,7 @@ class TextureUploadTestContext : public gpu::gles2::GLES2InterfaceStub { public: TextureUploadTestContext() : result_available_(0), unpack_alignment_(4) {} - virtual void PixelStorei(GLenum pname, GLint param) override { + void PixelStorei(GLenum pname, GLint param) override { switch (pname) { case GL_UNPACK_ALIGNMENT: // Param should be a power of two <= 8. @@ -41,9 +41,7 @@ class TextureUploadTestContext : public gpu::gles2::GLES2InterfaceStub { } } - virtual void GetQueryObjectuivEXT(GLuint, - GLenum type, - GLuint* value) override { + void GetQueryObjectuivEXT(GLuint, GLenum type, GLuint* value) override { switch (type) { case GL_QUERY_RESULT_AVAILABLE_EXT: *value = result_available_; @@ -54,15 +52,15 @@ class TextureUploadTestContext : public gpu::gles2::GLES2InterfaceStub { } } - virtual void TexSubImage2D(GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - const void* pixels) override { + void TexSubImage2D(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const void* pixels) override { EXPECT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target); EXPECT_EQ(0, level); EXPECT_LE(0, width); diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 7fa2e3e..cb9d766 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -57,7 +57,7 @@ class RasterTaskImpl : public RasterTask { reply_(reply) {} // Overridden from Task: - virtual void RunOnWorkerThread() override { + void RunOnWorkerThread() override { TRACE_EVENT0("cc", "RasterizerTaskImpl::RunOnWorkerThread"); DCHECK(picture_pile_.get()); @@ -73,20 +73,20 @@ class RasterTaskImpl : public RasterTask { } // Overridden from RasterizerTask: - virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override { + void ScheduleOnOriginThread(RasterizerTaskClient* client) override { DCHECK(!raster_buffer_); raster_buffer_ = client->AcquireBufferForRaster(resource()); } - virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override { + void CompleteOnOriginThread(RasterizerTaskClient* client) override { client->ReleaseBufferForRaster(raster_buffer_.Pass()); } - virtual void RunReplyOnOriginThread() override { + void RunReplyOnOriginThread() override { DCHECK(!raster_buffer_); reply_.Run(analysis_, !HasFinishedRunning()); } protected: - virtual ~RasterTaskImpl() { DCHECK(!raster_buffer_); } + ~RasterTaskImpl() override { DCHECK(!raster_buffer_); } private: void Analyze(const PicturePileImpl* picture_pile) { @@ -166,7 +166,7 @@ class ImageDecodeTaskImpl : public ImageDecodeTask { reply_(reply) {} // Overridden from Task: - virtual void RunOnWorkerThread() override { + void RunOnWorkerThread() override { TRACE_EVENT0("cc", "ImageDecodeTaskImpl::RunOnWorkerThread"); devtools_instrumentation::ScopedImageDecodeTask image_decode_task( @@ -177,14 +177,12 @@ class ImageDecodeTaskImpl : public ImageDecodeTask { } // Overridden from RasterizerTask: - virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override {} - virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override {} - virtual void RunReplyOnOriginThread() override { - reply_.Run(!HasFinishedRunning()); - } + void ScheduleOnOriginThread(RasterizerTaskClient* client) override {} + void CompleteOnOriginThread(RasterizerTaskClient* client) override {} + void RunReplyOnOriginThread() override { reply_.Run(!HasFinishedRunning()); } protected: - virtual ~ImageDecodeTaskImpl() {} + ~ImageDecodeTaskImpl() override {} private: skia::RefPtr<SkPixelRef> pixel_ref_; diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h index 03fb6e1..2abf177 100644 --- a/cc/resources/tile_manager.h +++ b/cc/resources/tile_manager.h @@ -99,7 +99,7 @@ class CC_EXPORT TileManager : public RasterizerClient, ResourcePool* resource_pool, Rasterizer* rasterizer, RenderingStatsInstrumentation* rendering_stats_instrumentation); - virtual ~TileManager(); + ~TileManager() override; void ManageTiles(const GlobalStateThatImpactsTilePriority& state); @@ -170,11 +170,11 @@ class CC_EXPORT TileManager : public RasterizerClient, // Overriden from RefCountedManager<Tile>: friend class Tile; - virtual void Release(Tile* tile) override; + void Release(Tile* tile) override; // Overriden from RasterizerClient: - virtual void DidFinishRunningTasks(TaskSet task_set) override; - virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const override; + void DidFinishRunningTasks(TaskSet task_set) override; + TaskSetCollection TasksThatShouldBeForcedToComplete() const override; typedef std::vector<Tile*> TileVector; typedef std::set<Tile*> TileSet; diff --git a/cc/resources/tile_manager_perftest.cc b/cc/resources/tile_manager_perftest.cc index 9766df6..ba130bfb 100644 --- a/cc/resources/tile_manager_perftest.cc +++ b/cc/resources/tile_manager_perftest.cc @@ -37,9 +37,9 @@ static const int kTimeCheckInterval = 10; class FakeRasterizerImpl : public Rasterizer, public RasterizerTaskClient { public: // Overridden from Rasterizer: - virtual void SetClient(RasterizerClient* client) override {} - virtual void Shutdown() override {} - virtual void ScheduleTasks(RasterTaskQueue* queue) override { + void SetClient(RasterizerClient* client) override {} + void Shutdown() override {} + void ScheduleTasks(RasterTaskQueue* queue) override { for (RasterTaskQueue::Item::Vector::const_iterator it = queue->items.begin(); it != queue->items.end(); @@ -53,7 +53,7 @@ class FakeRasterizerImpl : public Rasterizer, public RasterizerTaskClient { completed_tasks_.push_back(task); } } - virtual void CheckForCompletedTasks() override { + void CheckForCompletedTasks() override { for (RasterTask::Vector::iterator it = completed_tasks_.begin(); it != completed_tasks_.end(); ++it) { @@ -69,12 +69,11 @@ class FakeRasterizerImpl : public Rasterizer, public RasterizerTaskClient { } // Overridden from RasterizerTaskClient: - virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster( + scoped_ptr<RasterBuffer> AcquireBufferForRaster( const Resource* resource) override { return nullptr; } - virtual void ReleaseBufferForRaster( - scoped_ptr<RasterBuffer> buffer) override {} + void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override {} private: RasterTask::Vector completed_tasks_; diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc index f62b6e6..4d0e125 100644 --- a/cc/resources/video_resource_updater.cc +++ b/cc/resources/video_resource_updater.cc @@ -26,11 +26,11 @@ const ResourceFormat kRGBResourceFormat = RGBA_8888; class SyncPointClientImpl : public media::VideoFrame::SyncPointClient { public: explicit SyncPointClientImpl(gpu::gles2::GLES2Interface* gl) : gl_(gl) {} - virtual ~SyncPointClientImpl() {} - virtual uint32 InsertSyncPoint() override { + ~SyncPointClientImpl() override {} + uint32 InsertSyncPoint() override { return GLC(gl_, gl_->InsertSyncPointCHROMIUM()); } - virtual void WaitSyncPoint(uint32 sync_point) override { + void WaitSyncPoint(uint32 sync_point) override { GLC(gl_, gl_->WaitSyncPointCHROMIUM(sync_point)); } diff --git a/cc/resources/zero_copy_raster_worker_pool.cc b/cc/resources/zero_copy_raster_worker_pool.cc index c9533f8..10464cd 100644 --- a/cc/resources/zero_copy_raster_worker_pool.cc +++ b/cc/resources/zero_copy_raster_worker_pool.cc @@ -24,10 +24,10 @@ class RasterBufferImpl : public RasterBuffer { : lock_(resource_provider, resource->id()), resource_(resource) {} // Overridden from RasterBuffer: - virtual void Playback(const PicturePileImpl* picture_pile, - const gfx::Rect& rect, - float scale, - RenderingStatsInstrumentation* stats) override { + void Playback(const PicturePileImpl* picture_pile, + const gfx::Rect& rect, + float scale, + RenderingStatsInstrumentation* stats) override { gfx::GpuMemoryBuffer* gpu_memory_buffer = lock_.gpu_memory_buffer(); if (!gpu_memory_buffer) return; diff --git a/cc/resources/zero_copy_raster_worker_pool.h b/cc/resources/zero_copy_raster_worker_pool.h index b94713d..d1f583e 100644 --- a/cc/resources/zero_copy_raster_worker_pool.h +++ b/cc/resources/zero_copy_raster_worker_pool.h @@ -23,7 +23,7 @@ class CC_EXPORT ZeroCopyRasterWorkerPool : public RasterWorkerPool, public Rasterizer, public RasterizerTaskClient { public: - virtual ~ZeroCopyRasterWorkerPool(); + ~ZeroCopyRasterWorkerPool() override; static scoped_ptr<RasterWorkerPool> Create( base::SequencedTaskRunner* task_runner, @@ -31,18 +31,18 @@ class CC_EXPORT ZeroCopyRasterWorkerPool : public RasterWorkerPool, ResourceProvider* resource_provider); // Overridden from RasterWorkerPool: - virtual Rasterizer* AsRasterizer() override; + Rasterizer* AsRasterizer() override; // Overridden from Rasterizer: - virtual void SetClient(RasterizerClient* client) override; - virtual void Shutdown() override; - virtual void ScheduleTasks(RasterTaskQueue* queue) override; - virtual void CheckForCompletedTasks() override; + void SetClient(RasterizerClient* client) override; + void Shutdown() override; + void ScheduleTasks(RasterTaskQueue* queue) override; + void CheckForCompletedTasks() override; // Overridden from RasterizerTaskClient: - virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster( + scoped_ptr<RasterBuffer> AcquireBufferForRaster( const Resource* resource) override; - virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; + void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; protected: ZeroCopyRasterWorkerPool(base::SequencedTaskRunner* task_runner, diff --git a/cc/scheduler/begin_frame_source.h b/cc/scheduler/begin_frame_source.h index 3b8a576..3d849a4 100644 --- a/cc/scheduler/begin_frame_source.h +++ b/cc/scheduler/begin_frame_source.h @@ -71,11 +71,11 @@ class CC_EXPORT BeginFrameObserverMixIn : public BeginFrameObserver { // Traces |args| and DCHECK |args| satisfies pre-conditions then calls // OnBeginFrameMixInDelegate and updates the last_begin_frame_args_ value on // true. - virtual void OnBeginFrame(const BeginFrameArgs& args) override; - virtual const BeginFrameArgs LastUsedBeginFrameArgs() const override; + void OnBeginFrame(const BeginFrameArgs& args) override; + const BeginFrameArgs LastUsedBeginFrameArgs() const override; // Outputs last_begin_frame_args_ - virtual void AsValueInto(base::debug::TracedValue* dict) const override; + void AsValueInto(base::debug::TracedValue* dict) const override; protected: // Subclasses should override this method! @@ -131,18 +131,18 @@ class CC_EXPORT BeginFrameSource { // in their own AsValueInto implementation. class CC_EXPORT BeginFrameSourceMixIn : public BeginFrameSource { public: - virtual ~BeginFrameSourceMixIn() {} + ~BeginFrameSourceMixIn() override {} // BeginFrameSource - virtual bool NeedsBeginFrames() const override; - virtual void SetNeedsBeginFrames(bool needs_begin_frames) override; - virtual void DidFinishFrame(size_t remaining_frames) override {} - virtual void AddObserver(BeginFrameObserver* obs) override; - virtual void RemoveObserver(BeginFrameObserver* obs) override; + bool NeedsBeginFrames() const override; + void SetNeedsBeginFrames(bool needs_begin_frames) override; + void DidFinishFrame(size_t remaining_frames) override {} + void AddObserver(BeginFrameObserver* obs) override; + void RemoveObserver(BeginFrameObserver* obs) override; // Tracing support - Recommend (but not required) to call this implementation // in any override. - virtual void AsValueInto(base::debug::TracedValue* dict) const override; + void AsValueInto(base::debug::TracedValue* dict) const override; protected: BeginFrameSourceMixIn(); @@ -168,13 +168,13 @@ class CC_EXPORT BackToBackBeginFrameSource : public BeginFrameSourceMixIn { public: static scoped_ptr<BackToBackBeginFrameSource> Create( base::SingleThreadTaskRunner* task_runner); - virtual ~BackToBackBeginFrameSource(); + ~BackToBackBeginFrameSource() override; // BeginFrameSource - virtual void DidFinishFrame(size_t remaining_frames) override; + void DidFinishFrame(size_t remaining_frames) override; // Tracing - virtual void AsValueInto(base::debug::TracedValue* dict) const override; + void AsValueInto(base::debug::TracedValue* dict) const override; protected: explicit BackToBackBeginFrameSource( @@ -187,7 +187,7 @@ class CC_EXPORT BackToBackBeginFrameSource : public BeginFrameSourceMixIn { bool send_begin_frame_posted_; // BeginFrameSourceMixIn - virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override; + void OnNeedsBeginFramesChange(bool needs_begin_frames) override; void BeginFrame(); }; @@ -202,21 +202,20 @@ class CC_EXPORT SyntheticBeginFrameSource : public BeginFrameSourceMixIn, base::SingleThreadTaskRunner* task_runner, base::TimeTicks initial_vsync_timebase, base::TimeDelta initial_vsync_interval); - virtual ~SyntheticBeginFrameSource(); + ~SyntheticBeginFrameSource() override; // BeginFrameSource - virtual bool NeedsBeginFrames() const override; + bool NeedsBeginFrames() const override; // Tracing - virtual void AsValueInto(base::debug::TracedValue* dict) const override; + void AsValueInto(base::debug::TracedValue* dict) const override; // VSyncParameterObserver - virtual void OnUpdateVSyncParameters( - base::TimeTicks new_vsync_timebase, - base::TimeDelta new_vsync_interval) override; + void OnUpdateVSyncParameters(base::TimeTicks new_vsync_timebase, + base::TimeDelta new_vsync_interval) override; // TimeSourceClient - virtual void OnTimerTick() override; + void OnTimerTick() override; protected: explicit SyntheticBeginFrameSource( @@ -226,7 +225,7 @@ class CC_EXPORT SyntheticBeginFrameSource : public BeginFrameSourceMixIn, BeginFrameArgs::BeginFrameArgsType type); // BeginFrameSourceMixIn - virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override; + void OnNeedsBeginFramesChange(bool needs_begin_frames) override; scoped_refptr<DelayBasedTimeSource> time_source_; }; @@ -238,7 +237,7 @@ class CC_EXPORT BeginFrameSourceMultiplexer : public BeginFrameSourceMixIn, public BeginFrameObserver { public: static scoped_ptr<BeginFrameSourceMultiplexer> Create(); - virtual ~BeginFrameSourceMultiplexer(); + ~BeginFrameSourceMultiplexer() override; void SetMinimumInterval(base::TimeDelta new_minimum_interval); @@ -251,16 +250,16 @@ class CC_EXPORT BeginFrameSourceMultiplexer : public BeginFrameSourceMixIn, // The mux is an BeginFrameObserver as it needs to proxy the OnBeginFrame // calls to preserve the monotonicity of the BeginFrameArgs when switching // sources. - virtual void OnBeginFrame(const BeginFrameArgs& args) override; - virtual const BeginFrameArgs LastUsedBeginFrameArgs() const override; + void OnBeginFrame(const BeginFrameArgs& args) override; + const BeginFrameArgs LastUsedBeginFrameArgs() const override; // BeginFrameSource - virtual bool NeedsBeginFrames() const override; - virtual void SetNeedsBeginFrames(bool needs_begin_frames) override; - virtual void DidFinishFrame(size_t remaining_frames) override; + bool NeedsBeginFrames() const override; + void SetNeedsBeginFrames(bool needs_begin_frames) override; + void DidFinishFrame(size_t remaining_frames) override; // Tracing - virtual void AsValueInto(base::debug::TracedValue* dict) const override; + void AsValueInto(base::debug::TracedValue* dict) const override; protected: BeginFrameSourceMultiplexer(); diff --git a/cc/scheduler/begin_frame_source_unittest.cc b/cc/scheduler/begin_frame_source_unittest.cc index 8abf1a9..b741e35 100644 --- a/cc/scheduler/begin_frame_source_unittest.cc +++ b/cc/scheduler/begin_frame_source_unittest.cc @@ -256,7 +256,7 @@ class LoopingBeginFrameObserver : public BeginFrameObserverMixIn { public: BeginFrameSource* source_; - virtual void AsValueInto(base::debug::TracedValue* dict) const override { + void AsValueInto(base::debug::TracedValue* dict) const override { dict->SetString("type", "LoopingBeginFrameObserver"); dict->BeginDictionary("source"); source_->AsValueInto(dict); @@ -265,7 +265,7 @@ class LoopingBeginFrameObserver : public BeginFrameObserverMixIn { protected: // BeginFrameObserverMixIn - virtual bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override { + bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override { return true; } }; @@ -297,7 +297,7 @@ class TestBackToBackBeginFrameSource : public BackToBackBeginFrameSource { base::SingleThreadTaskRunner* task_runner) : BackToBackBeginFrameSource(task_runner), now_src_(now_src) {} - virtual base::TimeTicks Now() override { return now_src_->Now(); } + base::TimeTicks Now() override { return now_src_->Now(); } scoped_refptr<TestNowSource> now_src_; }; diff --git a/cc/scheduler/delay_based_time_source.h b/cc/scheduler/delay_based_time_source.h index 270102b..9f670d1 100644 --- a/cc/scheduler/delay_based_time_source.h +++ b/cc/scheduler/delay_based_time_source.h @@ -101,14 +101,14 @@ class DelayBasedTimeSourceHighRes : public DelayBasedTimeSource { static scoped_refptr<DelayBasedTimeSourceHighRes> Create( base::TimeDelta interval, base::SingleThreadTaskRunner* task_runner); - virtual base::TimeTicks Now() const override; + base::TimeTicks Now() const override; protected: DelayBasedTimeSourceHighRes(base::TimeDelta interval, base::SingleThreadTaskRunner* task_runner); - virtual ~DelayBasedTimeSourceHighRes(); + ~DelayBasedTimeSourceHighRes() override; - virtual std::string TypeString() const override; + std::string TypeString() const override; private: DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSourceHighRes); diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h index 6da951c..f470d17 100644 --- a/cc/scheduler/scheduler.h +++ b/cc/scheduler/scheduler.h @@ -91,10 +91,10 @@ class CC_EXPORT Scheduler : public BeginFrameObserverMixIn, &frame_sources_constructor)); } - virtual ~Scheduler(); + ~Scheduler() override; // base::PowerObserver method. - virtual void OnPowerStateChange(bool on_battery_power) override; + void OnPowerStateChange(bool on_battery_power) override; const SchedulerSettings& settings() const { return settings_; } @@ -158,14 +158,14 @@ class CC_EXPORT Scheduler : public BeginFrameObserverMixIn, base::TimeTicks LastBeginImplFrameTime(); scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; - virtual void AsValueInto(base::debug::TracedValue* value) const override; + void AsValueInto(base::debug::TracedValue* value) const override; void SetContinuousPainting(bool continuous_painting) { state_machine_.SetContinuousPainting(continuous_painting); } // BeginFrameObserverMixin - virtual bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override; + bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override; protected: Scheduler(SchedulerClient* client, diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc index 84d9fa3..7da6267 100644 --- a/cc/scheduler/scheduler_unittest.cc +++ b/cc/scheduler/scheduler_unittest.cc @@ -55,7 +55,7 @@ class FakeSchedulerClient : public SchedulerClient { FakeSchedulerClient* client) : client_(client) {} - virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override { + void OnNeedsBeginFramesChange(bool needs_begin_frames) override { if (needs_begin_frames) { client_->actions_.push_back("SetNeedsBeginFrames(true)"); } else { @@ -68,15 +68,13 @@ class FakeSchedulerClient : public SchedulerClient { class FakePowerMonitorSource : public base::PowerMonitorSource { public: FakePowerMonitorSource() {} - virtual ~FakePowerMonitorSource() {} + ~FakePowerMonitorSource() override {} void GeneratePowerStateEvent(bool on_battery_power) { on_battery_power_impl_ = on_battery_power; ProcessPowerEvent(POWER_STATE_EVENT); base::MessageLoop::current()->RunUntilIdle(); } - virtual bool IsOnBatteryPowerImpl() override { - return on_battery_power_impl_; - } + bool IsOnBatteryPowerImpl() override { return on_battery_power_impl_; } private: bool on_battery_power_impl_; @@ -134,7 +132,7 @@ class FakeSchedulerClient : public SchedulerClient { return scheduler_->settings().begin_frame_scheduling_enabled && scheduler_->settings().throttle_frame_production; } - virtual FakeBeginFrameSource* ExternalBeginFrameSource() override { + FakeBeginFrameSource* ExternalBeginFrameSource() override { return &fake_frame_source_; } @@ -192,19 +190,19 @@ class FakeSchedulerClient : public SchedulerClient { redraw_will_happen_if_update_visible_tiles_happens_ = redraw; } // SchedulerClient implementation. - virtual void WillBeginImplFrame(const BeginFrameArgs& args) override { + void WillBeginImplFrame(const BeginFrameArgs& args) override { actions_.push_back("WillBeginImplFrame"); states_.push_back(scheduler_->AsValue()); } - virtual void ScheduledActionSendBeginMainFrame() override { + void ScheduledActionSendBeginMainFrame() override { actions_.push_back("ScheduledActionSendBeginMainFrame"); states_.push_back(scheduler_->AsValue()); } - virtual void ScheduledActionAnimate() override { + void ScheduledActionAnimate() override { actions_.push_back("ScheduledActionAnimate"); states_.push_back(scheduler_->AsValue()); } - virtual DrawResult ScheduledActionDrawAndSwapIfPossible() override { + DrawResult ScheduledActionDrawAndSwapIfPossible() override { actions_.push_back("ScheduledActionDrawAndSwapIfPossible"); states_.push_back(scheduler_->AsValue()); num_draws_++; @@ -226,48 +224,46 @@ class FakeSchedulerClient : public SchedulerClient { } return result; } - virtual DrawResult ScheduledActionDrawAndSwapForced() override { + DrawResult ScheduledActionDrawAndSwapForced() override { actions_.push_back("ScheduledActionDrawAndSwapForced"); states_.push_back(scheduler_->AsValue()); return DRAW_SUCCESS; } - virtual void ScheduledActionCommit() override { + void ScheduledActionCommit() override { actions_.push_back("ScheduledActionCommit"); states_.push_back(scheduler_->AsValue()); } - virtual void ScheduledActionUpdateVisibleTiles() override { + void ScheduledActionUpdateVisibleTiles() override { actions_.push_back("ScheduledActionUpdateVisibleTiles"); states_.push_back(scheduler_->AsValue()); if (redraw_will_happen_if_update_visible_tiles_happens_) scheduler_->SetNeedsRedraw(); } - virtual void ScheduledActionActivateSyncTree() override { + void ScheduledActionActivateSyncTree() override { actions_.push_back("ScheduledActionActivateSyncTree"); states_.push_back(scheduler_->AsValue()); } - virtual void ScheduledActionBeginOutputSurfaceCreation() override { + void ScheduledActionBeginOutputSurfaceCreation() override { actions_.push_back("ScheduledActionBeginOutputSurfaceCreation"); states_.push_back(scheduler_->AsValue()); } - virtual void ScheduledActionManageTiles() override { + void ScheduledActionManageTiles() override { actions_.push_back("ScheduledActionManageTiles"); states_.push_back(scheduler_->AsValue()); } - virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) override { + void DidAnticipatedDrawTimeChange(base::TimeTicks) override { if (log_anticipated_draw_time_change_) actions_.push_back("DidAnticipatedDrawTimeChange"); } - virtual base::TimeDelta DrawDurationEstimate() override { - return base::TimeDelta(); - } - virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() override { + base::TimeDelta DrawDurationEstimate() override { return base::TimeDelta(); } + base::TimeDelta BeginMainFrameToCommitDurationEstimate() override { return base::TimeDelta(); } - virtual base::TimeDelta CommitToActivateDurationEstimate() override { + base::TimeDelta CommitToActivateDurationEstimate() override { return base::TimeDelta(); } - virtual void DidBeginImplFrameDeadline() override {} + void DidBeginImplFrameDeadline() override {} base::Callback<bool(void)> ImplFrameDeadlinePending(bool state) { return base::Bind(&FakeSchedulerClient::ImplFrameDeadlinePendingCallback, @@ -491,23 +487,22 @@ TEST(SchedulerTest, RequestCommitAfterBeginMainFrameSent) { class SchedulerClientThatsetNeedsDrawInsideDraw : public FakeSchedulerClient { public: - virtual void ScheduledActionSendBeginMainFrame() override {} - virtual DrawResult ScheduledActionDrawAndSwapIfPossible() - override { + void ScheduledActionSendBeginMainFrame() override {} + DrawResult ScheduledActionDrawAndSwapIfPossible() override { // Only SetNeedsRedraw the first time this is called if (!num_draws_) scheduler_->SetNeedsRedraw(); return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible(); } - virtual DrawResult ScheduledActionDrawAndSwapForced() override { + DrawResult ScheduledActionDrawAndSwapForced() override { NOTREACHED(); return DRAW_SUCCESS; } - virtual void ScheduledActionCommit() override {} - virtual void ScheduledActionBeginOutputSurfaceCreation() override {} - virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) override {} + void ScheduledActionCommit() override {} + void ScheduledActionBeginOutputSurfaceCreation() override {} + void DidAnticipatedDrawTimeChange(base::TimeTicks) override {} }; // Tests for two different situations: @@ -602,9 +597,8 @@ class SchedulerClientThatSetNeedsCommitInsideDraw : public FakeSchedulerClient { SchedulerClientThatSetNeedsCommitInsideDraw() : set_needs_commit_on_next_draw_(false) {} - virtual void ScheduledActionSendBeginMainFrame() override {} - virtual DrawResult ScheduledActionDrawAndSwapIfPossible() - override { + void ScheduledActionSendBeginMainFrame() override {} + DrawResult ScheduledActionDrawAndSwapIfPossible() override { // Only SetNeedsCommit the first time this is called if (set_needs_commit_on_next_draw_) { scheduler_->SetNeedsCommit(); @@ -613,14 +607,14 @@ class SchedulerClientThatSetNeedsCommitInsideDraw : public FakeSchedulerClient { return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible(); } - virtual DrawResult ScheduledActionDrawAndSwapForced() override { + DrawResult ScheduledActionDrawAndSwapForced() override { NOTREACHED(); return DRAW_SUCCESS; } - virtual void ScheduledActionCommit() override {} - virtual void ScheduledActionBeginOutputSurfaceCreation() override {} - virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) override {} + void ScheduledActionCommit() override {} + void ScheduledActionBeginOutputSurfaceCreation() override {} + void DidAnticipatedDrawTimeChange(base::TimeTicks) override {} void SetNeedsCommitOnNextDraw() { set_needs_commit_on_next_draw_ = true; } @@ -757,8 +751,7 @@ TEST(SchedulerTest, NoSwapWhenDrawFails) { class SchedulerClientNeedsManageTilesInDraw : public FakeSchedulerClient { public: - virtual DrawResult ScheduledActionDrawAndSwapIfPossible() - override { + DrawResult ScheduledActionDrawAndSwapIfPossible() override { scheduler_->SetNeedsManageTiles(); return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible(); } @@ -1079,13 +1072,11 @@ class SchedulerClientWithFixedEstimates : public FakeSchedulerClient { begin_main_frame_to_commit_duration), commit_to_activate_duration_(commit_to_activate_duration) {} - virtual base::TimeDelta DrawDurationEstimate() override { - return draw_duration_; - } - virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() override { + base::TimeDelta DrawDurationEstimate() override { return draw_duration_; } + base::TimeDelta BeginMainFrameToCommitDurationEstimate() override { return begin_main_frame_to_commit_duration_; } - virtual base::TimeDelta CommitToActivateDurationEstimate() override { + base::TimeDelta CommitToActivateDurationEstimate() override { return commit_to_activate_duration_; } diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h index 451a119..94202c56 100644 --- a/cc/surfaces/display.h +++ b/cc/surfaces/display.h @@ -43,7 +43,7 @@ class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, SurfaceManager* manager, SharedBitmapManager* bitmap_manager, GpuMemoryBufferManager* gpu_memory_buffer_manager); - virtual ~Display(); + ~Display() override; bool Initialize(scoped_ptr<OutputSurface> output_surface); void Resize(SurfaceId id, const gfx::Size& new_size); @@ -53,32 +53,31 @@ class CC_SURFACES_EXPORT Display : public OutputSurfaceClient, int GetMaxFramesPending(); // 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& damage_rect) override {} - virtual void BeginFrame(const BeginFrameArgs& args) override {} - virtual void DidSwapBuffers() override; - virtual void DidSwapBuffersComplete() override; - virtual void ReclaimResources(const CompositorFrameAck* ack) override {} - virtual void DidLoseOutputSurface() override; - virtual void SetExternalDrawConstraints( + void DeferredInitialize() override {} + void ReleaseGL() override {} + void CommitVSyncParameters(base::TimeTicks timebase, + base::TimeDelta interval) override; + void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override {} + void BeginFrame(const BeginFrameArgs& args) override {} + void DidSwapBuffers() override; + void DidSwapBuffersComplete() override; + void ReclaimResources(const CompositorFrameAck* ack) override {} + void DidLoseOutputSurface() 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 SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; - virtual void SetTreeActivationCallback( - const base::Closure& callback) override {} + void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; + void SetTreeActivationCallback(const base::Closure& callback) override {} // RendererClient implementation. - virtual void SetFullRootLayerDamage() override {} + void SetFullRootLayerDamage() override {} // SurfaceDamageObserver implementation. - virtual void OnSurfaceDamaged(SurfaceId surface) override; + void OnSurfaceDamaged(SurfaceId surface) override; private: void InitializeRenderer(); diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc index 243a9a4..ef369f4 100644 --- a/cc/surfaces/surface_aggregator_unittest.cc +++ b/cc/surfaces/surface_aggregator_unittest.cc @@ -42,8 +42,7 @@ gfx::Size SurfaceSize() { class EmptySurfaceFactoryClient : public SurfaceFactoryClient { public: - virtual void ReturnResources( - const ReturnedResourceArray& resources) override {} + void ReturnResources(const ReturnedResourceArray& resources) override {} }; class SurfaceAggregatorTest : public testing::Test { @@ -1147,10 +1146,9 @@ class SurfaceAggregatorWithResourcesTest : public testing::Test { class ResourceTrackingSurfaceFactoryClient : public SurfaceFactoryClient { public: ResourceTrackingSurfaceFactoryClient() {} - virtual ~ResourceTrackingSurfaceFactoryClient() {} + ~ResourceTrackingSurfaceFactoryClient() override {} - virtual void ReturnResources( - const ReturnedResourceArray& resources) override { + void ReturnResources(const ReturnedResourceArray& resources) override { returned_resources_ = resources; } diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc index ba2a888..636a5ff 100644 --- a/cc/surfaces/surface_factory_unittest.cc +++ b/cc/surfaces/surface_factory_unittest.cc @@ -17,10 +17,9 @@ namespace { class TestSurfaceFactoryClient : public SurfaceFactoryClient { public: TestSurfaceFactoryClient() {} - virtual ~TestSurfaceFactoryClient() {} + ~TestSurfaceFactoryClient() override {} - virtual void ReturnResources( - const ReturnedResourceArray& resources) override { + void ReturnResources(const ReturnedResourceArray& resources) override { returned_resources_.insert( returned_resources_.end(), resources.begin(), resources.end()); } diff --git a/cc/surfaces/surfaces_pixeltest.cc b/cc/surfaces/surfaces_pixeltest.cc index 171d74e..c70028b 100644 --- a/cc/surfaces/surfaces_pixeltest.cc +++ b/cc/surfaces/surfaces_pixeltest.cc @@ -23,8 +23,7 @@ namespace { class EmptySurfaceFactoryClient : public SurfaceFactoryClient { public: - virtual void ReturnResources( - const ReturnedResourceArray& resources) override {} + void ReturnResources(const ReturnedResourceArray& resources) override {} }; class SurfacesPixelTest : public RendererPixelTest<GLRenderer> { diff --git a/cc/test/animation_test_common.h b/cc/test/animation_test_common.h index 7b53c48..328ae84 100644 --- a/cc/test/animation_test_common.h +++ b/cc/test/animation_test_common.h @@ -24,11 +24,11 @@ class FakeFloatAnimationCurve : public FloatAnimationCurve { public: FakeFloatAnimationCurve(); explicit FakeFloatAnimationCurve(double duration); - virtual ~FakeFloatAnimationCurve(); + ~FakeFloatAnimationCurve() override; - virtual double Duration() const override; - virtual float GetValue(double now) const override; - virtual scoped_ptr<AnimationCurve> Clone() const override; + double Duration() const override; + float GetValue(double now) const override; + scoped_ptr<AnimationCurve> Clone() const override; private: double duration_; @@ -37,18 +37,18 @@ class FakeFloatAnimationCurve : public FloatAnimationCurve { class FakeTransformTransition : public TransformAnimationCurve { public: explicit FakeTransformTransition(double duration); - virtual ~FakeTransformTransition(); + ~FakeTransformTransition() override; - virtual double Duration() const override; - virtual gfx::Transform GetValue(double time) const override; - virtual bool AnimatedBoundsForBox(const gfx::BoxF& box, - gfx::BoxF* bounds) const override; - virtual bool AffectsScale() const override; - virtual bool IsTranslation() const override; - virtual bool MaximumTargetScale(bool forward_direction, - float* max_scale) const override; + double Duration() const override; + gfx::Transform GetValue(double time) const override; + bool AnimatedBoundsForBox(const gfx::BoxF& box, + gfx::BoxF* bounds) const override; + bool AffectsScale() const override; + bool IsTranslation() const override; + bool MaximumTargetScale(bool forward_direction, + float* max_scale) const override; - virtual scoped_ptr<AnimationCurve> Clone() const override; + scoped_ptr<AnimationCurve> Clone() const override; private: double duration_; @@ -57,12 +57,12 @@ class FakeTransformTransition : public TransformAnimationCurve { class FakeFloatTransition : public FloatAnimationCurve { public: FakeFloatTransition(double duration, float from, float to); - virtual ~FakeFloatTransition(); + ~FakeFloatTransition() override; - virtual double Duration() const override; - virtual float GetValue(double time) const override; + double Duration() const override; + float GetValue(double time) const override; - virtual scoped_ptr<AnimationCurve> Clone() const override; + scoped_ptr<AnimationCurve> Clone() const override; private: double duration_; @@ -73,16 +73,15 @@ class FakeFloatTransition : public FloatAnimationCurve { class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver { public: FakeLayerAnimationValueObserver(); - virtual ~FakeLayerAnimationValueObserver(); + ~FakeLayerAnimationValueObserver() override; // LayerAnimationValueObserver implementation - virtual void OnFilterAnimated(const FilterOperations& filters) override; - virtual void OnOpacityAnimated(float opacity) override; - virtual void OnTransformAnimated(const gfx::Transform& transform) override; - virtual void OnScrollOffsetAnimated( - const gfx::ScrollOffset& scroll_offset) override; - virtual void OnAnimationWaitingForDeletion() override; - virtual bool IsActive() const override; + void OnFilterAnimated(const FilterOperations& filters) override; + void OnOpacityAnimated(float opacity) override; + void OnTransformAnimated(const gfx::Transform& transform) override; + void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override; + void OnAnimationWaitingForDeletion() override; + bool IsActive() const override; const FilterOperations& filters() const { return filters_; } float opacity() const { return opacity_; } @@ -104,12 +103,12 @@ class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver { class FakeInactiveLayerAnimationValueObserver : public FakeLayerAnimationValueObserver { public: - virtual bool IsActive() const override; + bool IsActive() const override; }; class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider { public: - virtual gfx::ScrollOffset ScrollOffsetForAnimation() const override; + gfx::ScrollOffset ScrollOffsetForAnimation() const override; void set_scroll_offset(const gfx::ScrollOffset& scroll_offset) { scroll_offset_ = scroll_offset; diff --git a/cc/test/cc_test_suite.h b/cc/test/cc_test_suite.h index 6edcd6a..d2ad2b8 100644 --- a/cc/test/cc_test_suite.h +++ b/cc/test/cc_test_suite.h @@ -18,12 +18,12 @@ namespace cc { class CCTestSuite : public base::TestSuite { public: CCTestSuite(int argc, char** argv); - virtual ~CCTestSuite(); + ~CCTestSuite() override; protected: // Overridden from base::TestSuite: - virtual void Initialize() override; - virtual void Shutdown() override; + void Initialize() override; + void Shutdown() override; private: scoped_ptr<base::MessageLoop> message_loop_; diff --git a/cc/test/fake_content_layer.cc b/cc/test/fake_content_layer.cc index 4025afd..a0a01ee 100644 --- a/cc/test/fake_content_layer.cc +++ b/cc/test/fake_content_layer.cc @@ -15,7 +15,7 @@ class FakeContentLayerUpdater : public ContentLayerUpdater { using ContentLayerUpdater::paint_rect; private: - virtual ~FakeContentLayerUpdater() {} + ~FakeContentLayerUpdater() override {} }; FakeContentLayer::FakeContentLayer(ContentLayerClient* client) diff --git a/cc/test/fake_content_layer.h b/cc/test/fake_content_layer.h index 1debe85..fd09683 100644 --- a/cc/test/fake_content_layer.h +++ b/cc/test/fake_content_layer.h @@ -16,8 +16,7 @@ class FakeContentLayer : public ContentLayer { return make_scoped_refptr(new FakeContentLayer(client)); } - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; size_t update_count() const { return update_count_; } void reset_update_count() { update_count_ = 0; } @@ -25,8 +24,8 @@ class FakeContentLayer : public ContentLayer { size_t push_properties_count() const { return push_properties_count_; } void reset_push_properties_count() { push_properties_count_ = 0; } - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; gfx::Rect LastPaintRect() const; @@ -34,9 +33,9 @@ class FakeContentLayer : public ContentLayer { always_update_resources_ = always_update_resources; } - virtual void PushPropertiesTo(LayerImpl* layer) override; + void PushPropertiesTo(LayerImpl* layer) override; - virtual void OnOutputSurfaceCreated() override; + void OnOutputSurfaceCreated() override; size_t output_surface_created_count() const { return output_surface_created_count_; } @@ -45,7 +44,7 @@ class FakeContentLayer : public ContentLayer { private: explicit FakeContentLayer(ContentLayerClient* client); - virtual ~FakeContentLayer(); + ~FakeContentLayer() override; size_t update_count_; size_t push_properties_count_; diff --git a/cc/test/fake_content_layer_client.h b/cc/test/fake_content_layer_client.h index b74860d..8f13284 100644 --- a/cc/test/fake_content_layer_client.h +++ b/cc/test/fake_content_layer_client.h @@ -25,14 +25,14 @@ class FakeContentLayerClient : public ContentLayerClient { }; FakeContentLayerClient(); - virtual ~FakeContentLayerClient(); + ~FakeContentLayerClient() override; - virtual void PaintContents( + void PaintContents( SkCanvas* canvas, const gfx::Rect& rect, ContentLayerClient::GraphicsContextStatus gc_status) override; - virtual void DidChangeLayerCanUseLCDText() override {} - virtual bool FillsBoundsCompletely() const override; + void DidChangeLayerCanUseLCDText() override {} + bool FillsBoundsCompletely() const override; void set_fill_with_nonsolid_color(bool nonsolid) { fill_with_nonsolid_color_ = nonsolid; diff --git a/cc/test/fake_content_layer_impl.h b/cc/test/fake_content_layer_impl.h index f4c8f54..8a6c90b 100644 --- a/cc/test/fake_content_layer_impl.h +++ b/cc/test/fake_content_layer_impl.h @@ -16,10 +16,9 @@ class FakeContentLayerImpl : public TiledLayerImpl { LayerTreeImpl* tree_impl, int id) { return make_scoped_ptr(new FakeContentLayerImpl(tree_impl, id)); } - virtual ~FakeContentLayerImpl(); + ~FakeContentLayerImpl() override; - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; bool HaveResourceForTileAt(int i, int j); @@ -28,7 +27,7 @@ class FakeContentLayerImpl : public TiledLayerImpl { } void reset_lost_output_surface_count() { lost_output_surface_count_ = 0; } - virtual void ReleaseResources() override; + void ReleaseResources() override; private: explicit FakeContentLayerImpl(LayerTreeImpl* tree_impl, int id); diff --git a/cc/test/fake_delegated_renderer_layer.h b/cc/test/fake_delegated_renderer_layer.h index a5fca87..a8a89a2 100644 --- a/cc/test/fake_delegated_renderer_layer.h +++ b/cc/test/fake_delegated_renderer_layer.h @@ -17,12 +17,11 @@ class FakeDelegatedRendererLayer : public DelegatedRendererLayer { new FakeDelegatedRendererLayer(frame_provider)); } - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; protected: explicit FakeDelegatedRendererLayer(DelegatedFrameProvider* frame_provider); - virtual ~FakeDelegatedRendererLayer(); + ~FakeDelegatedRendererLayer() override; }; } // namespace cc diff --git a/cc/test/fake_delegated_renderer_layer_impl.h b/cc/test/fake_delegated_renderer_layer_impl.h index dc3fee7..f22370c 100644 --- a/cc/test/fake_delegated_renderer_layer_impl.h +++ b/cc/test/fake_delegated_renderer_layer_impl.h @@ -15,10 +15,9 @@ class FakeDelegatedRendererLayerImpl : public DelegatedRendererLayerImpl { LayerTreeImpl* tree_impl, int id) { return make_scoped_ptr(new FakeDelegatedRendererLayerImpl(tree_impl, id)); } - virtual ~FakeDelegatedRendererLayerImpl(); + ~FakeDelegatedRendererLayerImpl() override; - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; int ChildId() const { return ChildIdForTesting(); } const RenderPassList& RenderPassesInDrawOrder() const { diff --git a/cc/test/fake_layer_tree_host.h b/cc/test/fake_layer_tree_host.h index c288046..3daf471 100644 --- a/cc/test/fake_layer_tree_host.h +++ b/cc/test/fake_layer_tree_host.h @@ -23,10 +23,10 @@ class FakeLayerTreeHost : public LayerTreeHost { FakeLayerTreeHostClient* client, const LayerTreeSettings& settings); - virtual ~FakeLayerTreeHost(); + ~FakeLayerTreeHost() override; - virtual void SetNeedsCommit() override; - virtual void SetNeedsFullTreeSync() override {} + void SetNeedsCommit() override; + void SetNeedsFullTreeSync() override {} using LayerTreeHost::SetRootLayer; using LayerTreeHost::root_layer; diff --git a/cc/test/fake_layer_tree_host_client.h b/cc/test/fake_layer_tree_host_client.h index 9371e32..d64a5b2 100644 --- a/cc/test/fake_layer_tree_host_client.h +++ b/cc/test/fake_layer_tree_host_client.h @@ -24,34 +24,34 @@ class FakeLayerTreeHostClient : public LayerTreeHostClient, DELEGATED_SOFTWARE }; explicit FakeLayerTreeHostClient(RendererOptions options); - virtual ~FakeLayerTreeHostClient(); + ~FakeLayerTreeHostClient() override; // Caller responsible for unsetting this and maintaining the host's lifetime. void SetLayerTreeHost(LayerTreeHost* host) { host_ = host; } // LayerTreeHostClient implementation. - virtual void WillBeginMainFrame(int frame_id) override {} - virtual void DidBeginMainFrame() override {} - virtual void BeginMainFrame(const BeginFrameArgs& args) 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 {} + void WillBeginMainFrame(int frame_id) override {} + void DidBeginMainFrame() override {} + void BeginMainFrame(const BeginFrameArgs& args) 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 {} - virtual void RequestNewOutputSurface(bool fallback) override; - virtual void DidInitializeOutputSurface() override {} - virtual void WillCommit() override {} - virtual void DidCommit() override {} - virtual void DidCommitAndDrawFrame() override {} - virtual void DidCompleteSwapBuffers() override {} + void RequestNewOutputSurface(bool fallback) override; + void DidInitializeOutputSurface() override {} + void WillCommit() override {} + void DidCommit() override {} + void DidCommitAndDrawFrame() override {} + void DidCompleteSwapBuffers() override {} // LayerTreeHostSingleThreadClient implementation. - virtual void DidPostSwapBuffers() override {} - virtual void DidAbortSwapBuffers() override {} + void DidPostSwapBuffers() override {} + void DidAbortSwapBuffers() override {} private: bool use_software_rendering_; diff --git a/cc/test/fake_layer_tree_host_impl.h b/cc/test/fake_layer_tree_host_impl.h index 558007e..7403c07 100644 --- a/cc/test/fake_layer_tree_host_impl.h +++ b/cc/test/fake_layer_tree_host_impl.h @@ -18,7 +18,7 @@ class FakeLayerTreeHostImpl : public LayerTreeHostImpl { FakeLayerTreeHostImpl(const LayerTreeSettings& settings, Proxy* proxy, SharedBitmapManager* manager); - virtual ~FakeLayerTreeHostImpl(); + ~FakeLayerTreeHostImpl() override; void ForcePrepareToDraw() { LayerTreeHostImpl::FrameData frame_data; @@ -26,9 +26,9 @@ class FakeLayerTreeHostImpl : public LayerTreeHostImpl { DidDrawAllLayers(frame_data); } - virtual void CreatePendingTree() override; + void CreatePendingTree() override; - virtual BeginFrameArgs CurrentBeginFrameArgs() const override; + BeginFrameArgs CurrentBeginFrameArgs() const override; void SetCurrentBeginFrameArgs(const BeginFrameArgs& args); void UpdateNumChildrenAndDrawPropertiesForActiveTree(); static void UpdateNumChildrenAndDrawProperties(LayerTreeImpl* layerTree); diff --git a/cc/test/fake_layer_tree_host_impl_client.h b/cc/test/fake_layer_tree_host_impl_client.h index c73e023..d7b4704 100644 --- a/cc/test/fake_layer_tree_host_impl_client.h +++ b/cc/test/fake_layer_tree_host_impl_client.h @@ -13,35 +13,32 @@ namespace cc { class FakeLayerTreeHostImplClient : public LayerTreeHostImplClient { public: // 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& damage_rect) override {} - virtual void SetNeedsAnimateOnImplThread() override {} - virtual void DidInitializeVisibleTileOnImplThread() override {} - virtual void SetNeedsCommitOnImplThread() override {} - virtual void SetNeedsManageTilesOnImplThread() 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& damage_rect) override {} + void SetNeedsAnimateOnImplThread() override {} + void DidInitializeVisibleTileOnImplThread() override {} + void SetNeedsCommitOnImplThread() override {} + void SetNeedsManageTilesOnImplThread() 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 {} + 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 {} }; } // namespace cc diff --git a/cc/test/fake_output_surface.h b/cc/test/fake_output_surface.h index 37c0c54..59c9a8c 100644 --- a/cc/test/fake_output_surface.h +++ b/cc/test/fake_output_surface.h @@ -20,7 +20,7 @@ namespace cc { class FakeOutputSurface : public OutputSurface { public: - virtual ~FakeOutputSurface(); + ~FakeOutputSurface() override; static scoped_ptr<FakeOutputSurface> Create3d() { return make_scoped_ptr(new FakeOutputSurface( @@ -92,12 +92,12 @@ class FakeOutputSurface : public OutputSurface { CompositorFrame& last_sent_frame() { return last_sent_frame_; } size_t num_sent_frames() { return num_sent_frames_; } - virtual void SwapBuffers(CompositorFrame* frame) override; + void SwapBuffers(CompositorFrame* frame) override; - virtual void SetNeedsBeginFrame(bool enable) override; + void SetNeedsBeginFrame(bool enable) override; bool needs_begin_frame() const { return needs_begin_frame_; } - virtual bool BindToClient(OutputSurfaceClient* client) override; + bool BindToClient(OutputSurfaceClient* client) override; using OutputSurface::ReleaseGL; using OutputSurface::InitializeAndSetContext3d; @@ -110,7 +110,7 @@ class FakeOutputSurface : public OutputSurface { void ReturnResource(unsigned id, CompositorFrameAck* ack); - virtual bool HasExternalStencilTest() const override; + bool HasExternalStencilTest() const override; void set_has_external_stencil_test(bool has_test) { has_external_stencil_test_ = has_test; diff --git a/cc/test/fake_output_surface_client.h b/cc/test/fake_output_surface_client.h index 16453da..a7620b6 100644 --- a/cc/test/fake_output_surface_client.h +++ b/cc/test/fake_output_surface_client.h @@ -30,25 +30,25 @@ class FakeOutputSurfaceClient : public OutputSurfaceClient { did_lose_output_surface_called_(false), memory_policy_(0) {} - virtual void DeferredInitialize() override; - virtual void ReleaseGL() override; - virtual void CommitVSyncParameters(base::TimeTicks timebase, - base::TimeDelta interval) override {} - virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override {} - virtual void BeginFrame(const BeginFrameArgs& args) override; - virtual void DidSwapBuffers() override; - virtual void DidSwapBuffersComplete() override {} - virtual void ReclaimResources(const CompositorFrameAck* ack) override {} - virtual void DidLoseOutputSurface() override; - virtual void SetExternalDrawConstraints( + void DeferredInitialize() override; + void ReleaseGL() override; + void CommitVSyncParameters(base::TimeTicks timebase, + base::TimeDelta interval) override {} + void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override {} + void BeginFrame(const BeginFrameArgs& args) override; + void DidSwapBuffers() override; + void DidSwapBuffersComplete() override {} + void ReclaimResources(const CompositorFrameAck* ack) override {} + void DidLoseOutputSurface() 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 SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; - virtual void SetTreeActivationCallback(const base::Closure&) override {} + void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; + void SetTreeActivationCallback(const base::Closure&) override {} int begin_frame_count() { return begin_frame_count_; } int swap_count() { return swap_count_; } diff --git a/cc/test/fake_painted_scrollbar_layer.h b/cc/test/fake_painted_scrollbar_layer.h index 0fb3437..e86a2e9 100644 --- a/cc/test/fake_painted_scrollbar_layer.h +++ b/cc/test/fake_painted_scrollbar_layer.h @@ -20,10 +20,10 @@ class FakePaintedScrollbarLayer : public PaintedScrollbarLayer { int update_count() const { return update_count_; } void reset_update_count() { update_count_ = 0; } - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; - virtual void PushPropertiesTo(LayerImpl* layer) override; + void PushPropertiesTo(LayerImpl* layer) override; scoped_ptr<base::AutoReset<bool>> IgnoreSetNeedsCommit(); @@ -45,7 +45,7 @@ class FakePaintedScrollbarLayer : public PaintedScrollbarLayer { private: FakePaintedScrollbarLayer(FakeScrollbar* fake_scrollbar, int scrolling_layer_id); - virtual ~FakePaintedScrollbarLayer(); + ~FakePaintedScrollbarLayer() override; int update_count_; size_t push_properties_count_; diff --git a/cc/test/fake_picture_layer.h b/cc/test/fake_picture_layer.h index 332e63f..7aa155e 100644 --- a/cc/test/fake_picture_layer.h +++ b/cc/test/fake_picture_layer.h @@ -17,8 +17,7 @@ class FakePictureLayer : public PictureLayer { return make_scoped_refptr(new FakePictureLayer(client)); } - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; size_t update_count() const { return update_count_; } void reset_update_count() { update_count_ = 0; } @@ -30,19 +29,19 @@ class FakePictureLayer : public PictureLayer { always_update_resources_ = always_update_resources; } - virtual bool Update(ResourceUpdateQueue* queue, - const OcclusionTracker<Layer>* occlusion) override; + bool Update(ResourceUpdateQueue* queue, + const OcclusionTracker<Layer>* occlusion) override; - virtual void PushPropertiesTo(LayerImpl* layer) override; + void PushPropertiesTo(LayerImpl* layer) override; - virtual void OnOutputSurfaceCreated() override; + void OnOutputSurfaceCreated() override; size_t output_surface_created_count() const { return output_surface_created_count_; } private: explicit FakePictureLayer(ContentLayerClient* client); - virtual ~FakePictureLayer(); + ~FakePictureLayer() override; size_t update_count_; size_t push_properties_count_; diff --git a/cc/test/fake_picture_layer_impl.h b/cc/test/fake_picture_layer_impl.h index 10bd290..ef554b3 100644 --- a/cc/test/fake_picture_layer_impl.h +++ b/cc/test/fake_picture_layer_impl.h @@ -33,20 +33,18 @@ class FakePictureLayerImpl : public PictureLayerImpl { new FakePictureLayerImpl(tree_impl, id, pile, layer_bounds)); } - virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) - override; - virtual void AppendQuads(RenderPass* render_pass, - const Occlusion& occlusion_in_content_space, - AppendQuadsData* append_quads_data) override; - virtual gfx::Size CalculateTileSize( - const gfx::Size& content_bounds) const override; - - virtual void DidBecomeActive() override; + scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; + void AppendQuads(RenderPass* render_pass, + const Occlusion& occlusion_in_content_space, + AppendQuadsData* append_quads_data) override; + gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; + + void DidBecomeActive() override; size_t did_become_active_call_count() { return did_become_active_call_count_; } - virtual bool HasValidTilePriorities() const override; + bool HasValidTilePriorities() const override; void set_has_valid_tile_priorities(bool has_valid_priorities) { has_valid_tile_priorities_ = has_valid_priorities; use_set_valid_tile_priorities_flag_ = true; @@ -108,7 +106,7 @@ class FakePictureLayerImpl : public PictureLayerImpl { size_t release_resources_count() const { return release_resources_count_; } void reset_release_resources_count() { release_resources_count_ = 0; } - virtual void ReleaseResources() override; + void ReleaseResources() override; bool only_used_low_res_last_append_quads() const { return only_used_low_res_last_append_quads_; diff --git a/cc/test/fake_picture_layer_tiling_client.h b/cc/test/fake_picture_layer_tiling_client.h index 0fcab36..dece2fc 100644 --- a/cc/test/fake_picture_layer_tiling_client.h +++ b/cc/test/fake_picture_layer_tiling_client.h @@ -18,28 +18,27 @@ class FakePictureLayerTilingClient : public PictureLayerTilingClient { public: FakePictureLayerTilingClient(); explicit FakePictureLayerTilingClient(ResourceProvider* resource_provider); - virtual ~FakePictureLayerTilingClient(); + ~FakePictureLayerTilingClient() override; // PictureLayerTilingClient implementation. - virtual scoped_refptr<Tile> CreateTile( - PictureLayerTiling* tiling, const gfx::Rect& rect) override; - virtual PicturePileImpl* GetPile() override; - virtual gfx::Size CalculateTileSize( - const gfx::Size& content_bounds) const override; - virtual size_t GetMaxTilesForInterestArea() const override; - virtual float GetSkewportTargetTimeInSeconds() const override; - virtual int GetSkewportExtrapolationLimitInContentPixels() const override; - virtual bool RequiresHighResToDraw() const override; + scoped_refptr<Tile> CreateTile(PictureLayerTiling* tiling, + const gfx::Rect& rect) override; + PicturePileImpl* GetPile() override; + gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; + size_t GetMaxTilesForInterestArea() const override; + float GetSkewportTargetTimeInSeconds() const override; + int GetSkewportExtrapolationLimitInContentPixels() const override; + bool RequiresHighResToDraw() const override; void SetTileSize(const gfx::Size& tile_size); gfx::Size TileSize() const { return tile_size_; } - virtual const Region* GetInvalidation() override; - virtual const PictureLayerTiling* GetTwinTiling( + const Region* GetInvalidation() override; + const PictureLayerTiling* GetTwinTiling( const PictureLayerTiling* tiling) const override; - virtual PictureLayerTiling* GetRecycledTwinTiling( + PictureLayerTiling* GetRecycledTwinTiling( const PictureLayerTiling* tiling) override; - virtual WhichTree GetTree() const override; + WhichTree GetTree() const override; void set_twin_tiling(PictureLayerTiling* tiling) { twin_tiling_ = tiling; } void set_recycled_twin_tiling(PictureLayerTiling* tiling) { diff --git a/cc/test/fake_picture_pile_impl.h b/cc/test/fake_picture_pile_impl.h index 6877ac7..7c7e66f7 100644 --- a/cc/test/fake_picture_pile_impl.h +++ b/cc/test/fake_picture_pile_impl.h @@ -72,7 +72,7 @@ class FakePicturePileImpl : public PicturePileImpl { protected: FakePicturePileImpl(); - virtual ~FakePicturePileImpl(); + ~FakePicturePileImpl() override; FakeContentLayerClient client_; SkPaint default_paint_; diff --git a/cc/test/fake_proxy.h b/cc/test/fake_proxy.h index 21324c1..2bcacd8 100644 --- a/cc/test/fake_proxy.h +++ b/cc/test/fake_proxy.h @@ -21,30 +21,30 @@ class FakeProxy : public Proxy { void SetLayerTreeHost(LayerTreeHost* host); - 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 void MainThreadHasStoppedFlinging() override {} - virtual bool BeginMainFrameRequested() const override; - virtual bool CommitRequested() const override; - virtual void Start() override {} - virtual void Stop() override {} - virtual void ForceSerializeOnSwapBuffers() override {} - virtual size_t MaxPartialTextureUpdates() const override; - virtual bool SupportsImplScrolling() const override; - virtual void SetDebugState(const LayerTreeDebugState& debug_state) override {} - virtual bool MainFrameWillHappenForTesting() override; - virtual void AsValueInto(base::debug::TracedValue* state) const 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 {} + void MainThreadHasStoppedFlinging() override {} + bool BeginMainFrameRequested() const override; + bool CommitRequested() const override; + void Start() override {} + void Stop() override {} + void ForceSerializeOnSwapBuffers() override {} + size_t MaxPartialTextureUpdates() const override; + bool SupportsImplScrolling() const override; + void SetDebugState(const LayerTreeDebugState& debug_state) override {} + bool MainFrameWillHappenForTesting() override; + void AsValueInto(base::debug::TracedValue* state) const override; virtual RendererCapabilities& GetRendererCapabilities(); void SetMaxPartialTextureUpdates(size_t max); diff --git a/cc/test/fake_renderer_client.h b/cc/test/fake_renderer_client.h index 0248249..772b44a 100644 --- a/cc/test/fake_renderer_client.h +++ b/cc/test/fake_renderer_client.h @@ -14,7 +14,7 @@ class FakeRendererClient : public RendererClient { FakeRendererClient(); // RendererClient methods. - virtual void SetFullRootLayerDamage() override; + void SetFullRootLayerDamage() override; // Methods added for test. int set_full_root_layer_damage_count() const { diff --git a/cc/test/fake_rendering_stats_instrumentation.h b/cc/test/fake_rendering_stats_instrumentation.h index d32e4a0..ebe129b 100644 --- a/cc/test/fake_rendering_stats_instrumentation.h +++ b/cc/test/fake_rendering_stats_instrumentation.h @@ -12,7 +12,7 @@ namespace cc { class FakeRenderingStatsInstrumentation : public RenderingStatsInstrumentation { public: FakeRenderingStatsInstrumentation() {} - virtual ~FakeRenderingStatsInstrumentation() {} + ~FakeRenderingStatsInstrumentation() override {} }; } // namespace cc diff --git a/cc/test/fake_scoped_ui_resource.h b/cc/test/fake_scoped_ui_resource.h index 3de9af2..6590cbc 100644 --- a/cc/test/fake_scoped_ui_resource.h +++ b/cc/test/fake_scoped_ui_resource.h @@ -16,8 +16,7 @@ class FakeScopedUIResource : public ScopedUIResource { public: static scoped_ptr<FakeScopedUIResource> Create(LayerTreeHost* host); - virtual UIResourceBitmap GetBitmap(UIResourceId uid, - bool resource_lost) override; + UIResourceBitmap GetBitmap(UIResourceId uid, bool resource_lost) override; void ResetCounters(); int resource_create_count; diff --git a/cc/test/fake_scrollbar.h b/cc/test/fake_scrollbar.h index 638735d..2d14660 100644 --- a/cc/test/fake_scrollbar.h +++ b/cc/test/fake_scrollbar.h @@ -15,20 +15,20 @@ class FakeScrollbar : public Scrollbar { public: FakeScrollbar(); FakeScrollbar(bool paint, bool has_thumb, bool is_overlay); - virtual ~FakeScrollbar(); + ~FakeScrollbar() override; // Scrollbar implementation. - virtual ScrollbarOrientation Orientation() const override; - virtual bool IsLeftSideVerticalScrollbar() const override; - virtual gfx::Point Location() const override; - virtual bool IsOverlay() const override; - virtual bool HasThumb() const override; - virtual int ThumbThickness() const override; - virtual int ThumbLength() const override; - virtual gfx::Rect TrackRect() const override; - virtual void PaintPart(SkCanvas* canvas, - ScrollbarPart part, - const gfx::Rect& content_rect) override; + ScrollbarOrientation Orientation() const override; + bool IsLeftSideVerticalScrollbar() const override; + gfx::Point Location() const override; + bool IsOverlay() const override; + bool HasThumb() const override; + int ThumbThickness() const override; + int ThumbLength() const override; + gfx::Rect TrackRect() const override; + void PaintPart(SkCanvas* canvas, + ScrollbarPart part, + const gfx::Rect& content_rect) override; void set_location(const gfx::Point& location) { location_ = location; } void set_track_rect(const gfx::Rect& track_rect) { track_rect_ = track_rect; } diff --git a/cc/test/fake_tile_manager.cc b/cc/test/fake_tile_manager.cc index d6f704f..bebd797 100644 --- a/cc/test/fake_tile_manager.cc +++ b/cc/test/fake_tile_manager.cc @@ -17,9 +17,9 @@ namespace { class FakeRasterizerImpl : public Rasterizer, public RasterizerTaskClient { public: // Overridden from Rasterizer: - virtual void SetClient(RasterizerClient* client) override {} - virtual void Shutdown() override {} - virtual void ScheduleTasks(RasterTaskQueue* queue) override { + void SetClient(RasterizerClient* client) override {} + void Shutdown() override {} + void ScheduleTasks(RasterTaskQueue* queue) override { for (RasterTaskQueue::Item::Vector::const_iterator it = queue->items.begin(); it != queue->items.end(); @@ -33,7 +33,7 @@ class FakeRasterizerImpl : public Rasterizer, public RasterizerTaskClient { completed_tasks_.push_back(task); } } - virtual void CheckForCompletedTasks() override { + void CheckForCompletedTasks() override { for (RasterTask::Vector::iterator it = completed_tasks_.begin(); it != completed_tasks_.end(); ++it) { @@ -49,12 +49,11 @@ class FakeRasterizerImpl : public Rasterizer, public RasterizerTaskClient { } // Overridden from RasterizerTaskClient: - virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster( + scoped_ptr<RasterBuffer> AcquireBufferForRaster( const Resource* resource) override { return nullptr; } - virtual void ReleaseBufferForRaster( - scoped_ptr<RasterBuffer> buffer) override {} + void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override {} private: RasterTask::Vector completed_tasks_; diff --git a/cc/test/fake_tile_manager.h b/cc/test/fake_tile_manager.h index ee6ccf3..84f794e 100644 --- a/cc/test/fake_tile_manager.h +++ b/cc/test/fake_tile_manager.h @@ -16,13 +16,13 @@ class FakeTileManager : public TileManager { public: explicit FakeTileManager(TileManagerClient* client); FakeTileManager(TileManagerClient* client, ResourcePool* resource_pool); - virtual ~FakeTileManager(); + ~FakeTileManager() override; bool HasBeenAssignedMemory(Tile* tile); void AssignMemoryToTiles( const GlobalStateThatImpactsTilePriority& state); - virtual void Release(Tile* tile) override; + void Release(Tile* tile) override; std::vector<Tile*> tiles_for_raster; }; diff --git a/cc/test/fake_tile_manager_client.h b/cc/test/fake_tile_manager_client.h index fde6c52..4b42468 100644 --- a/cc/test/fake_tile_manager_client.h +++ b/cc/test/fake_tile_manager_client.h @@ -14,17 +14,16 @@ namespace cc { class FakeTileManagerClient : public TileManagerClient { public: FakeTileManagerClient(); - virtual ~FakeTileManagerClient(); + ~FakeTileManagerClient() 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 {} private: std::vector<PictureLayerImpl*> picture_layers_; diff --git a/cc/test/fake_ui_resource_layer_tree_host_impl.h b/cc/test/fake_ui_resource_layer_tree_host_impl.h index 9d6eac4..08a50dd 100644 --- a/cc/test/fake_ui_resource_layer_tree_host_impl.h +++ b/cc/test/fake_ui_resource_layer_tree_host_impl.h @@ -14,17 +14,17 @@ class FakeUIResourceLayerTreeHostImpl : public FakeLayerTreeHostImpl { public: explicit FakeUIResourceLayerTreeHostImpl(Proxy* proxy, SharedBitmapManager* manager); - virtual ~FakeUIResourceLayerTreeHostImpl(); + ~FakeUIResourceLayerTreeHostImpl() override; - virtual void CreateUIResource(UIResourceId uid, - const UIResourceBitmap& bitmap) override; + void CreateUIResource(UIResourceId uid, + const UIResourceBitmap& bitmap) override; - virtual void DeleteUIResource(UIResourceId uid) override; + void DeleteUIResource(UIResourceId uid) override; - virtual ResourceProvider::ResourceId ResourceIdForUIResource( + ResourceProvider::ResourceId ResourceIdForUIResource( UIResourceId uid) const override; - virtual bool IsUIResourceOpaque(UIResourceId uid) const override; + bool IsUIResourceOpaque(UIResourceId uid) const override; private: ResourceProvider::ResourceId fake_next_resource_id_; diff --git a/cc/test/fake_video_frame_provider.h b/cc/test/fake_video_frame_provider.h index f586adb..50b6b27 100644 --- a/cc/test/fake_video_frame_provider.h +++ b/cc/test/fake_video_frame_provider.h @@ -14,12 +14,11 @@ namespace cc { class FakeVideoFrameProvider : public VideoFrameProvider { public: FakeVideoFrameProvider(); - virtual ~FakeVideoFrameProvider(); + ~FakeVideoFrameProvider() override; - virtual void SetVideoFrameProviderClient(Client* client) override; - virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() override; - virtual void PutCurrentFrame(const scoped_refptr<media::VideoFrame>&) - override {} + void SetVideoFrameProviderClient(Client* client) override; + scoped_refptr<media::VideoFrame> GetCurrentFrame() override; + void PutCurrentFrame(const scoped_refptr<media::VideoFrame>&) override {} Client* client() { return client_; } diff --git a/cc/test/layer_tree_pixel_test.h b/cc/test/layer_tree_pixel_test.h index eae283b..5c220d5 100644 --- a/cc/test/layer_tree_pixel_test.h +++ b/cc/test/layer_tree_pixel_test.h @@ -34,17 +34,17 @@ class LayerTreePixelTest : public LayerTreeTest { LayerTreePixelTest(); virtual ~LayerTreePixelTest(); - virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) override; - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override; + scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) override; + void CommitCompleteOnThread(LayerTreeHostImpl* impl) override; virtual scoped_ptr<CopyOutputRequest> CreateCopyOutputRequest(); void ReadbackResult(scoped_ptr<CopyOutputResult> result); - virtual void BeginTest() override; - virtual void SetupTree() override; - virtual void AfterTest() override; - virtual void EndTest() override; + void BeginTest() override; + void SetupTree() override; + void AfterTest() override; + void EndTest() override; void TryEndTest(); diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 15a1a44..c19c63f 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc @@ -60,7 +60,7 @@ class ThreadProxyForTest : public ThreadProxy { test_hooks, host, main_task_runner, impl_task_runner)); } - virtual ~ThreadProxyForTest() {} + ~ThreadProxyForTest() override {} void test() { test_hooks_->Layout(); @@ -69,29 +69,29 @@ class ThreadProxyForTest : public ThreadProxy { private: TestHooks* test_hooks_; - virtual void ScheduledActionSendBeginMainFrame() override { + void ScheduledActionSendBeginMainFrame() override { test_hooks_->ScheduledActionWillSendBeginMainFrame(); ThreadProxy::ScheduledActionSendBeginMainFrame(); test_hooks_->ScheduledActionSendBeginMainFrame(); } - virtual DrawResult ScheduledActionDrawAndSwapIfPossible() override { + DrawResult ScheduledActionDrawAndSwapIfPossible() override { DrawResult result = ThreadProxy::ScheduledActionDrawAndSwapIfPossible(); test_hooks_->ScheduledActionDrawAndSwapIfPossible(); return result; } - virtual void ScheduledActionAnimate() override { + void ScheduledActionAnimate() override { ThreadProxy::ScheduledActionAnimate(); test_hooks_->ScheduledActionAnimate(); } - virtual void ScheduledActionCommit() override { + void ScheduledActionCommit() override { ThreadProxy::ScheduledActionCommit(); test_hooks_->ScheduledActionCommit(); } - virtual void ScheduledActionBeginOutputSurfaceCreation() override { + void ScheduledActionBeginOutputSurfaceCreation() override { ThreadProxy::ScheduledActionBeginOutputSurfaceCreation(); test_hooks_->ScheduledActionBeginOutputSurfaceCreation(); } @@ -146,65 +146,64 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl { block_notify_ready_to_activate_for_testing_(false), notify_ready_to_activate_was_blocked_(false) {} - virtual void WillBeginImplFrame(const BeginFrameArgs& args) override { + void WillBeginImplFrame(const BeginFrameArgs& args) override { LayerTreeHostImpl::WillBeginImplFrame(args); test_hooks_->WillBeginImplFrameOnThread(this, args); } - virtual void BeginMainFrameAborted(bool did_handle) override { + void BeginMainFrameAborted(bool did_handle) override { LayerTreeHostImpl::BeginMainFrameAborted(did_handle); test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); } - virtual void BeginCommit() override { + void BeginCommit() override { LayerTreeHostImpl::BeginCommit(); test_hooks_->BeginCommitOnThread(this); } - virtual void CommitComplete() override { + void CommitComplete() override { LayerTreeHostImpl::CommitComplete(); test_hooks_->CommitCompleteOnThread(this); } - virtual DrawResult PrepareToDraw(FrameData* frame) override { + DrawResult PrepareToDraw(FrameData* frame) override { DrawResult draw_result = LayerTreeHostImpl::PrepareToDraw(frame); return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result); } - virtual void DrawLayers(FrameData* frame, - base::TimeTicks frame_begin_time) override { + void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time) override { LayerTreeHostImpl::DrawLayers(frame, frame_begin_time); test_hooks_->DrawLayersOnThread(this); } - virtual bool SwapBuffers(const LayerTreeHostImpl::FrameData& frame) override { + bool SwapBuffers(const LayerTreeHostImpl::FrameData& frame) override { bool result = LayerTreeHostImpl::SwapBuffers(frame); test_hooks_->SwapBuffersOnThread(this, result); return result; } - virtual void DidSwapBuffersComplete() override { + void DidSwapBuffersComplete() override { LayerTreeHostImpl::DidSwapBuffersComplete(); test_hooks_->SwapBuffersCompleteOnThread(this); } - virtual void ReclaimResources(const CompositorFrameAck* ack) override { + void ReclaimResources(const CompositorFrameAck* ack) override { LayerTreeHostImpl::ReclaimResources(ack); } - virtual void UpdateVisibleTiles() override { + void UpdateVisibleTiles() override { LayerTreeHostImpl::UpdateVisibleTiles(); test_hooks_->UpdateVisibleTilesOnThread(this); } - virtual void NotifyReadyToActivate() override { + void NotifyReadyToActivate() override { if (block_notify_ready_to_activate_for_testing_) notify_ready_to_activate_was_blocked_ = true; else client_->NotifyReadyToActivate(); } - virtual void BlockNotifyReadyToActivateForTesting(bool block) override { + void BlockNotifyReadyToActivateForTesting(bool block) override { CHECK(settings().impl_side_painting); CHECK(proxy()->ImplThreadTaskRunner()) << "Not supported for single-threaded mode."; @@ -215,32 +214,31 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl { } } - virtual void ActivateSyncTree() override { + void ActivateSyncTree() override { test_hooks_->WillActivateTreeOnThread(this); LayerTreeHostImpl::ActivateSyncTree(); DCHECK(!pending_tree()); test_hooks_->DidActivateTreeOnThread(this); } - virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface) - override { + bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface) override { bool success = LayerTreeHostImpl::InitializeRenderer(output_surface.Pass()); test_hooks_->InitializedRendererOnThread(this, success); return success; } - virtual void SetVisible(bool visible) override { + void SetVisible(bool visible) override { LayerTreeHostImpl::SetVisible(visible); test_hooks_->DidSetVisibleOnImplTree(this, visible); } - virtual void AnimateLayers(base::TimeTicks monotonic_time) override { + void AnimateLayers(base::TimeTicks monotonic_time) override { test_hooks_->WillAnimateLayers(this, monotonic_time); LayerTreeHostImpl::AnimateLayers(monotonic_time); test_hooks_->AnimateLayers(this, monotonic_time); } - virtual void UpdateAnimationState(bool start_ready_animations) override { + void UpdateAnimationState(bool start_ready_animations) override { LayerTreeHostImpl::UpdateAnimationState(start_ready_animations); bool has_unfinished_animation = false; AnimationRegistrar::AnimationControllerMap::const_iterator iter = @@ -254,7 +252,7 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl { test_hooks_->UpdateAnimationState(this, has_unfinished_animation); } - virtual base::TimeDelta LowFrequencyAnimationInterval() const override { + base::TimeDelta LowFrequencyAnimationInterval() const override { return test_hooks_->LowFrequencyAnimationInterval(); } @@ -272,65 +270,63 @@ class LayerTreeHostClientForTesting : public LayerTreeHostClient, TestHooks* test_hooks) { return make_scoped_ptr(new LayerTreeHostClientForTesting(test_hooks)); } - virtual ~LayerTreeHostClientForTesting() {} + ~LayerTreeHostClientForTesting() override {} - virtual void WillBeginMainFrame(int frame_id) override { + void WillBeginMainFrame(int frame_id) override { test_hooks_->WillBeginMainFrame(); } - virtual void DidBeginMainFrame() override { - test_hooks_->DidBeginMainFrame(); - } + void DidBeginMainFrame() override { test_hooks_->DidBeginMainFrame(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) override { + void BeginMainFrame(const BeginFrameArgs& args) override { test_hooks_->BeginMainFrame(args); } - virtual void Layout() override { test_hooks_->Layout(); } + void Layout() override { test_hooks_->Layout(); } - virtual 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& inner_delta, + const gfx::Vector2d& outer_delta, + float page_scale, + float top_controls_delta) override { test_hooks_->ApplyViewportDeltas(inner_delta, outer_delta, page_scale, top_controls_delta); } - 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 { test_hooks_->ApplyViewportDeltas(scroll_delta, scale, top_controls_delta); } - virtual void RequestNewOutputSurface(bool fallback) override { + void RequestNewOutputSurface(bool fallback) override { test_hooks_->RequestNewOutputSurface(fallback); } - virtual void DidInitializeOutputSurface() override { + void DidInitializeOutputSurface() override { test_hooks_->DidInitializeOutputSurface(); } - virtual void DidFailToInitializeOutputSurface() override { + void DidFailToInitializeOutputSurface() override { test_hooks_->DidFailToInitializeOutputSurface(); } - virtual void WillCommit() override { test_hooks_->WillCommit(); } + void WillCommit() override { test_hooks_->WillCommit(); } - virtual void DidCommit() override { test_hooks_->DidCommit(); } + void DidCommit() override { test_hooks_->DidCommit(); } - virtual void DidCommitAndDrawFrame() override { + void DidCommitAndDrawFrame() override { test_hooks_->DidCommitAndDrawFrame(); } - virtual void DidCompleteSwapBuffers() override { + void DidCompleteSwapBuffers() override { test_hooks_->DidCompleteSwapBuffers(); } - virtual void DidPostSwapBuffers() override {} - virtual void DidAbortSwapBuffers() override {} + void DidPostSwapBuffers() override {} + void DidAbortSwapBuffers() override {} private: explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) @@ -363,7 +359,7 @@ class LayerTreeHostForTesting : public LayerTreeHost { return layer_tree_host.Pass(); } - virtual scoped_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( + scoped_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( LayerTreeHostImplClient* host_impl_client) override { return LayerTreeHostImplForTesting::Create( test_hooks_, @@ -375,7 +371,7 @@ class LayerTreeHostForTesting : public LayerTreeHost { rendering_stats_instrumentation()); } - virtual void SetNeedsCommit() override { + void SetNeedsCommit() override { if (!test_started_) return; LayerTreeHost::SetNeedsCommit(); @@ -383,7 +379,7 @@ class LayerTreeHostForTesting : public LayerTreeHost { void set_test_started(bool started) { test_started_ = started; } - virtual void DidDeferCommit() override { test_hooks_->DidDeferCommit(); } + void DidDeferCommit() override { test_hooks_->DidDeferCommit(); } private: LayerTreeHostForTesting(TestHooks* test_hooks, diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h index a36fee4..6474d6b 100644 --- a/cc/test/layer_tree_test.h +++ b/cc/test/layer_tree_test.h @@ -30,7 +30,7 @@ class TestWebGraphicsContext3D; class TestHooks : public AnimationDelegate { public: TestHooks(); - virtual ~TestHooks(); + ~TestHooks() override; void ReadSettings(const LayerTreeSettings& settings); @@ -90,13 +90,12 @@ class TestHooks : public AnimationDelegate { virtual void ScheduledActionBeginOutputSurfaceCreation() {} // Implementation of AnimationDelegate: - virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override {} - virtual void NotifyAnimationFinished( - base::TimeTicks monotonic_time, - Animation::TargetProperty target_property, - int group) override {} + void NotifyAnimationStarted(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override {} + void NotifyAnimationFinished(base::TimeTicks monotonic_time, + Animation::TargetProperty target_property, + int group) override {} virtual void RequestNewOutputSurface(bool fallback) = 0; }; @@ -188,7 +187,7 @@ class LayerTreeTest : public testing::Test, public TestHooks { void DestroyLayerTreeHost(); // By default, output surface recreation is synchronous. - virtual void RequestNewOutputSurface(bool fallback) override; + void RequestNewOutputSurface(bool fallback) override; // Override this for pixel tests, where you need a real output surface. virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback); // Override this for unit tests, which should not produce pixel output. diff --git a/cc/test/ordered_simple_task_runner.h b/cc/test/ordered_simple_task_runner.h index ee80efe7..7f63113 100644 --- a/cc/test/ordered_simple_task_runner.h +++ b/cc/test/ordered_simple_task_runner.h @@ -53,15 +53,14 @@ class OrderedSimpleTaskRunner : public base::SingleThreadTaskRunner { bool advance_now); // base::TestSimpleTaskRunner implementation: - virtual bool PostDelayedTask(const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta delay) override; - virtual bool PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta delay) override; + bool PostDelayedTask(const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) override; + bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) override; - virtual bool RunsTasksOnCurrentThread() const override; + bool RunsTasksOnCurrentThread() const override; // Set a maximum number of tasks to run at once. Useful as a timeout to // prevent infinite task loops. @@ -133,7 +132,7 @@ class OrderedSimpleTaskRunner : public base::SingleThreadTaskRunner { bool NowBeforeCallback(base::TimeTicks stop_at); bool AdvanceNowCallback(); - virtual ~OrderedSimpleTaskRunner(); + ~OrderedSimpleTaskRunner() override; base::ThreadChecker thread_checker_; diff --git a/cc/test/pixel_comparator.h b/cc/test/pixel_comparator.h index 0d418e8..7228858 100644 --- a/cc/test/pixel_comparator.h +++ b/cc/test/pixel_comparator.h @@ -23,13 +23,13 @@ class PixelComparator { class ExactPixelComparator : public PixelComparator { public: explicit ExactPixelComparator(const bool discard_alpha); - virtual ~ExactPixelComparator() {} + ~ExactPixelComparator() override {} // Returns true if the two bitmaps are identical. Otherwise, returns false // and report the number of pixels with an error on LOG(ERROR). Differences // in the alpha channel are ignored. - virtual bool Compare(const SkBitmap& actual_bmp, - const SkBitmap& expected_bmp) const override; + bool Compare(const SkBitmap& actual_bmp, + const SkBitmap& expected_bmp) const override; private: // Exclude alpha channel from comparison? @@ -46,13 +46,13 @@ class FuzzyPixelComparator : public PixelComparator { const float avg_abs_error_limit, const int max_abs_error_limit, const int small_error_threshold); - virtual ~FuzzyPixelComparator() {} + ~FuzzyPixelComparator() override {} // Computes error metrics and returns true if the errors don't exceed the // specified limits. Otherwise, returns false and reports the error metrics on // LOG(ERROR). Differences in the alpha channel are ignored. - virtual bool Compare(const SkBitmap& actual_bmp, - const SkBitmap& expected_bmp) const override; + bool Compare(const SkBitmap& actual_bmp, + const SkBitmap& expected_bmp) const override; private: // Exclude alpha channel from comparison? diff --git a/cc/test/pixel_test.h b/cc/test/pixel_test.h index 3396099..838acaf 100644 --- a/cc/test/pixel_test.h +++ b/cc/test/pixel_test.h @@ -64,7 +64,7 @@ class PixelTest : public testing::Test, RendererClient { void EnableExternalStencilTest(); // RendererClient implementation. - virtual void SetFullRootLayerDamage() override {} + void SetFullRootLayerDamage() override {} private: void ReadbackResult(base::Closure quit_run_loop, diff --git a/cc/test/pixel_test_output_surface.h b/cc/test/pixel_test_output_surface.h index eaa2675..7c725f0 100644 --- a/cc/test/pixel_test_output_surface.h +++ b/cc/test/pixel_test_output_surface.h @@ -16,9 +16,9 @@ class PixelTestOutputSurface : public OutputSurface { explicit PixelTestOutputSurface( scoped_ptr<SoftwareOutputDevice> software_device); - virtual void Reshape(const gfx::Size& size, float scale_factor) override; - virtual bool HasExternalStencilTest() const override; - virtual void SwapBuffers(CompositorFrame* frame) override; + void Reshape(const gfx::Size& size, float scale_factor) override; + bool HasExternalStencilTest() const override; + void SwapBuffers(CompositorFrame* frame) override; void set_surface_expansion_size(const gfx::Size& surface_expansion_size) { surface_expansion_size_ = surface_expansion_size; diff --git a/cc/test/pixel_test_software_output_device.h b/cc/test/pixel_test_software_output_device.h index 1315b4a..d339538 100644 --- a/cc/test/pixel_test_software_output_device.h +++ b/cc/test/pixel_test_software_output_device.h @@ -11,7 +11,7 @@ namespace cc { class PixelTestSoftwareOutputDevice : public SoftwareOutputDevice { public: - virtual void Resize(const gfx::Size& pixel_size, float scale_factor) override; + void Resize(const gfx::Size& pixel_size, float scale_factor) override; void set_surface_expansion_size(const gfx::Size& surface_expansion_size) { surface_expansion_size_ = surface_expansion_size; diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h index a91fd01..d9cb3cf 100644 --- a/cc/test/scheduler_test_common.h +++ b/cc/test/scheduler_test_common.h @@ -24,7 +24,7 @@ class FakeTimeSourceClient : public TimeSourceClient { bool TickCalled() const { return tick_called_; } // TimeSourceClient implementation. - virtual void OnTimerTick() override; + void OnTimerTick() override; protected: bool tick_called_; @@ -39,13 +39,13 @@ class FakeDelayBasedTimeSource : public DelayBasedTimeSource { } void SetNow(base::TimeTicks time) { now_ = time; } - virtual base::TimeTicks Now() const override; + base::TimeTicks Now() const override; protected: FakeDelayBasedTimeSource(base::TimeDelta interval, base::SingleThreadTaskRunner* task_runner) : DelayBasedTimeSource(interval, task_runner) {} - virtual ~FakeDelayBasedTimeSource() {} + ~FakeDelayBasedTimeSource() override {} base::TimeTicks now_; }; @@ -66,9 +66,9 @@ class TestDelayBasedTimeSource : public DelayBasedTimeSource { OrderedSimpleTaskRunner* task_runner); // Overridden from DelayBasedTimeSource - virtual ~TestDelayBasedTimeSource(); - virtual base::TimeTicks Now() const override; - virtual std::string TypeString() const override; + ~TestDelayBasedTimeSource() override; + base::TimeTicks Now() const override; + std::string TypeString() const override; scoped_refptr<TestNowSource> now_src_; }; @@ -89,15 +89,15 @@ struct FakeBeginFrameSource : public BeginFrameSourceMixIn { } // BeginFrameSource - virtual void DidFinishFrame(size_t remaining_frames) override; - virtual void AsValueInto(base::debug::TracedValue* dict) const override; + void DidFinishFrame(size_t remaining_frames) override; + void AsValueInto(base::debug::TracedValue* dict) const override; - virtual ~FakeBeginFrameSource() {} + ~FakeBeginFrameSource() override {} }; class TestBackToBackBeginFrameSource : public BackToBackBeginFrameSource { public: - virtual ~TestBackToBackBeginFrameSource(); + ~TestBackToBackBeginFrameSource() override; static scoped_ptr<TestBackToBackBeginFrameSource> Create( scoped_refptr<TestNowSource> now_src, @@ -110,14 +110,14 @@ class TestBackToBackBeginFrameSource : public BackToBackBeginFrameSource { TestBackToBackBeginFrameSource(scoped_refptr<TestNowSource> now_src, base::SingleThreadTaskRunner* task_runner); - virtual base::TimeTicks Now() override; + base::TimeTicks Now() override; scoped_refptr<TestNowSource> now_src_; }; class TestSyntheticBeginFrameSource : public SyntheticBeginFrameSource { public: - virtual ~TestSyntheticBeginFrameSource(); + ~TestSyntheticBeginFrameSource() override; static scoped_ptr<TestSyntheticBeginFrameSource> Create( scoped_refptr<TestNowSource> now_src, @@ -137,12 +137,11 @@ class TestScheduler; class TestSchedulerFrameSourcesConstructor : public SchedulerFrameSourcesConstructor { public: - virtual ~TestSchedulerFrameSourcesConstructor(); + ~TestSchedulerFrameSourcesConstructor() override; protected: - virtual BeginFrameSource* ConstructPrimaryFrameSource( - Scheduler* scheduler) override; - virtual BeginFrameSource* ConstructBackgroundFrameSource( + BeginFrameSource* ConstructPrimaryFrameSource(Scheduler* scheduler) override; + BeginFrameSource* ConstructBackgroundFrameSource( Scheduler* scheduler) override; OrderedSimpleTaskRunner* test_task_runner_; @@ -182,11 +181,11 @@ class TestScheduler : public Scheduler { BeginFrameSource& frame_source() { return *frame_source_; } - virtual ~TestScheduler(); + ~TestScheduler() override; protected: // Overridden from Scheduler. - virtual base::TimeTicks Now() const override; + base::TimeTicks Now() const override; private: TestScheduler( diff --git a/cc/test/solid_color_content_layer_client.h b/cc/test/solid_color_content_layer_client.h index 7e6ceb6..a851b72 100644 --- a/cc/test/solid_color_content_layer_client.h +++ b/cc/test/solid_color_content_layer_client.h @@ -16,12 +16,12 @@ class SolidColorContentLayerClient : public ContentLayerClient { explicit SolidColorContentLayerClient(SkColor color) : color_(color) {} // ContentLayerClient implementation. - virtual void DidChangeLayerCanUseLCDText() override {} - virtual void PaintContents( + void DidChangeLayerCanUseLCDText() override {} + void PaintContents( SkCanvas* canvas, const gfx::Rect& rect, ContentLayerClient::GraphicsContextStatus gc_status) override; - virtual bool FillsBoundsCompletely() const override; + bool FillsBoundsCompletely() const override; private: SkColor color_; diff --git a/cc/test/test_context_provider.h b/cc/test/test_context_provider.h index cf0292d..66ae998 100644 --- a/cc/test/test_context_provider.h +++ b/cc/test/test_context_provider.h @@ -27,17 +27,17 @@ class TestContextProvider : public ContextProvider { static scoped_refptr<TestContextProvider> Create( scoped_ptr<TestWebGraphicsContext3D> context); - virtual bool BindToCurrentThread() override; - virtual Capabilities ContextCapabilities() override; - virtual gpu::gles2::GLES2Interface* ContextGL() override; - virtual gpu::ContextSupport* ContextSupport() override; - virtual class GrContext* GrContext() override; - virtual bool IsContextLost() override; - virtual void VerifyContexts() override; - virtual void DeleteCachedResources() override; - virtual bool DestroyedOnMainThread() override; - virtual void SetLostContextCallback(const LostContextCallback& cb) override; - virtual void SetMemoryPolicyChangedCallback( + bool BindToCurrentThread() override; + Capabilities ContextCapabilities() override; + gpu::gles2::GLES2Interface* ContextGL() override; + gpu::ContextSupport* ContextSupport() override; + class GrContext* GrContext() override; + bool IsContextLost() override; + void VerifyContexts() override; + void DeleteCachedResources() override; + bool DestroyedOnMainThread() override; + void SetLostContextCallback(const LostContextCallback& cb) override; + void SetMemoryPolicyChangedCallback( const MemoryPolicyChangedCallback& cb) override; TestWebGraphicsContext3D* TestContext3d(); @@ -56,7 +56,7 @@ class TestContextProvider : public ContextProvider { protected: explicit TestContextProvider(scoped_ptr<TestWebGraphicsContext3D> context); - virtual ~TestContextProvider(); + ~TestContextProvider() override; private: void OnLostContext(); diff --git a/cc/test/test_context_support.h b/cc/test/test_context_support.h index ceadd93..307b881 100644 --- a/cc/test/test_context_support.h +++ b/cc/test/test_context_support.h @@ -15,23 +15,22 @@ namespace cc { class TestContextSupport : public gpu::ContextSupport { public: TestContextSupport(); - virtual ~TestContextSupport(); + ~TestContextSupport() override; // gpu::ContextSupport implementation. - virtual void SignalSyncPoint(uint32 sync_point, - const base::Closure& callback) override; - virtual void SignalQuery(uint32 query, - const base::Closure& callback) override; - virtual void SetSurfaceVisible(bool visible) override; - virtual void Swap() override; - virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) override; - virtual uint32 InsertFutureSyncPointCHROMIUM() override; - virtual void RetireSyncPointCHROMIUM(uint32 sync_point) override; - virtual void ScheduleOverlayPlane(int plane_z_order, - gfx::OverlayTransform plane_transform, - unsigned overlay_texture_id, - const gfx::Rect& display_bounds, - const gfx::RectF& uv_rect) override; + void SignalSyncPoint(uint32 sync_point, + const base::Closure& callback) override; + void SignalQuery(uint32 query, const base::Closure& callback) override; + void SetSurfaceVisible(bool visible) override; + void Swap() override; + void PartialSwapBuffers(const gfx::Rect& sub_buffer) override; + uint32 InsertFutureSyncPointCHROMIUM() override; + void RetireSyncPointCHROMIUM(uint32 sync_point) override; + void ScheduleOverlayPlane(int plane_z_order, + gfx::OverlayTransform plane_transform, + unsigned overlay_texture_id, + const gfx::Rect& display_bounds, + const gfx::RectF& uv_rect) override; void CallAllSyncPointCallbacks(); diff --git a/cc/test/test_gles2_interface.h b/cc/test/test_gles2_interface.h index 70d8288..a12147a 100644 --- a/cc/test/test_gles2_interface.h +++ b/cc/test/test_gles2_interface.h @@ -13,180 +13,167 @@ class TestWebGraphicsContext3D; class TestGLES2Interface : public gpu::gles2::GLES2InterfaceStub { public: explicit TestGLES2Interface(TestWebGraphicsContext3D* test_context); - virtual ~TestGLES2Interface(); - - virtual void GenTextures(GLsizei n, GLuint* textures) override; - virtual void GenBuffers(GLsizei n, GLuint* buffers) override; - virtual void GenFramebuffers(GLsizei n, GLuint* framebuffers) override; - virtual void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override; - virtual void GenQueriesEXT(GLsizei n, GLuint* queries) override; - - virtual void DeleteTextures(GLsizei n, const GLuint* textures) override; - virtual void DeleteBuffers(GLsizei n, const GLuint* buffers) override; - virtual void DeleteFramebuffers(GLsizei n, - const GLuint* framebuffers) override; - virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) override; - - virtual GLuint CreateShader(GLenum type) override; - virtual GLuint CreateProgram() override; - - virtual void BindTexture(GLenum target, GLuint texture) override; - - virtual void GetIntegerv(GLenum pname, GLint* params) override; - virtual void GetShaderiv(GLuint shader, GLenum pname, GLint* params) override; - virtual void GetProgramiv(GLuint program, - GLenum pname, - GLint* params) override; - virtual void GetShaderPrecisionFormat(GLenum shadertype, - GLenum precisiontype, - GLint* range, - GLint* precision) override; - virtual GLenum CheckFramebufferStatus(GLenum target) override; - - virtual void ActiveTexture(GLenum target) override; - virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) - override; - virtual void UseProgram(GLuint program) override; - virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) - override; - virtual void DrawElements(GLenum mode, - GLsizei count, - GLenum type, - const void* indices) override; - virtual void ClearColor(GLclampf red, - GLclampf green, - GLclampf blue, - GLclampf alpha) override; - virtual void ClearStencil(GLint s) override; - virtual void Clear(GLbitfield mask) override; - virtual void Flush() override; - virtual void Finish() override; - virtual void ShallowFlushCHROMIUM() override; - virtual void Enable(GLenum cap) override; - virtual void Disable(GLenum cap) override; - - virtual void BindBuffer(GLenum target, GLuint buffer) override; - virtual void BindRenderbuffer(GLenum target, GLuint buffer) override; - virtual void BindFramebuffer(GLenum target, GLuint buffer) override; - - virtual void TexImage2D(GLenum target, - GLint level, - GLint internalformat, - GLsizei width, - GLsizei height, - GLint border, - GLenum format, - GLenum type, - const void* pixels) override; - virtual void TexSubImage2D(GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - const void* pixels) override; - virtual void TexStorage2DEXT(GLenum target, - GLsizei levels, + ~TestGLES2Interface() override; + + void GenTextures(GLsizei n, GLuint* textures) override; + void GenBuffers(GLsizei n, GLuint* buffers) override; + void GenFramebuffers(GLsizei n, GLuint* framebuffers) override; + void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override; + void GenQueriesEXT(GLsizei n, GLuint* queries) override; + + void DeleteTextures(GLsizei n, const GLuint* textures) override; + void DeleteBuffers(GLsizei n, const GLuint* buffers) override; + void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) override; + void DeleteQueriesEXT(GLsizei n, const GLuint* queries) override; + + GLuint CreateShader(GLenum type) override; + GLuint CreateProgram() override; + + void BindTexture(GLenum target, GLuint texture) override; + + void GetIntegerv(GLenum pname, GLint* params) override; + void GetShaderiv(GLuint shader, GLenum pname, GLint* params) override; + void GetProgramiv(GLuint program, GLenum pname, GLint* params) override; + void GetShaderPrecisionFormat(GLenum shadertype, + GLenum precisiontype, + GLint* range, + GLint* precision) override; + GLenum CheckFramebufferStatus(GLenum target) override; + + void ActiveTexture(GLenum target) override; + void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) override; + void UseProgram(GLuint program) override; + void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) override; + void DrawElements(GLenum mode, + GLsizei count, + GLenum type, + const void* indices) override; + void ClearColor(GLclampf red, + GLclampf green, + GLclampf blue, + GLclampf alpha) override; + void ClearStencil(GLint s) override; + void Clear(GLbitfield mask) override; + void Flush() override; + void Finish() override; + void ShallowFlushCHROMIUM() override; + void Enable(GLenum cap) override; + void Disable(GLenum cap) override; + + void BindBuffer(GLenum target, GLuint buffer) override; + void BindRenderbuffer(GLenum target, GLuint buffer) override; + void BindFramebuffer(GLenum target, GLuint buffer) override; + + void TexImage2D(GLenum target, + GLint level, + GLint internalformat, + GLsizei width, + GLsizei height, + GLint border, + GLenum format, + GLenum type, + const void* pixels) override; + void TexSubImage2D(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const void* pixels) override; + void TexStorage2DEXT(GLenum target, + GLsizei levels, + GLenum internalformat, + GLsizei width, + GLsizei height) override; + void TexImageIOSurface2DCHROMIUM(GLenum target, + GLsizei width, + GLsizei height, + GLuint io_surface_id, + GLuint plane) override; + void TexParameteri(GLenum target, GLenum pname, GLint param) override; + + void AsyncTexImage2DCHROMIUM(GLenum target, + GLint level, GLenum internalformat, GLsizei width, - GLsizei height) override; - virtual void TexImageIOSurface2DCHROMIUM(GLenum target, - GLsizei width, - GLsizei height, - GLuint io_surface_id, - GLuint plane) override; - virtual void TexParameteri(GLenum target, GLenum pname, GLint param) override; - - virtual void AsyncTexImage2DCHROMIUM(GLenum target, - GLint level, - GLenum internalformat, - GLsizei width, - GLsizei height, - GLint border, - GLenum format, - GLenum type, - const void* pixels) override; - virtual void AsyncTexSubImage2DCHROMIUM(GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - const void* pixels) override; - virtual void CompressedTexImage2D(GLenum target, - GLint level, - GLenum internalformat, - GLsizei width, - GLsizei height, - GLint border, - GLsizei image_size, - const void* data) override; - virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) override; - virtual GLuint CreateImageCHROMIUM(ClientBuffer buffer, - GLsizei width, - GLsizei height, - GLenum internalformat) override; - virtual void DestroyImageCHROMIUM(GLuint image_id) override; - virtual GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width, - GLsizei height, - GLenum internalformat, - GLenum usage) override; - virtual void BindTexImage2DCHROMIUM(GLenum target, GLint image_id) override; - virtual void ReleaseTexImage2DCHROMIUM(GLenum target, - GLint image_id) override; - virtual void FramebufferRenderbuffer(GLenum target, - GLenum attachment, - GLenum renderbuffertarget, - GLuint renderbuffer) override; - virtual void FramebufferTexture2D(GLenum target, - GLenum attachment, - GLenum textarget, - GLuint texture, - GLint level) override; - virtual void RenderbufferStorage(GLenum target, - GLenum internalformat, - GLsizei width, - GLsizei height) override; - - virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) override; - virtual GLboolean UnmapBufferCHROMIUM(GLuint target) override; - virtual void BufferData(GLenum target, - GLsizeiptr size, - const void* data, - GLenum usage) override; - - virtual void WaitSyncPointCHROMIUM(GLuint sync_point) override; - virtual GLuint InsertSyncPointCHROMIUM() override; - - virtual void BeginQueryEXT(GLenum target, GLuint id) override; - virtual void EndQueryEXT(GLenum target) override; - virtual void GetQueryObjectuivEXT(GLuint id, - GLenum pname, - GLuint* params) override; - - virtual void DiscardFramebufferEXT(GLenum target, - GLsizei count, - const GLenum* attachments) override; - virtual void GenMailboxCHROMIUM(GLbyte* mailbox) override; - virtual void ProduceTextureCHROMIUM(GLenum target, - const GLbyte* mailbox) override; - virtual void ProduceTextureDirectCHROMIUM(GLuint texture, - GLenum target, - const GLbyte* mailbox) override; - virtual void ConsumeTextureCHROMIUM(GLenum target, - const GLbyte* mailbox) override; - virtual GLuint CreateAndConsumeTextureCHROMIUM( - GLenum target, - const GLbyte* mailbox) override; - - virtual void ResizeCHROMIUM(GLuint width, - GLuint height, - float device_scale) override; - virtual void LoseContextCHROMIUM(GLenum current, GLenum other) override; + GLsizei height, + GLint border, + GLenum format, + GLenum type, + const void* pixels) override; + void AsyncTexSubImage2DCHROMIUM(GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const void* pixels) override; + void CompressedTexImage2D(GLenum target, + GLint level, + GLenum internalformat, + GLsizei width, + GLsizei height, + GLint border, + GLsizei image_size, + const void* data) override; + void WaitAsyncTexImage2DCHROMIUM(GLenum target) override; + GLuint CreateImageCHROMIUM(ClientBuffer buffer, + GLsizei width, + GLsizei height, + GLenum internalformat) override; + void DestroyImageCHROMIUM(GLuint image_id) override; + GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width, + GLsizei height, + GLenum internalformat, + GLenum usage) override; + void BindTexImage2DCHROMIUM(GLenum target, GLint image_id) override; + void ReleaseTexImage2DCHROMIUM(GLenum target, GLint image_id) override; + void FramebufferRenderbuffer(GLenum target, + GLenum attachment, + GLenum renderbuffertarget, + GLuint renderbuffer) override; + void FramebufferTexture2D(GLenum target, + GLenum attachment, + GLenum textarget, + GLuint texture, + GLint level) override; + void RenderbufferStorage(GLenum target, + GLenum internalformat, + GLsizei width, + GLsizei height) override; + + void* MapBufferCHROMIUM(GLuint target, GLenum access) override; + GLboolean UnmapBufferCHROMIUM(GLuint target) override; + void BufferData(GLenum target, + GLsizeiptr size, + const void* data, + GLenum usage) override; + + void WaitSyncPointCHROMIUM(GLuint sync_point) override; + GLuint InsertSyncPointCHROMIUM() override; + + void BeginQueryEXT(GLenum target, GLuint id) override; + void EndQueryEXT(GLenum target) override; + void GetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* params) override; + + void DiscardFramebufferEXT(GLenum target, + GLsizei count, + const GLenum* attachments) override; + void GenMailboxCHROMIUM(GLbyte* mailbox) override; + void ProduceTextureCHROMIUM(GLenum target, const GLbyte* mailbox) override; + void ProduceTextureDirectCHROMIUM(GLuint texture, + GLenum target, + const GLbyte* mailbox) override; + void ConsumeTextureCHROMIUM(GLenum target, const GLbyte* mailbox) override; + GLuint CreateAndConsumeTextureCHROMIUM(GLenum target, + const GLbyte* mailbox) override; + + void ResizeCHROMIUM(GLuint width, GLuint height, float device_scale) override; + void LoseContextCHROMIUM(GLenum current, GLenum other) override; private: TestWebGraphicsContext3D* test_context_; diff --git a/cc/test/test_gpu_memory_buffer_manager.cc b/cc/test/test_gpu_memory_buffer_manager.cc index 855959e..1f34988 100644 --- a/cc/test/test_gpu_memory_buffer_manager.cc +++ b/cc/test/test_gpu_memory_buffer_manager.cc @@ -19,25 +19,25 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { mapped_(false) {} // Overridden from gfx::GpuMemoryBuffer: - virtual void* Map() override { + void* Map() override { DCHECK(!mapped_); mapped_ = true; return pixels_.get(); } - virtual void Unmap() override { + void Unmap() override { DCHECK(mapped_); mapped_ = false; } - virtual bool IsMapped() const override { return mapped_; } - virtual Format GetFormat() const override { return format_; } - virtual uint32 GetStride() const override { + bool IsMapped() const override { return mapped_; } + Format GetFormat() const override { return format_; } + uint32 GetStride() const override { return size_.width() * BytesPerPixel(format_); } - virtual gfx::GpuMemoryBufferHandle GetHandle() const override { + gfx::GpuMemoryBufferHandle GetHandle() const override { NOTREACHED(); return gfx::GpuMemoryBufferHandle(); } - virtual ClientBuffer AsClientBuffer() override { + ClientBuffer AsClientBuffer() override { return reinterpret_cast<ClientBuffer>(this); } diff --git a/cc/test/test_gpu_memory_buffer_manager.h b/cc/test/test_gpu_memory_buffer_manager.h index 61aaaaa..267e6fe 100644 --- a/cc/test/test_gpu_memory_buffer_manager.h +++ b/cc/test/test_gpu_memory_buffer_manager.h @@ -12,14 +12,14 @@ namespace cc { class TestGpuMemoryBufferManager : public GpuMemoryBufferManager { public: TestGpuMemoryBufferManager(); - virtual ~TestGpuMemoryBufferManager(); + ~TestGpuMemoryBufferManager() override; // Overridden from GpuMemoryBufferManager: - virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( + scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( const gfx::Size& size, gfx::GpuMemoryBuffer::Format format, gfx::GpuMemoryBuffer::Usage usage) override; - virtual gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( + gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( ClientBuffer buffer) override; }; diff --git a/cc/test/test_in_process_context_provider.h b/cc/test/test_in_process_context_provider.h index 5e6a9785..6725ec0 100644 --- a/cc/test/test_in_process_context_provider.h +++ b/cc/test/test_in_process_context_provider.h @@ -22,24 +22,24 @@ class TestInProcessContextProvider : public ContextProvider { public: TestInProcessContextProvider(); - virtual bool BindToCurrentThread() override; - virtual gpu::gles2::GLES2Interface* ContextGL() override; - virtual gpu::ContextSupport* ContextSupport() override; - virtual class GrContext* GrContext() override; - virtual Capabilities ContextCapabilities() override; - virtual bool IsContextLost() override; - virtual void VerifyContexts() override; - virtual void DeleteCachedResources() override; - virtual bool DestroyedOnMainThread() override; - virtual void SetLostContextCallback( + bool BindToCurrentThread() override; + gpu::gles2::GLES2Interface* ContextGL() override; + gpu::ContextSupport* ContextSupport() override; + class GrContext* GrContext() override; + Capabilities ContextCapabilities() override; + bool IsContextLost() override; + void VerifyContexts() override; + void DeleteCachedResources() override; + bool DestroyedOnMainThread() override; + void SetLostContextCallback( const LostContextCallback& lost_context_callback) override; - virtual void SetMemoryPolicyChangedCallback( + void SetMemoryPolicyChangedCallback( const MemoryPolicyChangedCallback& memory_policy_changed_callback) override; protected: friend class base::RefCountedThreadSafe<TestInProcessContextProvider>; - virtual ~TestInProcessContextProvider(); + ~TestInProcessContextProvider() override; private: scoped_ptr<gpu::GLInProcessContext> context_; diff --git a/cc/test/test_shared_bitmap_manager.h b/cc/test/test_shared_bitmap_manager.h index ccda52c..9163c79 100644 --- a/cc/test/test_shared_bitmap_manager.h +++ b/cc/test/test_shared_bitmap_manager.h @@ -15,16 +15,15 @@ namespace cc { class TestSharedBitmapManager : public SharedBitmapManager { public: TestSharedBitmapManager(); - virtual ~TestSharedBitmapManager(); + ~TestSharedBitmapManager() override; - virtual scoped_ptr<SharedBitmap> AllocateSharedBitmap(const gfx::Size& size) - override; + scoped_ptr<SharedBitmap> AllocateSharedBitmap(const gfx::Size& size) override; - virtual scoped_ptr<SharedBitmap> GetSharedBitmapFromId( + scoped_ptr<SharedBitmap> GetSharedBitmapFromId( const gfx::Size&, const SharedBitmapId& id) override; - virtual scoped_ptr<SharedBitmap> GetBitmapForSharedMemory( + scoped_ptr<SharedBitmap> GetBitmapForSharedMemory( base::SharedMemory* memory) override; private: diff --git a/cc/test/tiled_layer_test_common.h b/cc/test/tiled_layer_test_common.h index a54cb37..18b9817 100644 --- a/cc/test/tiled_layer_test_common.h +++ b/cc/test/tiled_layer_test_common.h @@ -25,12 +25,12 @@ class FakeLayerUpdater : public LayerUpdater { public: Resource(FakeLayerUpdater* updater, scoped_ptr<PrioritizedResource> resource); - virtual ~Resource(); + ~Resource() override; - virtual void Update(ResourceUpdateQueue* queue, - const gfx::Rect& source_rect, - const gfx::Vector2d& dest_offset, - bool partial_update) override; + void Update(ResourceUpdateQueue* queue, + const gfx::Rect& source_rect, + const gfx::Vector2d& dest_offset, + bool partial_update) override; private: FakeLayerUpdater* layer_; @@ -41,14 +41,14 @@ class FakeLayerUpdater : public LayerUpdater { FakeLayerUpdater(); - virtual scoped_ptr<LayerUpdater::Resource> CreateResource( + scoped_ptr<LayerUpdater::Resource> CreateResource( PrioritizedResourceManager* resource) override; - virtual void PrepareToUpdate(const gfx::Size& content_size, - const gfx::Rect& paint_rect, - const gfx::Size& tile_size, - float contents_width_scale, - float contents_height_scale) override; + void PrepareToUpdate(const gfx::Size& content_size, + const gfx::Rect& paint_rect, + const gfx::Size& tile_size, + float contents_width_scale, + float contents_height_scale) override; // Sets the rect to invalidate during the next call to PrepareToUpdate(). // After the next call to PrepareToUpdate() the rect is reset. void SetRectToInvalidate(const gfx::Rect& rect, FakeTiledLayer* layer); @@ -68,7 +68,7 @@ class FakeLayerUpdater : public LayerUpdater { void Update() { update_count_++; } protected: - virtual ~FakeLayerUpdater(); + ~FakeLayerUpdater() override; private: int prepare_count_; @@ -84,7 +84,7 @@ class FakeLayerUpdater : public LayerUpdater { class FakeTiledLayerImpl : public TiledLayerImpl { public: FakeTiledLayerImpl(LayerTreeImpl* tree_impl, int id); - virtual ~FakeTiledLayerImpl(); + ~FakeTiledLayerImpl() override; using TiledLayerImpl::HasTileAt; using TiledLayerImpl::HasResourceIdForTileAt; @@ -102,15 +102,15 @@ class FakeTiledLayer : public TiledLayer { using TiledLayer::NumPaintedTiles; using TiledLayer::IdlePaintRect; - virtual void SetNeedsDisplayRect(const gfx::Rect& rect) override; + void SetNeedsDisplayRect(const gfx::Rect& rect) override; const gfx::Rect& last_needs_display_rect() const { return last_needs_display_rect_; } - virtual void SetTexturePriorities( + void SetTexturePriorities( const PriorityCalculator& priority_calculator) override; - virtual PrioritizedResourceManager* ResourceManager() override; + PrioritizedResourceManager* ResourceManager() override; FakeLayerUpdater* fake_layer_updater() { return fake_updater_.get(); } gfx::RectF update_rect() { return update_rect_; } @@ -120,9 +120,9 @@ class FakeTiledLayer : public TiledLayer { void ResetNumDependentsNeedPushProperties(); protected: - virtual LayerUpdater* Updater() const override; - virtual void CreateUpdaterIfNeeded() override {} - virtual ~FakeTiledLayer(); + LayerUpdater* Updater() const override; + void CreateUpdaterIfNeeded() override {} + ~FakeTiledLayer() override; private: scoped_refptr<FakeLayerUpdater> fake_updater_; @@ -138,13 +138,13 @@ class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { PrioritizedResourceManager* resource_manager); void SetContentBounds(const gfx::Size& content_bounds); - 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; protected: - virtual ~FakeTiledLayerWithScaledBounds(); + ~FakeTiledLayerWithScaledBounds() override; gfx::Size forced_content_bounds_; private: 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; } |