OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/layers/painted_scrollbar_layer.h" | 5 #include "cc/layers/painted_scrollbar_layer.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/layers/painted_scrollbar_layer_impl.h" | 10 #include "cc/layers/painted_scrollbar_layer_impl.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 102 } |
103 | 103 |
104 void PaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { | 104 void PaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { |
105 ContentsScalingLayer::PushPropertiesTo(layer); | 105 ContentsScalingLayer::PushPropertiesTo(layer); |
106 | 106 |
107 PaintedScrollbarLayerImpl* scrollbar_layer = | 107 PaintedScrollbarLayerImpl* scrollbar_layer = |
108 static_cast<PaintedScrollbarLayerImpl*>(layer); | 108 static_cast<PaintedScrollbarLayerImpl*>(layer); |
109 | 109 |
110 if (layer_tree_host() && | 110 if (layer_tree_host() && |
111 layer_tree_host()->settings().solid_color_scrollbars) { | 111 layer_tree_host()->settings().solid_color_scrollbars) { |
112 int thickness_override = | 112 scrollbar_layer->SetThumbThickness(scrollbar_->ThumbThickness()); |
113 layer_tree_host()->settings().solid_color_scrollbar_thickness_dip; | |
114 if (thickness_override != -1) { | |
115 scrollbar_layer->SetThumbThickness(thickness_override); | |
116 } else { | |
117 if (Orientation() == HORIZONTAL) | |
118 scrollbar_layer->SetThumbThickness(bounds().height()); | |
119 else | |
120 scrollbar_layer->SetThumbThickness(bounds().width()); | |
121 } | |
122 } else { | 113 } else { |
123 scrollbar_layer->SetThumbThickness(thumb_thickness_); | 114 scrollbar_layer->SetThumbThickness(thumb_thickness_); |
124 } | 115 } |
125 scrollbar_layer->SetThumbLength(thumb_length_); | 116 scrollbar_layer->SetThumbLength(thumb_length_); |
126 if (Orientation() == HORIZONTAL) { | 117 if (Orientation() == HORIZONTAL) { |
127 scrollbar_layer->SetTrackStart( | 118 scrollbar_layer->SetTrackStart( |
128 track_rect_.x() - scrollbar_->Location().x()); | 119 track_rect_.x() - scrollbar_->Location().x()); |
129 scrollbar_layer->SetTrackLength(track_rect_.width()); | 120 scrollbar_layer->SetTrackLength(track_rect_.width()); |
130 } else { | 121 } else { |
131 scrollbar_layer->SetTrackStart( | 122 scrollbar_layer->SetTrackStart( |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 paint.setXfermodeMode(SkXfermode::kClear_Mode); | 240 paint.setXfermodeMode(SkXfermode::kClear_Mode); |
250 skcanvas.drawRect(layer_skrect, paint); | 241 skcanvas.drawRect(layer_skrect, paint); |
251 skcanvas.clipRect(layer_skrect); | 242 skcanvas.clipRect(layer_skrect); |
252 | 243 |
253 scrollbar_->PaintPart(&skcanvas, part, layer_rect); | 244 scrollbar_->PaintPart(&skcanvas, part, layer_rect); |
254 | 245 |
255 return bitmap; | 246 return bitmap; |
256 } | 247 } |
257 | 248 |
258 } // namespace cc | 249 } // namespace cc |
OLD | NEW |