Index: cc/layers/scrollbar_layer.cc |
diff --git a/cc/layers/scrollbar_layer.cc b/cc/layers/scrollbar_layer.cc |
index bc88a2cb66176821fa253b1de187c75bad81d664..3c0dca9f9c1c3a7e7b85eae14e91db6972b7fe48 100644 |
--- a/cc/layers/scrollbar_layer.cc |
+++ b/cc/layers/scrollbar_layer.cc |
@@ -21,21 +21,26 @@ namespace cc { |
scoped_ptr<LayerImpl> ScrollbarLayer::CreateLayerImpl( |
LayerTreeImpl* tree_impl) { |
return ScrollbarLayerImpl::Create( |
- tree_impl, id(), scrollbar_->Orientation()).PassAs<LayerImpl>(); |
+ tree_impl, id(), scrollbar_->Orientation(), is_solid_color_) |
+ .PassAs<LayerImpl>(); |
} |
scoped_refptr<ScrollbarLayer> ScrollbarLayer::Create( |
scoped_ptr<Scrollbar> scrollbar, |
- int scroll_layer_id) { |
+ int scroll_layer_id, |
+ bool is_solid_color) { |
return make_scoped_refptr(new ScrollbarLayer(scrollbar.Pass(), |
- scroll_layer_id)); |
+ scroll_layer_id, |
+ is_solid_color)); |
} |
ScrollbarLayer::ScrollbarLayer( |
scoped_ptr<Scrollbar> scrollbar, |
- int scroll_layer_id) |
+ int scroll_layer_id, |
+ bool is_solid_color) |
: scrollbar_(scrollbar.Pass()), |
scroll_layer_id_(scroll_layer_id), |
+ is_solid_color_(is_solid_color), |
texture_format_(GL_INVALID_ENUM) { |
if (!scrollbar_->IsOverlay()) |
SetShouldScrollOnMainThread(true); |
@@ -65,7 +70,7 @@ int ScrollbarLayer::MaxTextureSize() { |
} |
float ScrollbarLayer::ClampScaleToMaxTextureSize(float scale) { |
- if (layer_tree_host()->settings().solid_color_scrollbars) |
+ if (is_solid_color()) |
return scale; |
// If the scaled content_bounds() is bigger than the max texture size of the |
@@ -104,8 +109,7 @@ void ScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { |
ScrollbarLayerImpl* scrollbar_layer = static_cast<ScrollbarLayerImpl*>(layer); |
- if (layer_tree_host() && |
- layer_tree_host()->settings().solid_color_scrollbars) { |
+ if (layer_tree_host() && is_solid_color()) { |
int thickness_override = |
layer_tree_host()->settings().solid_color_scrollbar_thickness_dip; |
if (thickness_override != -1) { |
@@ -127,6 +131,7 @@ void ScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { |
scrollbar_layer->set_track_start(track_rect_.y()); |
scrollbar_layer->set_track_length(track_rect_.height()); |
} |
+ scrollbar_layer->set_is_solid_color(is_solid_color()); |
if (track_ && track_->texture()->have_backing_texture()) |
scrollbar_layer->set_track_resource_id(track_->texture()->resource_id()); |
@@ -174,7 +179,7 @@ class ScrollbarPartPainter : public LayerPainter { |
}; |
void ScrollbarLayer::CreateUpdaterIfNeeded() { |
- if (layer_tree_host()->settings().solid_color_scrollbars) |
+ if (is_solid_color()) |
return; |
texture_format_ = |
@@ -212,7 +217,7 @@ void ScrollbarLayer::UpdatePart(CachingBitmapContentLayerUpdater* painter, |
gfx::Rect rect, |
ResourceUpdateQueue* queue, |
RenderingStats* stats) { |
- if (layer_tree_host()->settings().solid_color_scrollbars) |
+ if (is_solid_color()) |
return; |
// Skip painting and uploading if there are no invalidations and |
@@ -266,7 +271,7 @@ gfx::Rect ScrollbarLayer::ScrollbarLayerRectToContentRect( |
void ScrollbarLayer::SetTexturePriorities( |
const PriorityCalculator& priority_calc) { |
- if (layer_tree_host()->settings().solid_color_scrollbars) |
+ if (is_solid_color()) |
return; |
if (content_bounds().IsEmpty()) |
@@ -295,7 +300,7 @@ void ScrollbarLayer::Update(ResourceUpdateQueue* queue, |
RenderingStats* stats) { |
track_rect_ = scrollbar_->TrackRect(); |
- if (layer_tree_host()->settings().solid_color_scrollbars) |
+ if (is_solid_color()) |
return; |
{ |