From 3a83478b512978046269739d5c2e2ef47e747ebe Mon Sep 17 00:00:00 2001 From: "wjmaclean@chromium.org" Date: Thu, 22 Aug 2013 20:55:17 +0000 Subject: [PATCH] Rename ScrollbarLayer\* to PaintedScrollbarLayer\* In preparation for splitting the ScrollbarLayer class, rename it to PaintedScrollbarLayer. A new layer type, SolidColorScrollbarLayer will be created, and both classes will derive from ScrollbarLayerInterface. Similarly, ScrollbarLayerImpl is renamed PaintedScrollbarLayerImpl, a new class SolidColorScrollbarLayerImpl is created, both deriving from a shared base class ScrollbarLayerImplBase. FakeScrollbarLayer is renamed to FakePaintedScrollbarLayer. BUG= Review URL: https://chromiumcodereview.appspot.com/23068016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219098 0039d316-1c4b-4281-b951-d872f2087c98 --- ...ar_animation_controller_linear_fade_unittest.cc | 6 +- cc/cc.gyp | 8 +- cc/cc_tests.gyp | 4 +- cc/layers/layer.cc | 2 +- cc/layers/layer.h | 4 +- cc/layers/layer_impl.cc | 9 ++- cc/layers/layer_impl.h | 16 ++-- ...rollbar_layer.cc => painted_scrollbar_layer.cc} | 64 ++++++++-------- ...scrollbar_layer.h => painted_scrollbar_layer.h} | 20 ++--- ...yer_impl.cc => painted_scrollbar_layer_impl.cc} | 66 ++++++++-------- ...layer_impl.h => painted_scrollbar_layer_impl.h} | 24 +++--- cc/layers/scrollbar_layer_unittest.cc | 87 +++++++++++----------- cc/test/fake_painted_scrollbar_layer.cc | 56 ++++++++++++++ ...lbar_layer.h => fake_painted_scrollbar_layer.h} | 29 ++++---- cc/test/fake_scrollbar_layer.cc | 55 -------------- cc/trees/layer_tree_host.cc | 2 +- cc/trees/layer_tree_host_impl.cc | 2 +- cc/trees/layer_tree_host_impl_unittest.cc | 12 ++- cc/trees/layer_tree_host_unittest.cc | 27 ++++--- cc/trees/layer_tree_host_unittest_context.cc | 16 ++-- cc/trees/layer_tree_host_unittest_damage.cc | 4 +- cc/trees/layer_tree_impl.cc | 8 +- cc/trees/tree_synchronizer.cc | 18 +++-- .../web_scrollbar_layer_impl.cc | 8 +- 24 files changed, 277 insertions(+), 270 deletions(-) rename cc/layers/{scrollbar_layer.cc => painted_scrollbar_layer.cc} (79%) rename cc/layers/{scrollbar_layer.h => painted_scrollbar_layer.h} (81%) rename cc/layers/{scrollbar_layer_impl.cc => painted_scrollbar_layer_impl.cc} (83%) rename cc/layers/{scrollbar_layer_impl.h => painted_scrollbar_layer_impl.h} (79%) create mode 100644 cc/test/fake_painted_scrollbar_layer.cc rename cc/test/{fake_scrollbar_layer.h => fake_painted_scrollbar_layer.h} (57%) delete mode 100644 cc/test/fake_scrollbar_layer.cc diff --git a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc index a8365e8b4de0..4a11ba6bd23c 100644 --- a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc +++ b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc @@ -4,7 +4,7 @@ #include "cc/animation/scrollbar_animation_controller_linear_fade.h" -#include "cc/layers/scrollbar_layer_impl.h" +#include "cc/layers/painted_scrollbar_layer_impl.h" #include "cc/test/fake_impl_proxy.h" #include "cc/test/fake_layer_tree_host_impl.h" #include "testing/gtest/include/gtest/gtest.h" @@ -19,7 +19,7 @@ class ScrollbarAnimationControllerLinearFadeTest : public testing::Test { protected: virtual void SetUp() { scroll_layer_ = LayerImpl::Create(host_impl_.active_tree(), 1); - scrollbar_layer_ = ScrollbarLayerImpl::Create( + scrollbar_layer_ = PaintedScrollbarLayerImpl::Create( host_impl_.active_tree(), 2, HORIZONTAL); scroll_layer_->SetMaxScrollOffset(gfx::Vector2d(50, 50)); @@ -36,7 +36,7 @@ class ScrollbarAnimationControllerLinearFadeTest : public testing::Test { FakeLayerTreeHostImpl host_impl_; scoped_ptr scrollbar_controller_; scoped_ptr scroll_layer_; - scoped_ptr scrollbar_layer_; + scoped_ptr scrollbar_layer_; }; TEST_F(ScrollbarAnimationControllerLinearFadeTest, HiddenInBegin) { diff --git a/cc/cc.gyp b/cc/cc.gyp index cd9afeb3488c..c6f3355a5dde 100644 --- a/cc/cc.gyp +++ b/cc/cc.gyp @@ -139,6 +139,10 @@ 'layers/nine_patch_layer_impl.cc', 'layers/nine_patch_layer_impl.h', 'layers/paint_properties.h', + 'layers/painted_scrollbar_layer.cc', + 'layers/painted_scrollbar_layer.h', + 'layers/painted_scrollbar_layer_impl.cc', + 'layers/painted_scrollbar_layer_impl.h', 'layers/picture_image_layer.cc', 'layers/picture_image_layer.h', 'layers/picture_image_layer_impl.cc', @@ -153,10 +157,6 @@ 'layers/render_surface.h', 'layers/render_surface_impl.cc', 'layers/render_surface_impl.h', - 'layers/scrollbar_layer.cc', - 'layers/scrollbar_layer.h', - 'layers/scrollbar_layer_impl.cc', - 'layers/scrollbar_layer_impl.h', 'layers/solid_color_layer.cc', 'layers/solid_color_layer.h', 'layers/solid_color_layer_impl.cc', diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp index 4e4f4382e2c6..c84b11bc2501 100644 --- a/cc/cc_tests.gyp +++ b/cc/cc_tests.gyp @@ -111,6 +111,8 @@ 'test/fake_layer_tree_host_impl_client.cc', 'test/fake_layer_tree_host_impl_client.h', 'test/fake_layer_tree_host_impl.h', + 'test/fake_painted_scrollbar_layer.cc', + 'test/fake_painted_scrollbar_layer.h', 'test/fake_picture_layer.cc', 'test/fake_picture_layer.h', 'test/fake_picture_layer_impl.cc', @@ -124,8 +126,6 @@ 'test/fake_rendering_stats_instrumentation.h', 'test/fake_scrollbar.cc', 'test/fake_scrollbar.h', - 'test/fake_scrollbar_layer.cc', - 'test/fake_scrollbar_layer.h', 'test/fake_tile_manager.cc', 'test/fake_tile_manager.h', 'test/fake_tile_manager_client.h', diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index 62d903e812bf..b87a80788ee0 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc @@ -973,7 +973,7 @@ Region Layer::VisibleContentOpaqueRegion() const { return Region(); } -ScrollbarLayer* Layer::ToScrollbarLayer() { +PaintedScrollbarLayer* Layer::ToScrollbarLayer() { return NULL; } diff --git a/cc/layers/layer.h b/cc/layers/layer.h index 868777c23290..67807df777e2 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h @@ -47,10 +47,10 @@ class LayerClient; class LayerImpl; class LayerTreeHost; class LayerTreeImpl; +class PaintedScrollbarLayer; class PriorityCalculator; class RenderingStatsInstrumentation; class ResourceUpdateQueue; -class ScrollbarLayer; struct AnimationEvent; // Base class for composited layers. Special layer types are derived from @@ -360,7 +360,7 @@ class CC_EXPORT Layer : public base::RefCounted, virtual Region VisibleContentOpaqueRegion() const; - virtual ScrollbarLayer* ToScrollbarLayer(); + virtual PaintedScrollbarLayer* ToScrollbarLayer(); gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc index 0267d9f78ad4..31c8a1c4dbb5 100644 --- a/cc/layers/layer_impl.cc +++ b/cc/layers/layer_impl.cc @@ -14,8 +14,8 @@ #include "cc/debug/layer_tree_debug_state.h" #include "cc/debug/traced_value.h" #include "cc/input/layer_scroll_offset_delegate.h" +#include "cc/layers/painted_scrollbar_layer_impl.h" #include "cc/layers/quad_sink.h" -#include "cc/layers/scrollbar_layer_impl.h" #include "cc/output/copy_output_request.h" #include "cc/quads/debug_border_draw_quad.h" #include "cc/trees/layer_tree_impl.h" @@ -641,7 +641,7 @@ scoped_ptr LayerImpl::TakeReplicaLayer() { return replica_layer_.Pass(); } -ScrollbarLayerImpl* LayerImpl::ToScrollbarLayer() { +PaintedScrollbarLayerImpl* LayerImpl::ToScrollbarLayer() { return NULL; } @@ -999,13 +999,14 @@ void LayerImpl::DidBecomeActive() { } } void LayerImpl::SetHorizontalScrollbarLayer( - ScrollbarLayerImpl* scrollbar_layer) { + PaintedScrollbarLayerImpl* scrollbar_layer) { horizontal_scrollbar_layer_ = scrollbar_layer; if (horizontal_scrollbar_layer_) horizontal_scrollbar_layer_->set_scroll_layer_id(id()); } -void LayerImpl::SetVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbar_layer) { +void LayerImpl::SetVerticalScrollbarLayer( + PaintedScrollbarLayerImpl* scrollbar_layer) { vertical_scrollbar_layer_ = scrollbar_layer; if (vertical_scrollbar_layer_) vertical_scrollbar_layer_->set_scroll_layer_id(id()); diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h index 03bd2d098a63..a3bbacebfe1a 100644 --- a/cc/layers/layer_impl.h +++ b/cc/layers/layer_impl.h @@ -41,10 +41,10 @@ namespace cc { class LayerTreeHostImpl; class LayerTreeImpl; +class PaintedScrollbarLayerImpl; class QuadSink; class Renderer; class ScrollbarAnimationController; -class ScrollbarLayerImpl; class Layer; struct AppendQuadsData; @@ -128,7 +128,7 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver { virtual void UpdateTilePriorities() {} - virtual ScrollbarLayerImpl* ToScrollbarLayer(); + virtual PaintedScrollbarLayerImpl* ToScrollbarLayer(); // Returns true if this layer has content to draw. void SetDrawsContent(bool draws_content); @@ -416,13 +416,13 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver { void SetScrollbarOpacity(float opacity); - void SetHorizontalScrollbarLayer(ScrollbarLayerImpl* scrollbar_layer); - ScrollbarLayerImpl* horizontal_scrollbar_layer() { + void SetHorizontalScrollbarLayer(PaintedScrollbarLayerImpl* scrollbar_layer); + PaintedScrollbarLayerImpl* horizontal_scrollbar_layer() { return horizontal_scrollbar_layer_; } - void SetVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbar_layer); - ScrollbarLayerImpl* vertical_scrollbar_layer() { + void SetVerticalScrollbarLayer(PaintedScrollbarLayerImpl* scrollbar_layer); + PaintedScrollbarLayerImpl* vertical_scrollbar_layer() { return vertical_scrollbar_layer_; } @@ -568,8 +568,8 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver { // Weak pointers to this layer's scrollbars, if it has them. Updated during // tree synchronization. - ScrollbarLayerImpl* horizontal_scrollbar_layer_; - ScrollbarLayerImpl* vertical_scrollbar_layer_; + PaintedScrollbarLayerImpl* horizontal_scrollbar_layer_; + PaintedScrollbarLayerImpl* vertical_scrollbar_layer_; ScopedPtrVector copy_requests_; diff --git a/cc/layers/scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc similarity index 79% rename from cc/layers/scrollbar_layer.cc rename to cc/layers/painted_scrollbar_layer.cc index a7b2eba5db13..8346d04cf24a 100644 --- a/cc/layers/scrollbar_layer.cc +++ b/cc/layers/painted_scrollbar_layer.cc @@ -1,13 +1,13 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/layers/scrollbar_layer.h" +#include "cc/layers/painted_scrollbar_layer.h" #include "base/auto_reset.h" #include "base/basictypes.h" #include "base/debug/trace_event.h" -#include "cc/layers/scrollbar_layer_impl.h" +#include "cc/layers/painted_scrollbar_layer_impl.h" #include "cc/resources/ui_resource_bitmap.h" #include "cc/trees/layer_tree_host.h" #include "cc/trees/layer_tree_impl.h" @@ -20,20 +20,20 @@ namespace cc { -scoped_ptr ScrollbarLayer::CreateLayerImpl( +scoped_ptr PaintedScrollbarLayer::CreateLayerImpl( LayerTreeImpl* tree_impl) { - return ScrollbarLayerImpl::Create( + return PaintedScrollbarLayerImpl::Create( tree_impl, id(), scrollbar_->Orientation()).PassAs(); } -scoped_refptr ScrollbarLayer::Create( +scoped_refptr PaintedScrollbarLayer::Create( scoped_ptr scrollbar, int scroll_layer_id) { return make_scoped_refptr( - new ScrollbarLayer(scrollbar.Pass(), scroll_layer_id)); + new PaintedScrollbarLayer(scrollbar.Pass(), scroll_layer_id)); } -ScrollbarLayer::ScrollbarLayer( +PaintedScrollbarLayer::PaintedScrollbarLayer( scoped_ptr scrollbar, int scroll_layer_id) : scrollbar_(scrollbar.Pass()), @@ -42,9 +42,9 @@ ScrollbarLayer::ScrollbarLayer( SetShouldScrollOnMainThread(true); } -ScrollbarLayer::~ScrollbarLayer() {} +PaintedScrollbarLayer::~PaintedScrollbarLayer() {} -void ScrollbarLayer::SetScrollLayerId(int id) { +void PaintedScrollbarLayer::SetScrollLayerId(int id) { if (id == scroll_layer_id_) return; @@ -52,20 +52,20 @@ void ScrollbarLayer::SetScrollLayerId(int id) { SetNeedsFullTreeSync(); } -bool ScrollbarLayer::OpacityCanAnimateOnImplThread() const { +bool PaintedScrollbarLayer::OpacityCanAnimateOnImplThread() const { return scrollbar_->IsOverlay(); } -ScrollbarOrientation ScrollbarLayer::Orientation() const { +ScrollbarOrientation PaintedScrollbarLayer::Orientation() const { return scrollbar_->Orientation(); } -int ScrollbarLayer::MaxTextureSize() { +int PaintedScrollbarLayer::MaxTextureSize() { DCHECK(layer_tree_host()); return layer_tree_host()->GetRendererCapabilities().max_texture_size; } -float ScrollbarLayer::ClampScaleToMaxTextureSize(float scale) { +float PaintedScrollbarLayer::ClampScaleToMaxTextureSize(float scale) { if (layer_tree_host()->settings().solid_color_scrollbars) return scale; @@ -83,13 +83,14 @@ float ScrollbarLayer::ClampScaleToMaxTextureSize(float scale) { return scale; } -void ScrollbarLayer::CalculateContentsScale(float ideal_contents_scale, - float device_scale_factor, - float page_scale_factor, - bool animating_transform_to_screen, - float* contents_scale_x, - float* contents_scale_y, - gfx::Size* content_bounds) { +void PaintedScrollbarLayer::CalculateContentsScale( + float ideal_contents_scale, + float device_scale_factor, + float page_scale_factor, + bool animating_transform_to_screen, + float* contents_scale_x, + float* contents_scale_y, + gfx::Size* content_bounds) { ContentsScalingLayer::CalculateContentsScale( ClampScaleToMaxTextureSize(ideal_contents_scale), device_scale_factor, @@ -100,10 +101,11 @@ void ScrollbarLayer::CalculateContentsScale(float ideal_contents_scale, content_bounds); } -void ScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { +void PaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { ContentsScalingLayer::PushPropertiesTo(layer); - ScrollbarLayerImpl* scrollbar_layer = static_cast(layer); + PaintedScrollbarLayerImpl* scrollbar_layer = + static_cast(layer); if (layer_tree_host() && layer_tree_host()->settings().solid_color_scrollbars) { @@ -138,15 +140,15 @@ void ScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { scrollbar_layer->set_is_overlay_scrollbar(scrollbar_->IsOverlay()); - // ScrollbarLayer must push properties every frame. crbug.com/259095 + // PaintedScrollbarLayer must push properties every frame. crbug.com/259095 needs_push_properties_ = true; } -ScrollbarLayer* ScrollbarLayer::ToScrollbarLayer() { +PaintedScrollbarLayer* PaintedScrollbarLayer::ToScrollbarLayer() { return this; } -void ScrollbarLayer::SetLayerTreeHost(LayerTreeHost* host) { +void PaintedScrollbarLayer::SetLayerTreeHost(LayerTreeHost* host) { // When the LTH is set to null or has changed, then this layer should remove // all of its associated resources. if (!host || host != layer_tree_host()) { @@ -157,7 +159,7 @@ void ScrollbarLayer::SetLayerTreeHost(LayerTreeHost* host) { ContentsScalingLayer::SetLayerTreeHost(host); } -gfx::Rect ScrollbarLayer::ScrollbarLayerRectToContentRect( +gfx::Rect PaintedScrollbarLayer::ScrollbarLayerRectToContentRect( gfx::Rect layer_rect) const { // Don't intersect with the bounds as in LayerRectToContentRect() because // layer_rect here might be in coordinates of the containing layer. @@ -170,7 +172,7 @@ gfx::Rect ScrollbarLayer::ScrollbarLayerRectToContentRect( return expanded_rect; } -gfx::Rect ScrollbarLayer::OriginThumbRect() const { +gfx::Rect PaintedScrollbarLayer::OriginThumbRect() const { gfx::Size thumb_size; if (Orientation() == HORIZONTAL) { thumb_size = @@ -182,7 +184,7 @@ gfx::Rect ScrollbarLayer::OriginThumbRect() const { return ScrollbarLayerRectToContentRect(gfx::Rect(thumb_size)); } -void ScrollbarLayer::UpdateThumbAndTrackGeometry() { +void PaintedScrollbarLayer::UpdateThumbAndTrackGeometry() { track_rect_ = scrollbar_->TrackRect(); if (scrollbar_->HasThumb()) { thumb_thickness_ = scrollbar_->ThumbThickness(); @@ -190,7 +192,7 @@ void ScrollbarLayer::UpdateThumbAndTrackGeometry() { } } -bool ScrollbarLayer::Update(ResourceUpdateQueue* queue, +bool PaintedScrollbarLayer::Update(ResourceUpdateQueue* queue, const OcclusionTracker* occlusion) { UpdateThumbAndTrackGeometry(); @@ -219,7 +221,7 @@ bool ScrollbarLayer::Update(ResourceUpdateQueue* queue, return true; } -scoped_refptr ScrollbarLayer::RasterizeScrollbarPart( +scoped_refptr PaintedScrollbarLayer::RasterizeScrollbarPart( gfx::Rect rect, ScrollbarPart part) { DCHECK(!layer_tree_host()->settings().solid_color_scrollbars); diff --git a/cc/layers/scrollbar_layer.h b/cc/layers/painted_scrollbar_layer.h similarity index 81% rename from cc/layers/scrollbar_layer.h rename to cc/layers/painted_scrollbar_layer.h index feea62d3ba6b..48fb3765e502 100644 --- a/cc/layers/scrollbar_layer.h +++ b/cc/layers/painted_scrollbar_layer.h @@ -1,9 +1,9 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_LAYERS_SCROLLBAR_LAYER_H_ -#define CC_LAYERS_SCROLLBAR_LAYER_H_ +#ifndef CC_LAYERS_PAINTED_SCROLLBAR_LAYER_H_ +#define CC_LAYERS_PAINTED_SCROLLBAR_LAYER_H_ #include "cc/base/cc_export.h" #include "cc/input/scrollbar.h" @@ -15,12 +15,12 @@ namespace cc { class ScrollbarThemeComposite; -class CC_EXPORT ScrollbarLayer : public ContentsScalingLayer { +class CC_EXPORT PaintedScrollbarLayer : public ContentsScalingLayer { public: virtual scoped_ptr CreateLayerImpl(LayerTreeImpl* tree_impl) OVERRIDE; - static scoped_refptr Create( + static scoped_refptr Create( scoped_ptr scrollbar, int scroll_layer_id); @@ -44,11 +44,11 @@ class CC_EXPORT ScrollbarLayer : public ContentsScalingLayer { float* contents_scale_y, gfx::Size* content_bounds) OVERRIDE; - virtual ScrollbarLayer* ToScrollbarLayer() OVERRIDE; + virtual PaintedScrollbarLayer* ToScrollbarLayer() OVERRIDE; protected: - ScrollbarLayer(scoped_ptr scrollbar, int scroll_layer_id); - virtual ~ScrollbarLayer(); + PaintedScrollbarLayer(scoped_ptr scrollbar, int scroll_layer_id); + virtual ~PaintedScrollbarLayer(); // For unit tests UIResourceId track_resource_id() { @@ -79,9 +79,9 @@ class CC_EXPORT ScrollbarLayer : public ContentsScalingLayer { scoped_ptr track_resource_; scoped_ptr thumb_resource_; - DISALLOW_COPY_AND_ASSIGN(ScrollbarLayer); + DISALLOW_COPY_AND_ASSIGN(PaintedScrollbarLayer); }; } // namespace cc -#endif // CC_LAYERS_SCROLLBAR_LAYER_H_ +#endif // CC_LAYERS_PAINTED_SCROLLBAR_LAYER_H_ diff --git a/cc/layers/scrollbar_layer_impl.cc b/cc/layers/painted_scrollbar_layer_impl.cc similarity index 83% rename from cc/layers/scrollbar_layer_impl.cc rename to cc/layers/painted_scrollbar_layer_impl.cc index c326d42ff249..621cf390f14c 100644 --- a/cc/layers/scrollbar_layer_impl.cc +++ b/cc/layers/painted_scrollbar_layer_impl.cc @@ -1,8 +1,8 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/layers/scrollbar_layer_impl.h" +#include "cc/layers/painted_scrollbar_layer_impl.h" #include @@ -17,16 +17,15 @@ namespace cc { -scoped_ptr ScrollbarLayerImpl::Create( +scoped_ptr PaintedScrollbarLayerImpl::Create( LayerTreeImpl* tree_impl, int id, ScrollbarOrientation orientation) { - return make_scoped_ptr(new ScrollbarLayerImpl(tree_impl, - id, - orientation)); + return make_scoped_ptr( + new PaintedScrollbarLayerImpl(tree_impl, id, orientation)); } -ScrollbarLayerImpl::ScrollbarLayerImpl( +PaintedScrollbarLayerImpl::PaintedScrollbarLayerImpl( LayerTreeImpl* tree_impl, int id, ScrollbarOrientation orientation) @@ -45,23 +44,23 @@ ScrollbarLayerImpl::ScrollbarLayerImpl( scroll_layer_id_(Layer::INVALID_ID), is_overlay_scrollbar_(false) {} -ScrollbarLayerImpl::~ScrollbarLayerImpl() {} +PaintedScrollbarLayerImpl::~PaintedScrollbarLayerImpl() {} -ScrollbarLayerImpl* ScrollbarLayerImpl::ToScrollbarLayer() { +PaintedScrollbarLayerImpl* PaintedScrollbarLayerImpl::ToScrollbarLayer() { return this; } -scoped_ptr ScrollbarLayerImpl::CreateLayerImpl( +scoped_ptr PaintedScrollbarLayerImpl::CreateLayerImpl( LayerTreeImpl* tree_impl) { - return ScrollbarLayerImpl::Create(tree_impl, - id(), - orientation_).PassAs(); + return PaintedScrollbarLayerImpl::Create(tree_impl, id(), orientation_) + .PassAs(); } -void ScrollbarLayerImpl::PushPropertiesTo(LayerImpl* layer) { +void PaintedScrollbarLayerImpl::PushPropertiesTo(LayerImpl* layer) { LayerImpl::PushPropertiesTo(layer); - ScrollbarLayerImpl* scrollbar_layer = static_cast(layer); + PaintedScrollbarLayerImpl* scrollbar_layer = + static_cast(layer); scrollbar_layer->SetThumbThickness(thumb_thickness_); scrollbar_layer->SetThumbLength(thumb_length_); @@ -73,7 +72,7 @@ void ScrollbarLayerImpl::PushPropertiesTo(LayerImpl* layer) { scrollbar_layer->set_thumb_ui_resource_id(thumb_ui_resource_id_); } -bool ScrollbarLayerImpl::WillDraw(DrawMode draw_mode, +bool PaintedScrollbarLayerImpl::WillDraw(DrawMode draw_mode, ResourceProvider* resource_provider) { if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE && !layer_tree_impl()->settings().solid_color_scrollbars) @@ -81,8 +80,9 @@ bool ScrollbarLayerImpl::WillDraw(DrawMode draw_mode, return LayerImpl::WillDraw(draw_mode, resource_provider); } -void ScrollbarLayerImpl::AppendQuads(QuadSink* quad_sink, - AppendQuadsData* append_quads_data) { +void PaintedScrollbarLayerImpl::AppendQuads( + QuadSink* quad_sink, + AppendQuadsData* append_quads_data) { bool premultipled_alpha = true; bool flipped = false; gfx::PointF uv_top_left(0.f, 0.f); @@ -147,19 +147,19 @@ void ScrollbarLayerImpl::AppendQuads(QuadSink* quad_sink, } } -ScrollbarOrientation ScrollbarLayerImpl::Orientation() const { +ScrollbarOrientation PaintedScrollbarLayerImpl::Orientation() const { return orientation_; } -float ScrollbarLayerImpl::CurrentPos() const { +float PaintedScrollbarLayerImpl::CurrentPos() const { return current_pos_; } -int ScrollbarLayerImpl::Maximum() const { +int PaintedScrollbarLayerImpl::Maximum() const { return maximum_; } -gfx::Rect ScrollbarLayerImpl::ScrollbarLayerRectToContentRect( +gfx::Rect PaintedScrollbarLayerImpl::ScrollbarLayerRectToContentRect( gfx::RectF layer_rect) const { // Don't intersect with the bounds as in layerRectToContentRect() because // layer_rect here might be in coordinates of the containing layer. @@ -169,62 +169,62 @@ gfx::Rect ScrollbarLayerImpl::ScrollbarLayerRectToContentRect( return gfx::ToEnclosingRect(content_rect); } -void ScrollbarLayerImpl::SetThumbThickness(int thumb_thickness) { +void PaintedScrollbarLayerImpl::SetThumbThickness(int thumb_thickness) { if (thumb_thickness_ == thumb_thickness) return; thumb_thickness_ = thumb_thickness; NoteLayerPropertyChanged(); } -void ScrollbarLayerImpl::SetThumbLength(int thumb_length) { +void PaintedScrollbarLayerImpl::SetThumbLength(int thumb_length) { if (thumb_length_ == thumb_length) return; thumb_length_ = thumb_length; NoteLayerPropertyChanged(); } -void ScrollbarLayerImpl::SetTrackStart(int track_start) { +void PaintedScrollbarLayerImpl::SetTrackStart(int track_start) { if (track_start_ == track_start) return; track_start_ = track_start; NoteLayerPropertyChanged(); } -void ScrollbarLayerImpl::SetTrackLength(int track_length) { +void PaintedScrollbarLayerImpl::SetTrackLength(int track_length) { if (track_length_ == track_length) return; track_length_ = track_length; NoteLayerPropertyChanged(); } -void ScrollbarLayerImpl::SetVerticalAdjust(float vertical_adjust) { +void PaintedScrollbarLayerImpl::SetVerticalAdjust(float vertical_adjust) { if (vertical_adjust_ == vertical_adjust) return; vertical_adjust_ = vertical_adjust; NoteLayerPropertyChanged(); } -void ScrollbarLayerImpl::SetVisibleToTotalLengthRatio(float ratio) { +void PaintedScrollbarLayerImpl::SetVisibleToTotalLengthRatio(float ratio) { if (visible_to_total_length_ratio_ == ratio) return; visible_to_total_length_ratio_ = ratio; NoteLayerPropertyChanged(); } -void ScrollbarLayerImpl::SetCurrentPos(float current_pos) { +void PaintedScrollbarLayerImpl::SetCurrentPos(float current_pos) { if (current_pos_ == current_pos) return; current_pos_ = current_pos; NoteLayerPropertyChanged(); } -void ScrollbarLayerImpl::SetMaximum(int maximum) { +void PaintedScrollbarLayerImpl::SetMaximum(int maximum) { if (maximum_ == maximum) return; maximum_ = maximum; NoteLayerPropertyChanged(); } -gfx::Rect ScrollbarLayerImpl::ComputeThumbQuadRect() const { +gfx::Rect PaintedScrollbarLayerImpl::ComputeThumbQuadRect() const { // Thumb extent is the length of the thumb in the scrolling direction, thumb // thickness is in the perpendicular direction. Here's an example of a // horizontal scrollbar - inputs are above the scrollbar, computed values @@ -315,8 +315,8 @@ gfx::Rect ScrollbarLayerImpl::ComputeThumbQuadRect() const { return ScrollbarLayerRectToContentRect(thumb_rect); } -const char* ScrollbarLayerImpl::LayerTypeAsString() const { - return "cc::ScrollbarLayerImpl"; +const char* PaintedScrollbarLayerImpl::LayerTypeAsString() const { + return "cc::PaintedScrollbarLayerImpl"; } } // namespace cc diff --git a/cc/layers/scrollbar_layer_impl.h b/cc/layers/painted_scrollbar_layer_impl.h similarity index 79% rename from cc/layers/scrollbar_layer_impl.h rename to cc/layers/painted_scrollbar_layer_impl.h index 86bf25558a06..1fb7972d84d8 100644 --- a/cc/layers/scrollbar_layer_impl.h +++ b/cc/layers/painted_scrollbar_layer_impl.h @@ -1,9 +1,9 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_LAYERS_SCROLLBAR_LAYER_IMPL_H_ -#define CC_LAYERS_SCROLLBAR_LAYER_IMPL_H_ +#ifndef CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_ +#define CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_ #include "cc/base/cc_export.h" #include "cc/input/scrollbar.h" @@ -15,16 +15,16 @@ namespace cc { class LayerTreeImpl; class ScrollView; -class CC_EXPORT ScrollbarLayerImpl : public LayerImpl { +class CC_EXPORT PaintedScrollbarLayerImpl : public LayerImpl { public: - static scoped_ptr Create( + static scoped_ptr Create( LayerTreeImpl* tree_impl, int id, ScrollbarOrientation orientation); - virtual ~ScrollbarLayerImpl(); + virtual ~PaintedScrollbarLayerImpl(); // LayerImpl implementation. - virtual ScrollbarLayerImpl* ToScrollbarLayer() OVERRIDE; + virtual PaintedScrollbarLayerImpl* ToScrollbarLayer() OVERRIDE; virtual scoped_ptr CreateLayerImpl(LayerTreeImpl* tree_impl) OVERRIDE; virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; @@ -65,9 +65,9 @@ class CC_EXPORT ScrollbarLayerImpl : public LayerImpl { gfx::Rect ComputeThumbQuadRect() const; protected: - ScrollbarLayerImpl(LayerTreeImpl* tree_impl, - int id, - ScrollbarOrientation orientation); + PaintedScrollbarLayerImpl(LayerTreeImpl* tree_impl, + int id, + ScrollbarOrientation orientation); private: virtual const char* LayerTypeAsString() const OVERRIDE; @@ -95,8 +95,8 @@ class CC_EXPORT ScrollbarLayerImpl : public LayerImpl { bool is_overlay_scrollbar_; - DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImpl); + DISALLOW_COPY_AND_ASSIGN(PaintedScrollbarLayerImpl); }; } // namespace cc -#endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_H_ +#endif // CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_ diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc index 50d666ad03b8..809e4f83631d 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -2,21 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "cc/layers/scrollbar_layer.h" - #include "base/containers/hash_tables.h" #include "cc/animation/scrollbar_animation_controller.h" #include "cc/debug/test_web_graphics_context_3d.h" #include "cc/layers/append_quads_data.h" -#include "cc/layers/scrollbar_layer_impl.h" +#include "cc/layers/painted_scrollbar_layer.h" +#include "cc/layers/painted_scrollbar_layer_impl.h" #include "cc/quads/solid_color_draw_quad.h" #include "cc/resources/resource_update_queue.h" #include "cc/test/fake_impl_proxy.h" #include "cc/test/fake_layer_tree_host.h" #include "cc/test/fake_layer_tree_host_client.h" #include "cc/test/fake_layer_tree_host_impl.h" +#include "cc/test/fake_painted_scrollbar_layer.h" #include "cc/test/fake_scrollbar.h" -#include "cc/test/fake_scrollbar_layer.h" #include "cc/test/geometry_test_utils.h" #include "cc/test/layer_tree_test.h" #include "cc/test/mock_quad_culler.h" @@ -37,8 +36,7 @@ LayerImpl* LayerImplForScrollAreaAndScrollbar( scoped_refptr layer_tree_root = Layer::Create(); scoped_refptr child1 = Layer::Create(); scoped_refptr child2 = - ScrollbarLayer::Create(scrollbar.Pass(), - child1->id()); + PaintedScrollbarLayer::Create(scrollbar.Pass(), child1->id()); layer_tree_root->AddChild(child1); layer_tree_root->InsertChild(child2, reverse_order ? 0 : 1); host->SetRootLayer(layer_tree_root); @@ -52,8 +50,9 @@ TEST(ScrollbarLayerTest, ResolveScrollLayerPointer) { LayerImplForScrollAreaAndScrollbar(host.get(), scrollbar.Pass(), false); LayerImpl* cc_child1 = layer_impl_tree_root->children()[0]; - ScrollbarLayerImpl* cc_child2 = static_cast( - layer_impl_tree_root->children()[1]); + PaintedScrollbarLayerImpl* cc_child2 = + static_cast( + layer_impl_tree_root->children()[1]); EXPECT_EQ(cc_child1->horizontal_scrollbar_layer(), cc_child2); } @@ -64,8 +63,9 @@ TEST(ScrollbarLayerTest, ResolveScrollLayerPointer_ReverseOrder) { LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar(host.get(), scrollbar.Pass(), true); - ScrollbarLayerImpl* cc_child1 = static_cast( - layer_impl_tree_root->children()[0]); + PaintedScrollbarLayerImpl* cc_child1 = + static_cast( + layer_impl_tree_root->children()[0]); LayerImpl* cc_child2 = layer_impl_tree_root->children()[1]; EXPECT_EQ(cc_child2->horizontal_scrollbar_layer(), cc_child1); @@ -78,8 +78,9 @@ TEST(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) { scoped_ptr scrollbar(new FakeScrollbar); LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar(host.get(), scrollbar.Pass(), false); - ScrollbarLayerImpl* scrollbar_layer_impl = - static_cast(layer_impl_tree_root->children()[1]); + PaintedScrollbarLayerImpl* scrollbar_layer_impl = + static_cast( + layer_impl_tree_root->children()[1]); // When the scrollbar is not an overlay scrollbar, the scroll should be // responded to on the main thread as the compositor does not yet implement @@ -93,8 +94,8 @@ TEST(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) { layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar(host.get(), scrollbar.Pass(), false); - scrollbar_layer_impl = - static_cast(layer_impl_tree_root->children()[1]); + scrollbar_layer_impl = static_cast( + layer_impl_tree_root->children()[1]); // The user shouldn't be able to drag an overlay scrollbar and the scroll // may be handled in the compositor. @@ -103,15 +104,14 @@ TEST(ScrollbarLayerTest, ShouldScrollNonOverlayOnMainThread) { InputHandler::Gesture)); } -TEST(ScrollbarLayerTest, ScrollOffsetSynchronization) { +TEST(PaintedScrollbarLayerTest, ScrollOffsetSynchronization) { scoped_ptr host = FakeLayerTreeHost::Create(); scoped_ptr scrollbar(new FakeScrollbar); scoped_refptr layer_tree_root = Layer::Create(); scoped_refptr content_layer = Layer::Create(); scoped_refptr scrollbar_layer = - ScrollbarLayer::Create(scrollbar.Pass(), - layer_tree_root->id()); + PaintedScrollbarLayer::Create(scrollbar.Pass(), layer_tree_root->id()); layer_tree_root->SetScrollable(true); layer_tree_root->SetScrollOffset(gfx::Vector2d(10, 20)); @@ -128,8 +128,9 @@ TEST(ScrollbarLayerTest, ScrollOffsetSynchronization) { LayerImpl* layer_impl_tree_root = host->CommitAndCreateLayerImplTree(); - ScrollbarLayerImpl* cc_scrollbar_layer = - static_cast(layer_impl_tree_root->children()[1]); + PaintedScrollbarLayerImpl* cc_scrollbar_layer = + static_cast( + layer_impl_tree_root->children()[1]); EXPECT_EQ(10.f, cc_scrollbar_layer->CurrentPos()); EXPECT_EQ(30, cc_scrollbar_layer->Maximum()); @@ -160,8 +161,8 @@ TEST(ScrollbarLayerTest, ThumbRect) { scoped_ptr host = FakeLayerTreeHost::Create(); scoped_refptr root_layer = Layer::Create(); scoped_refptr content_layer = Layer::Create(); - scoped_refptr scrollbar_layer = - FakeScrollbarLayer::Create(false, true, root_layer->id()); + scoped_refptr scrollbar_layer = + FakePaintedScrollbarLayer::Create(false, true, root_layer->id()); root_layer->SetScrollable(true); root_layer->SetMaxScrollOffset(gfx::Vector2d(80, 0)); @@ -180,14 +181,14 @@ TEST(ScrollbarLayerTest, ThumbRect) { scrollbar_layer->fake_scrollbar()->set_thumb_length(4); scrollbar_layer->UpdateThumbAndTrackGeometry(); LayerImpl* root_layer_impl = NULL; - ScrollbarLayerImpl* scrollbar_layer_impl = NULL; + PaintedScrollbarLayerImpl* scrollbar_layer_impl = NULL; // Thumb is at the edge of the scrollbar (should be inset to // the start of the track within the scrollbar layer's // position). scrollbar_layer->UpdateThumbAndTrackGeometry(); root_layer_impl = host->CommitAndCreateLayerImplTree(); - scrollbar_layer_impl = static_cast( + scrollbar_layer_impl = static_cast( root_layer_impl->children()[1]); EXPECT_EQ(gfx::Rect(10, 0, 4, 10).ToString(), scrollbar_layer_impl->ComputeThumbQuadRect().ToString()); @@ -197,7 +198,7 @@ TEST(ScrollbarLayerTest, ThumbRect) { scrollbar_layer->UpdateThumbAndTrackGeometry(); root_layer_impl = host->CommitAndCreateLayerImplTree(); - scrollbar_layer_impl = static_cast( + scrollbar_layer_impl = static_cast( root_layer_impl->children()[1]); EXPECT_EQ(gfx::Rect(10, 0, 4, 10).ToString(), scrollbar_layer_impl->ComputeThumbQuadRect().ToString()); @@ -207,7 +208,7 @@ TEST(ScrollbarLayerTest, ThumbRect) { scrollbar_layer->UpdateThumbAndTrackGeometry(); root_layer_impl = host->CommitAndCreateLayerImplTree(); - scrollbar_layer_impl = static_cast( + scrollbar_layer_impl = static_cast( root_layer_impl->children()[1]); EXPECT_EQ(gfx::Rect(56, 0, 4, 10).ToString(), scrollbar_layer_impl->ComputeThumbQuadRect().ToString()); @@ -218,7 +219,7 @@ TEST(ScrollbarLayerTest, ThumbRect) { scrollbar_layer->UpdateThumbAndTrackGeometry(); root_layer_impl = host->CommitAndCreateLayerImplTree(); - scrollbar_layer_impl = static_cast( + scrollbar_layer_impl = static_cast( root_layer_impl->children()[1]); EXPECT_EQ(gfx::Rect(54, 0, 6, 4).ToString(), scrollbar_layer_impl->ComputeThumbQuadRect().ToString()); @@ -230,7 +231,7 @@ TEST(ScrollbarLayerTest, ThumbRect) { scrollbar_layer->UpdateThumbAndTrackGeometry(); root_layer_impl = host->CommitAndCreateLayerImplTree(); - scrollbar_layer_impl = static_cast( + scrollbar_layer_impl = static_cast( root_layer_impl->children()[1]); EXPECT_EQ(gfx::Rect(44, 0, 6, 4).ToString(), scrollbar_layer_impl->ComputeThumbQuadRect().ToString()); @@ -242,7 +243,7 @@ TEST(ScrollbarLayerTest, ThumbRect) { scrollbar_layer->UpdateThumbAndTrackGeometry(); root_layer_impl = host->CommitAndCreateLayerImplTree(); - scrollbar_layer_impl = static_cast( + scrollbar_layer_impl = static_cast( root_layer_impl->children()[1]); EXPECT_EQ(gfx::Rect(44, 0, 6, 4).ToString(), scrollbar_layer_impl->ComputeThumbQuadRect().ToString()); @@ -258,8 +259,9 @@ TEST(ScrollbarLayerTest, SolidColorDrawQuads) { scoped_ptr scrollbar(new FakeScrollbar(false, true, true)); LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar(host.get(), scrollbar.Pass(), false); - ScrollbarLayerImpl* scrollbar_layer_impl = - static_cast(layer_impl_tree_root->children()[1]); + PaintedScrollbarLayerImpl* scrollbar_layer_impl = + static_cast( + layer_impl_tree_root->children()[1]); scrollbar_layer_impl->SetThumbThickness(3); scrollbar_layer_impl->SetCurrentPos(10.f); scrollbar_layer_impl->SetMaximum(100); @@ -319,8 +321,9 @@ TEST(ScrollbarLayerTest, LayerDrivenSolidColorDrawQuads) { scoped_ptr scrollbar(new FakeScrollbar(false, true, true)); LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar(host.get(), scrollbar.Pass(), false); - ScrollbarLayerImpl* scrollbar_layer_impl = - static_cast(layer_impl_tree_root->children()[1]); + PaintedScrollbarLayerImpl* scrollbar_layer_impl = + static_cast( + layer_impl_tree_root->children()[1]); scrollbar_layer_impl->SetThumbThickness(3); scrollbar_layer_impl->SetTrackLength(10); @@ -352,17 +355,17 @@ class ScrollbarLayerSolidColorThumbTest : public testing::Test { layer_tree_settings.solid_color_scrollbars = true; host_impl_.reset(new FakeLayerTreeHostImpl(layer_tree_settings, &proxy_)); - horizontal_scrollbar_layer_ = ScrollbarLayerImpl::Create( + horizontal_scrollbar_layer_ = PaintedScrollbarLayerImpl::Create( host_impl_->active_tree(), 1, HORIZONTAL); - vertical_scrollbar_layer_ = ScrollbarLayerImpl::Create( + vertical_scrollbar_layer_ = PaintedScrollbarLayerImpl::Create( host_impl_->active_tree(), 2, VERTICAL); } protected: FakeImplProxy proxy_; scoped_ptr host_impl_; - scoped_ptr horizontal_scrollbar_layer_; - scoped_ptr vertical_scrollbar_layer_; + scoped_ptr horizontal_scrollbar_layer_; + scoped_ptr vertical_scrollbar_layer_; }; TEST_F(ScrollbarLayerSolidColorThumbTest, SolidColorThumbLength) { @@ -404,7 +407,7 @@ TEST_F(ScrollbarLayerSolidColorThumbTest, SolidColorThumbPosition) { } TEST_F(ScrollbarLayerSolidColorThumbTest, SolidColorThumbVerticalAdjust) { - ScrollbarLayerImpl* layers[2] = + PaintedScrollbarLayerImpl* layers[2] = { horizontal_scrollbar_layer_.get(), vertical_scrollbar_layer_.get() }; for (size_t i = 0; i < 2; ++i) { layers[i]->SetTrackLength(100); @@ -440,7 +443,7 @@ class ScrollbarLayerTestMaxTextureSize : public LayerTreeTest { virtual void BeginTest() OVERRIDE { scoped_ptr scrollbar(new FakeScrollbar); - scrollbar_layer_ = ScrollbarLayer::Create(scrollbar.Pass(), 1); + scrollbar_layer_ = PaintedScrollbarLayer::Create(scrollbar.Pass(), 1); scrollbar_layer_->SetLayerTreeHost(layer_tree_host()); scrollbar_layer_->SetBounds(bounds_); layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); @@ -470,7 +473,7 @@ class ScrollbarLayerTestMaxTextureSize : public LayerTreeTest { virtual void AfterTest() OVERRIDE {} private: - scoped_refptr scrollbar_layer_; + scoped_refptr scrollbar_layer_; scoped_refptr scroll_layer_; gfx::Size bounds_; }; @@ -558,7 +561,7 @@ class ScrollbarLayerTestResourceCreation : public testing::Test { scoped_refptr layer_tree_root = Layer::Create(); scoped_refptr content_layer = Layer::Create(); scoped_refptr scrollbar_layer = - ScrollbarLayer::Create(scrollbar.Pass(), layer_tree_root->id()); + PaintedScrollbarLayer::Create(scrollbar.Pass(), layer_tree_root->id()); layer_tree_root->AddChild(content_layer); layer_tree_root->AddChild(scrollbar_layer); @@ -631,8 +634,8 @@ class ScaledScrollbarLayerTestResourceCreation : public testing::Test { gfx::Point scrollbar_location(0, 185); scoped_refptr layer_tree_root = Layer::Create(); scoped_refptr content_layer = Layer::Create(); - scoped_refptr scrollbar_layer = - FakeScrollbarLayer::Create(false, true, layer_tree_root->id()); + scoped_refptr scrollbar_layer = + FakePaintedScrollbarLayer::Create(false, true, layer_tree_root->id()); layer_tree_root->AddChild(content_layer); layer_tree_root->AddChild(scrollbar_layer); diff --git a/cc/test/fake_painted_scrollbar_layer.cc b/cc/test/fake_painted_scrollbar_layer.cc new file mode 100644 index 000000000000..72ef420a89c2 --- /dev/null +++ b/cc/test/fake_painted_scrollbar_layer.cc @@ -0,0 +1,56 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "cc/test/fake_painted_scrollbar_layer.h" + +#include "base/auto_reset.h" +#include "cc/resources/resource_update_queue.h" +#include "cc/test/fake_scrollbar.h" + +namespace cc { + +scoped_refptr FakePaintedScrollbarLayer::Create( + bool paint_during_update, + bool has_thumb, + int scrolling_layer_id) { + FakeScrollbar* fake_scrollbar = new FakeScrollbar( + paint_during_update, has_thumb, false); + return make_scoped_refptr(new FakePaintedScrollbarLayer( + fake_scrollbar, scrolling_layer_id)); +} + +FakePaintedScrollbarLayer::FakePaintedScrollbarLayer( + FakeScrollbar* fake_scrollbar, + int scrolling_layer_id) + : PaintedScrollbarLayer(scoped_ptr(fake_scrollbar).Pass(), + scrolling_layer_id), + update_count_(0), + push_properties_count_(0), + fake_scrollbar_(fake_scrollbar) { + SetAnchorPoint(gfx::PointF(0.f, 0.f)); + SetBounds(gfx::Size(1, 1)); + SetIsDrawable(true); +} + +FakePaintedScrollbarLayer::~FakePaintedScrollbarLayer() {} + +bool FakePaintedScrollbarLayer::Update(ResourceUpdateQueue* queue, + const OcclusionTracker* occlusion) { + bool updated = PaintedScrollbarLayer::Update(queue, occlusion); + ++update_count_; + return updated; +} + +void FakePaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { + PaintedScrollbarLayer::PushPropertiesTo(layer); + ++push_properties_count_; +} + +scoped_ptr > +FakePaintedScrollbarLayer::IgnoreSetNeedsCommit() { + return make_scoped_ptr( + new base::AutoReset(&ignore_set_needs_commit_, true)); +} + +} // namespace cc diff --git a/cc/test/fake_scrollbar_layer.h b/cc/test/fake_painted_scrollbar_layer.h similarity index 57% rename from cc/test/fake_scrollbar_layer.h rename to cc/test/fake_painted_scrollbar_layer.h index 775681d4404d..9b1b13dab2cc 100644 --- a/cc/test/fake_scrollbar_layer.h +++ b/cc/test/fake_painted_scrollbar_layer.h @@ -1,23 +1,22 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CC_TEST_FAKE_SCROLLBAR_LAYER_H_ -#define CC_TEST_FAKE_SCROLLBAR_LAYER_H_ +#ifndef CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_ +#define CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_ #include "base/memory/scoped_ptr.h" -#include "cc/layers/scrollbar_layer.h" +#include "cc/layers/painted_scrollbar_layer.h" #include "cc/test/fake_scrollbar.h" namespace base { template class AutoReset; } namespace cc { -class FakeScrollbarLayer : public ScrollbarLayer { +class FakePaintedScrollbarLayer : public PaintedScrollbarLayer { public: - static scoped_refptr Create(bool paint_during_update, - bool has_thumb, - int scrolling_layer_id); + static scoped_refptr + Create(bool paint_during_update, bool has_thumb, int scrolling_layer_id); int update_count() const { return update_count_; } void reset_update_count() { update_count_ = 0; } @@ -33,20 +32,20 @@ class FakeScrollbarLayer : public ScrollbarLayer { // For unit tests UIResourceId track_resource_id() { - return ScrollbarLayer::track_resource_id(); + return PaintedScrollbarLayer::track_resource_id(); } UIResourceId thumb_resource_id() { - return ScrollbarLayer::thumb_resource_id(); + return PaintedScrollbarLayer::thumb_resource_id(); } FakeScrollbar* fake_scrollbar() { return fake_scrollbar_; } - using ScrollbarLayer::UpdateThumbAndTrackGeometry; + using PaintedScrollbarLayer::UpdateThumbAndTrackGeometry; private: - FakeScrollbarLayer(FakeScrollbar* fake_scrollbar, - int scrolling_layer_id); - virtual ~FakeScrollbarLayer(); + FakePaintedScrollbarLayer(FakeScrollbar* fake_scrollbar, + int scrolling_layer_id); + virtual ~FakePaintedScrollbarLayer(); int update_count_; size_t push_properties_count_; @@ -55,4 +54,4 @@ class FakeScrollbarLayer : public ScrollbarLayer { } // namespace cc -#endif // CC_TEST_FAKE_SCROLLBAR_LAYER_H_ +#endif // CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_ diff --git a/cc/test/fake_scrollbar_layer.cc b/cc/test/fake_scrollbar_layer.cc deleted file mode 100644 index d588cf5b4bac..000000000000 --- a/cc/test/fake_scrollbar_layer.cc +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "cc/test/fake_scrollbar_layer.h" - -#include "base/auto_reset.h" -#include "cc/resources/resource_update_queue.h" -#include "cc/test/fake_scrollbar.h" - -namespace cc { - -scoped_refptr FakeScrollbarLayer::Create( - bool paint_during_update, - bool has_thumb, - int scrolling_layer_id) { - FakeScrollbar* fake_scrollbar = new FakeScrollbar( - paint_during_update, has_thumb, false); - return make_scoped_refptr(new FakeScrollbarLayer( - fake_scrollbar, scrolling_layer_id)); -} - -FakeScrollbarLayer::FakeScrollbarLayer(FakeScrollbar* fake_scrollbar, - int scrolling_layer_id) - : ScrollbarLayer( - scoped_ptr(fake_scrollbar).Pass(), - scrolling_layer_id), - update_count_(0), - push_properties_count_(0), - fake_scrollbar_(fake_scrollbar) { - SetAnchorPoint(gfx::PointF(0.f, 0.f)); - SetBounds(gfx::Size(1, 1)); - SetIsDrawable(true); -} - -FakeScrollbarLayer::~FakeScrollbarLayer() {} - -bool FakeScrollbarLayer::Update(ResourceUpdateQueue* queue, - const OcclusionTracker* occlusion) { - bool updated = ScrollbarLayer::Update(queue, occlusion); - ++update_count_; - return updated; -} - -void FakeScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { - ScrollbarLayer::PushPropertiesTo(layer); - ++push_properties_count_; -} - -scoped_ptr > FakeScrollbarLayer::IgnoreSetNeedsCommit() { - return make_scoped_ptr( - new base::AutoReset(&ignore_set_needs_commit_, true)); -} - -} // namespace cc diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 9956f4c73598..cb76b46769dc 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -26,8 +26,8 @@ #include "cc/layers/heads_up_display_layer_impl.h" #include "cc/layers/layer.h" #include "cc/layers/layer_iterator.h" +#include "cc/layers/painted_scrollbar_layer.h" #include "cc/layers/render_surface.h" -#include "cc/layers/scrollbar_layer.h" #include "cc/resources/prioritized_resource_manager.h" #include "cc/resources/ui_resource_client.h" #include "cc/trees/layer_tree_host_client.h" diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index d7a650e61a6f..9f664fcc0ee4 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -28,8 +28,8 @@ #include "cc/layers/heads_up_display_layer_impl.h" #include "cc/layers/layer_impl.h" #include "cc/layers/layer_iterator.h" +#include "cc/layers/painted_scrollbar_layer_impl.h" #include "cc/layers/render_surface_impl.h" -#include "cc/layers/scrollbar_layer_impl.h" #include "cc/output/compositor_frame_metadata.h" #include "cc/output/copy_output_request.h" #include "cc/output/delegating_renderer.h" diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 0c4fc352eb97..98f48668fa55 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -16,9 +16,9 @@ #include "cc/layers/heads_up_display_layer_impl.h" #include "cc/layers/io_surface_layer_impl.h" #include "cc/layers/layer_impl.h" +#include "cc/layers/painted_scrollbar_layer_impl.h" #include "cc/layers/quad_sink.h" #include "cc/layers/render_surface_impl.h" -#include "cc/layers/scrollbar_layer_impl.h" #include "cc/layers/solid_color_layer_impl.h" #include "cc/layers/texture_layer_impl.h" #include "cc/layers/tiled_layer_impl.h" @@ -723,8 +723,8 @@ TEST_F(LayerTreeHostImplTest, ScrollVerticallyByPageReturnsCorrectValue) { EXPECT_FALSE(host_impl_->ScrollVerticallyByPage( gfx::Point(), SCROLL_BACKWARD)); - scoped_ptr vertical_scrollbar( - cc::ScrollbarLayerImpl::Create( + scoped_ptr vertical_scrollbar( + cc::PaintedScrollbarLayerImpl::Create( host_impl_->active_tree(), 20, VERTICAL)); @@ -1123,10 +1123,8 @@ TEST_F(LayerTreeHostImplTest, ScrollbarLinearFadeScheduling) { contents->SetBounds(content_size); contents->SetContentBounds(content_size); - scoped_ptr scrollbar = ScrollbarLayerImpl::Create( - host_impl_->active_tree(), - 4, - VERTICAL); + scoped_ptr scrollbar = + PaintedScrollbarLayerImpl::Create(host_impl_->active_tree(), 4, VERTICAL); scroll->SetVerticalScrollbarLayer(scrollbar.get()); scroll->AddChild(contents.Pass()); diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 07c39a3d89a4..73033a19b486 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -15,8 +15,8 @@ #include "cc/layers/content_layer_client.h" #include "cc/layers/io_surface_layer.h" #include "cc/layers/layer_impl.h" +#include "cc/layers/painted_scrollbar_layer.h" #include "cc/layers/picture_layer.h" -#include "cc/layers/scrollbar_layer.h" #include "cc/layers/solid_color_layer.h" #include "cc/layers/video_layer.h" #include "cc/output/begin_frame_args.h" @@ -31,11 +31,11 @@ #include "cc/test/fake_content_layer_client.h" #include "cc/test/fake_layer_tree_host_client.h" #include "cc/test/fake_output_surface.h" +#include "cc/test/fake_painted_scrollbar_layer.h" #include "cc/test/fake_picture_layer.h" #include "cc/test/fake_picture_layer_impl.h" #include "cc/test/fake_proxy.h" #include "cc/test/fake_scoped_ui_resource.h" -#include "cc/test/fake_scrollbar_layer.h" #include "cc/test/fake_video_frame_provider.h" #include "cc/test/geometry_test_utils.h" #include "cc/test/layer_tree_test.h" @@ -394,9 +394,8 @@ class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate bool paint_scrollbar = true; bool has_thumb = false; - scrollbar_ = FakeScrollbarLayer::Create(paint_scrollbar, - has_thumb, - root_layer_->id()); + scrollbar_ = FakePaintedScrollbarLayer::Create( + paint_scrollbar, has_thumb, root_layer_->id()); scrollbar_->SetPosition(gfx::Point(0, 10)); scrollbar_->SetBounds(gfx::Size(10, 10)); @@ -437,7 +436,7 @@ class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate private: FakeContentLayerClient client_; scoped_refptr root_layer_; - scoped_refptr scrollbar_; + scoped_refptr scrollbar_; }; SINGLE_AND_MULTI_THREAD_TEST_F( @@ -1127,8 +1126,8 @@ class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { bool paint_scrollbar = true; bool has_thumb = false; - scrollbar_ = - FakeScrollbarLayer::Create(paint_scrollbar, has_thumb, layer_->id()); + scrollbar_ = FakePaintedScrollbarLayer::Create( + paint_scrollbar, has_thumb, layer_->id()); scrollbar_->SetPosition(gfx::Point(0, 10)); scrollbar_->SetBounds(gfx::Size(10, 10)); @@ -1212,7 +1211,7 @@ class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest { protected: FakeContentLayerClient client_; scoped_refptr layer_; - scoped_refptr scrollbar_; + scoped_refptr scrollbar_; int drew_frame_; }; @@ -3507,7 +3506,7 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest { child2_ = PushPropertiesCountingLayer::Create(); grandchild_ = PushPropertiesCountingLayer::Create(); leaf_scrollbar_layer_ = - FakeScrollbarLayer::Create(false, false, root_->id()); + FakePaintedScrollbarLayer::Create(false, false, root_->id()); root_->AddChild(child_); root_->AddChild(child2_); @@ -3669,7 +3668,7 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest { scoped_refptr child2_; scoped_refptr grandchild_; scoped_refptr other_root_; - scoped_refptr leaf_scrollbar_layer_; + scoped_refptr leaf_scrollbar_layer_; size_t expected_push_properties_root_; size_t expected_push_properties_child_; size_t expected_push_properties_child2_; @@ -3693,8 +3692,8 @@ class LayerTreeHostTestPropertyChangesDuringUpdateArePushed bool paint_scrollbar = true; bool has_thumb = false; - scrollbar_layer_ = - FakeScrollbarLayer::Create(paint_scrollbar, has_thumb, root_->id()); + scrollbar_layer_ = FakePaintedScrollbarLayer::Create( + paint_scrollbar, has_thumb, root_->id()); root_->AddChild(scrollbar_layer_); @@ -3734,7 +3733,7 @@ class LayerTreeHostTestPropertyChangesDuringUpdateArePushed virtual void AfterTest() OVERRIDE {} scoped_refptr root_; - scoped_refptr scrollbar_layer_; + scoped_refptr scrollbar_layer_; }; MULTI_THREAD_TEST_F(LayerTreeHostTestPropertyChangesDuringUpdateArePushed); diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc index d6d501bdd9d7..d9ae64c2eb2d 100644 --- a/cc/trees/layer_tree_host_unittest_context.cc +++ b/cc/trees/layer_tree_host_unittest_context.cc @@ -11,8 +11,8 @@ #include "cc/layers/heads_up_display_layer.h" #include "cc/layers/io_surface_layer.h" #include "cc/layers/layer_impl.h" +#include "cc/layers/painted_scrollbar_layer.h" #include "cc/layers/picture_layer.h" -#include "cc/layers/scrollbar_layer.h" #include "cc/layers/texture_layer.h" #include "cc/layers/texture_layer_impl.h" #include "cc/layers/video_layer.h" @@ -25,9 +25,9 @@ #include "cc/test/fake_delegated_renderer_layer_impl.h" #include "cc/test/fake_layer_tree_host_client.h" #include "cc/test/fake_output_surface.h" +#include "cc/test/fake_painted_scrollbar_layer.h" #include "cc/test/fake_scoped_ui_resource.h" #include "cc/test/fake_scrollbar.h" -#include "cc/test/fake_scrollbar_layer.h" #include "cc/test/fake_video_frame_provider.h" #include "cc/test/layer_tree_test.h" #include "cc/test/render_pass_test_common.h" @@ -1200,9 +1200,9 @@ class LayerTreeHostContextTestDontUseLostResources debug_state.show_property_changed_rects = true; layer_tree_host()->SetDebugState(debug_state); - scoped_refptr scrollbar_ = ScrollbarLayer::Create( - scoped_ptr(new FakeScrollbar).Pass(), - content_->id()); + scoped_refptr scrollbar_ = + PaintedScrollbarLayer::Create( + scoped_ptr(new FakeScrollbar).Pass(), content_->id()); scrollbar_->SetBounds(gfx::Size(10, 10)); scrollbar_->SetAnchorPoint(gfx::PointF()); scrollbar_->SetIsDrawable(true); @@ -1347,7 +1347,7 @@ class LayerTreeHostContextTestDontUseLostResources scoped_refptr video_hw_; scoped_refptr video_scaled_hw_; scoped_refptr io_surface_; - scoped_refptr scrollbar_; + scoped_refptr scrollbar_; scoped_refptr color_video_frame_; scoped_refptr hw_video_frame_; @@ -1519,7 +1519,7 @@ class ScrollbarLayerLostContext : public LayerTreeHostContextTest { virtual void BeginTest() OVERRIDE { scoped_refptr scroll_layer = Layer::Create(); - scrollbar_layer_ = FakeScrollbarLayer::Create( + scrollbar_layer_ = FakePaintedScrollbarLayer::Create( false, true, scroll_layer->id()); scrollbar_layer_->SetBounds(gfx::Size(10, 100)); layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); @@ -1553,7 +1553,7 @@ class ScrollbarLayerLostContext : public LayerTreeHostContextTest { private: int commits_; - scoped_refptr scrollbar_layer_; + scoped_refptr scrollbar_layer_; }; SINGLE_AND_MULTI_THREAD_TEST_F(ScrollbarLayerLostContext); diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc index 7b2e27ff0a01..8224e2299dc6 100644 --- a/cc/trees/layer_tree_host_unittest_damage.cc +++ b/cc/trees/layer_tree_host_unittest_damage.cc @@ -6,7 +6,7 @@ #include "cc/test/fake_content_layer.h" #include "cc/test/fake_content_layer_client.h" -#include "cc/test/fake_scrollbar_layer.h" +#include "cc/test/fake_painted_scrollbar_layer.h" #include "cc/test/layer_tree_test.h" #include "cc/trees/damage_tracker.h" #include "cc/trees/layer_tree_impl.h" @@ -306,7 +306,7 @@ class LayerTreeHostDamageTestScrollbarDoesDamage root_layer->AddChild(content_layer); scoped_refptr scrollbar_layer = - FakeScrollbarLayer::Create(false, true, content_layer->id()); + FakePaintedScrollbarLayer::Create(false, true, content_layer->id()); scrollbar_layer->SetPosition(gfx::Point(300, 300)); scrollbar_layer->SetBounds(gfx::Size(10, 100)); root_layer->AddChild(scrollbar_layer); diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 35cb6df6a277..f9b294b5d35f 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc @@ -9,8 +9,8 @@ #include "cc/animation/scrollbar_animation_controller.h" #include "cc/debug/traced_value.h" #include "cc/layers/heads_up_display_layer_impl.h" +#include "cc/layers/painted_scrollbar_layer_impl.h" #include "cc/layers/render_surface_impl.h" -#include "cc/layers/scrollbar_layer_impl.h" #include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_host_impl.h" #include "ui/gfx/size_conversions.h" @@ -271,12 +271,14 @@ void LayerTreeImpl::UpdateSolidColorScrollbars() { if (RootContainerLayer()) vertical_adjust = layer_tree_host_impl_->VisibleViewportSize().height() - RootContainerLayer()->bounds().height(); - if (ScrollbarLayerImpl* horiz = root_scroll->horizontal_scrollbar_layer()) { + if (PaintedScrollbarLayerImpl* horiz = + root_scroll->horizontal_scrollbar_layer()) { horiz->SetVerticalAdjust(vertical_adjust); horiz->SetVisibleToTotalLengthRatio( scrollable_viewport.width() / ScrollableSize().width()); } - if (ScrollbarLayerImpl* vertical = root_scroll->vertical_scrollbar_layer()) { + if (PaintedScrollbarLayerImpl* vertical = + root_scroll->vertical_scrollbar_layer()) { vertical->SetVerticalAdjust(vertical_adjust); vertical->SetVisibleToTotalLengthRatio( scrollable_viewport.height() / ScrollableSize().height()); diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc index f307257ff058..aed4de0d624e 100644 --- a/cc/trees/tree_synchronizer.cc +++ b/cc/trees/tree_synchronizer.cc @@ -11,8 +11,8 @@ #include "cc/input/scrollbar.h" #include "cc/layers/layer.h" #include "cc/layers/layer_impl.h" -#include "cc/layers/scrollbar_layer.h" -#include "cc/layers/scrollbar_layer_impl.h" +#include "cc/layers/painted_scrollbar_layer.h" +#include "cc/layers/painted_scrollbar_layer_impl.h" namespace cc { @@ -155,9 +155,10 @@ void UpdateScrollbarLayerPointersRecursiveInternal( RawPtrLayerImplMap::const_iterator iter = new_layers->find(scrollbar_layer->id()); - ScrollbarLayerImpl* scrollbar_layer_impl = - iter != new_layers->end() ? static_cast(iter->second) - : NULL; + PaintedScrollbarLayerImpl* scrollbar_layer_impl = + iter != new_layers->end() + ? static_cast(iter->second) + : NULL; iter = new_layers->find(scrollbar_layer->scroll_layer_id()); LayerImpl* scroll_layer_impl = iter != new_layers->end() ? iter->second : NULL; @@ -173,14 +174,15 @@ void UpdateScrollbarLayerPointersRecursiveInternal( void UpdateScrollbarLayerPointersRecursive(const RawPtrLayerImplMap* new_layers, Layer* layer) { - UpdateScrollbarLayerPointersRecursiveInternal( + UpdateScrollbarLayerPointersRecursiveInternal( new_layers, layer); } void UpdateScrollbarLayerPointersRecursive(const RawPtrLayerImplMap* new_layers, LayerImpl* layer) { - UpdateScrollbarLayerPointersRecursiveInternal( - new_layers, layer); + UpdateScrollbarLayerPointersRecursiveInternal< + LayerImpl, + PaintedScrollbarLayerImpl>(new_layers, layer); } // static diff --git a/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc b/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc index a8080212beb7..0529d5c66633 100644 --- a/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc +++ b/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc @@ -4,12 +4,12 @@ #include "webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h" -#include "cc/layers/scrollbar_layer.h" +#include "cc/layers/painted_scrollbar_layer.h" #include "third_party/WebKit/public/platform/WebScrollbar.h" #include "webkit/renderer/compositor_bindings/scrollbar_impl.h" #include "webkit/renderer/compositor_bindings/web_layer_impl.h" -using cc::ScrollbarLayer; +using cc::PaintedScrollbarLayer; namespace webkit { @@ -17,7 +17,7 @@ WebScrollbarLayerImpl::WebScrollbarLayerImpl( WebKit::WebScrollbar* scrollbar, WebKit::WebScrollbarThemePainter painter, WebKit::WebScrollbarThemeGeometry* geometry) - : layer_(new WebLayerImpl(ScrollbarLayer::Create( + : layer_(new WebLayerImpl(PaintedScrollbarLayer::Create( scoped_ptr(new ScrollbarImpl( make_scoped_ptr(scrollbar), painter, @@ -29,7 +29,7 @@ WebKit::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); } void WebScrollbarLayerImpl::setScrollLayer(WebKit::WebLayer* layer) { int id = layer ? static_cast(layer)->layer()->id() : 0; - static_cast(layer_->layer())->SetScrollLayerId(id); + static_cast(layer_->layer())->SetScrollLayerId(id); } } // namespace webkit -- 2.11.4.GIT