OLD | NEW |
1 | 1 |
2 // Copyright 2012 The Chromium Authors. All rights reserved. | 2 // Copyright 2012 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "cc/layers/scrollbar_layer.h" | 6 #include "cc/layers/scrollbar_layer.h" |
7 | 7 |
8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void ScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { | 102 void ScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { |
103 ContentsScalingLayer::PushPropertiesTo(layer); | 103 ContentsScalingLayer::PushPropertiesTo(layer); |
104 | 104 |
105 ScrollbarLayerImpl* scrollbar_layer = static_cast<ScrollbarLayerImpl*>(layer); | 105 ScrollbarLayerImpl* scrollbar_layer = static_cast<ScrollbarLayerImpl*>(layer); |
106 | 106 |
107 if (layer_tree_host() && | 107 if (layer_tree_host() && |
108 layer_tree_host()->settings().solid_color_scrollbars) { | 108 layer_tree_host()->settings().solid_color_scrollbars) { |
109 int thickness_override = | 109 int thickness_override = |
110 layer_tree_host()->settings().solid_color_scrollbar_thickness_dip; | 110 layer_tree_host()->settings().solid_color_scrollbar_thickness_dip; |
111 if (thickness_override != -1) { | 111 if (thickness_override != -1) { |
112 scrollbar_layer->set_thumb_thickness(thickness_override); | 112 scrollbar_layer->SetThumbThickness(thickness_override); |
113 } else { | 113 } else { |
114 if (Orientation() == HORIZONTAL) | 114 if (Orientation() == HORIZONTAL) |
115 scrollbar_layer->set_thumb_thickness(bounds().height()); | 115 scrollbar_layer->SetThumbThickness(bounds().height()); |
116 else | 116 else |
117 scrollbar_layer->set_thumb_thickness(bounds().width()); | 117 scrollbar_layer->SetThumbThickness(bounds().width()); |
118 } | 118 } |
119 } else { | 119 } else { |
120 scrollbar_layer->set_thumb_thickness(thumb_thickness_); | 120 scrollbar_layer->SetThumbThickness(thumb_thickness_); |
121 } | 121 } |
122 scrollbar_layer->set_thumb_length(thumb_length_); | 122 scrollbar_layer->SetThumbLength(thumb_length_); |
123 if (Orientation() == HORIZONTAL) { | 123 if (Orientation() == HORIZONTAL) { |
124 scrollbar_layer->set_track_start(track_rect_.x()); | 124 scrollbar_layer->SetTrackStart(track_rect_.x()); |
125 scrollbar_layer->set_track_length(track_rect_.width()); | 125 scrollbar_layer->SetTrackLength(track_rect_.width()); |
126 } else { | 126 } else { |
127 scrollbar_layer->set_track_start(track_rect_.y()); | 127 scrollbar_layer->SetTrackStart(track_rect_.y()); |
128 scrollbar_layer->set_track_length(track_rect_.height()); | 128 scrollbar_layer->SetTrackLength(track_rect_.height()); |
129 } | 129 } |
130 | 130 |
131 if (track_ && track_->texture()->have_backing_texture()) | 131 if (track_ && track_->texture()->have_backing_texture()) |
132 scrollbar_layer->set_track_resource_id(track_->texture()->resource_id()); | 132 scrollbar_layer->set_track_resource_id(track_->texture()->resource_id()); |
133 else | 133 else |
134 scrollbar_layer->set_track_resource_id(0); | 134 scrollbar_layer->set_track_resource_id(0); |
135 | 135 |
136 if (thumb_ && thumb_->texture()->have_backing_texture()) | 136 if (thumb_ && thumb_->texture()->have_backing_texture()) |
137 scrollbar_layer->set_thumb_resource_id(thumb_->texture()->resource_id()); | 137 scrollbar_layer->set_thumb_resource_id(thumb_->texture()->resource_id()); |
138 else | 138 else |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 thumb_size = gfx::Size(scrollbar_->ThumbLength(), | 343 thumb_size = gfx::Size(scrollbar_->ThumbLength(), |
344 scrollbar_->ThumbThickness()); | 344 scrollbar_->ThumbThickness()); |
345 } else { | 345 } else { |
346 thumb_size = gfx::Size(scrollbar_->ThumbThickness(), | 346 thumb_size = gfx::Size(scrollbar_->ThumbThickness(), |
347 scrollbar_->ThumbLength()); | 347 scrollbar_->ThumbLength()); |
348 } | 348 } |
349 return ScrollbarLayerRectToContentRect(gfx::Rect(thumb_size)); | 349 return ScrollbarLayerRectToContentRect(gfx::Rect(thumb_size)); |
350 } | 350 } |
351 | 351 |
352 } // namespace cc | 352 } // namespace cc |
OLD | NEW |