| Index: cc/layers/scrollbar_layer.cc
|
| diff --git a/cc/layers/scrollbar_layer.cc b/cc/layers/scrollbar_layer.cc
|
| index a2fdd58ee36ac859f388cff2325df445a56b432f..d999ddce4b678e443d72203d8f8ae849df9ec881 100644
|
| --- a/cc/layers/scrollbar_layer.cc
|
| +++ b/cc/layers/scrollbar_layer.cc
|
| @@ -36,8 +36,8 @@ scoped_refptr<ScrollbarLayer> ScrollbarLayer::Create(
|
| ScrollbarLayer::ScrollbarLayer(
|
| scoped_ptr<Scrollbar> scrollbar,
|
| int scroll_layer_id)
|
| - : scrollbar_(scrollbar.Pass()),
|
| - scroll_layer_id_(scroll_layer_id) {
|
| + : scroll_layer_id_(scroll_layer_id),
|
| + scrollbar_(scrollbar.Pass()) {
|
| if (!scrollbar_->IsOverlay())
|
| SetShouldScrollOnMainThread(true);
|
| }
|
| @@ -56,8 +56,8 @@ bool ScrollbarLayer::OpacityCanAnimateOnImplThread() const {
|
| return scrollbar_->IsOverlay();
|
| }
|
|
|
| -ScrollbarOrientation ScrollbarLayer::Orientation() const {
|
| - return scrollbar_->Orientation();
|
| +ScrollbarLayerInterface* ScrollbarLayer::ToScrollbarLayer() {
|
| + return this;
|
| }
|
|
|
| int ScrollbarLayer::MaxTextureSize() {
|
| @@ -65,10 +65,15 @@ int ScrollbarLayer::MaxTextureSize() {
|
| return layer_tree_host()->GetRendererCapabilities().max_texture_size;
|
| }
|
|
|
| -float ScrollbarLayer::ClampScaleToMaxTextureSize(float scale) {
|
| - if (layer_tree_host()->settings().solid_color_scrollbars)
|
| - return scale;
|
| +int ScrollbarLayer::ScrollLayerId() const {
|
| + return scroll_layer_id_;
|
| +}
|
| +
|
| +ScrollbarOrientation ScrollbarLayer::orientation() const {
|
| + return scrollbar_->Orientation();
|
| +}
|
|
|
| +float ScrollbarLayer::ClampScaleToMaxTextureSize(float scale) {
|
| // If the scaled content_bounds() is bigger than the max texture size of the
|
| // device, we need to clamp it by rescaling, since content_bounds() is used
|
| // below to set the texture size.
|
| @@ -105,23 +110,9 @@ void ScrollbarLayer::PushPropertiesTo(LayerImpl* layer) {
|
|
|
| ScrollbarLayerImpl* scrollbar_layer = static_cast<ScrollbarLayerImpl*>(layer);
|
|
|
| - if (layer_tree_host() &&
|
| - layer_tree_host()->settings().solid_color_scrollbars) {
|
| - int thickness_override =
|
| - layer_tree_host()->settings().solid_color_scrollbar_thickness_dip;
|
| - if (thickness_override != -1) {
|
| - scrollbar_layer->SetThumbThickness(thickness_override);
|
| - } else {
|
| - if (Orientation() == HORIZONTAL)
|
| - scrollbar_layer->SetThumbThickness(bounds().height());
|
| - else
|
| - scrollbar_layer->SetThumbThickness(bounds().width());
|
| - }
|
| - } else {
|
| - scrollbar_layer->SetThumbThickness(thumb_thickness_);
|
| - }
|
| + scrollbar_layer->SetThumbThickness(thumb_thickness_);
|
| scrollbar_layer->SetThumbLength(thumb_length_);
|
| - if (Orientation() == HORIZONTAL) {
|
| + if (orientation() == HORIZONTAL) {
|
| scrollbar_layer->SetTrackStart(track_rect_.x());
|
| scrollbar_layer->SetTrackLength(track_rect_.width());
|
| } else {
|
| @@ -140,10 +131,6 @@ void ScrollbarLayer::PushPropertiesTo(LayerImpl* layer) {
|
| needs_push_properties_ = true;
|
| }
|
|
|
| -ScrollbarLayer* ScrollbarLayer::ToScrollbarLayer() {
|
| - return this;
|
| -}
|
| -
|
| void ScrollbarLayer::SetLayerTreeHost(LayerTreeHost* host) {
|
| // When the LTH is set to null or has changed, then this layer should remove
|
| // all of its associated resources.
|
| @@ -170,7 +157,7 @@ gfx::Rect ScrollbarLayer::ScrollbarLayerRectToContentRect(
|
|
|
| gfx::Rect ScrollbarLayer::OriginThumbRect() const {
|
| gfx::Size thumb_size;
|
| - if (Orientation() == HORIZONTAL) {
|
| + if (orientation() == HORIZONTAL) {
|
| thumb_size =
|
| gfx::Size(scrollbar_->ThumbLength(), scrollbar_->ThumbThickness());
|
| } else {
|
| @@ -186,8 +173,7 @@ bool ScrollbarLayer::Update(ResourceUpdateQueue* queue,
|
| gfx::Rect scaled_track_rect = ScrollbarLayerRectToContentRect(
|
| gfx::Rect(scrollbar_->Location(), bounds()));
|
|
|
| - if (layer_tree_host()->settings().solid_color_scrollbars ||
|
| - track_rect_.IsEmpty() || scaled_track_rect.IsEmpty())
|
| + if (track_rect_.IsEmpty() || scaled_track_rect.IsEmpty())
|
| return false;
|
|
|
| {
|
| @@ -213,7 +199,6 @@ bool ScrollbarLayer::Update(ResourceUpdateQueue* queue,
|
| scoped_refptr<UIResourceBitmap> ScrollbarLayer::RasterizeScrollbarPart(
|
| gfx::Rect rect,
|
| ScrollbarPart part) {
|
| - DCHECK(!layer_tree_host()->settings().solid_color_scrollbars);
|
| DCHECK(!rect.size().IsEmpty());
|
|
|
| scoped_refptr<UIResourceBitmap> bitmap =
|
|
|