Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: cc/layers/scrollbar_layer_impl.cc

Issue 23102003: Note scrollbar layer properties changed when position changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layers/scrollbar_layer_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/scrollbar_layer_impl.h" 5 #include "cc/layers/scrollbar_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/animation/scrollbar_animation_controller.h" 9 #include "cc/animation/scrollbar_animation_controller.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 gfx::Rect ScrollbarLayerImpl::ScrollbarLayerRectToContentRect( 163 gfx::Rect ScrollbarLayerImpl::ScrollbarLayerRectToContentRect(
164 gfx::RectF layer_rect) const { 164 gfx::RectF layer_rect) const {
165 // Don't intersect with the bounds as in layerRectToContentRect() because 165 // Don't intersect with the bounds as in layerRectToContentRect() because
166 // layer_rect here might be in coordinates of the containing layer. 166 // layer_rect here might be in coordinates of the containing layer.
167 gfx::RectF content_rect = gfx::ScaleRect(layer_rect, 167 gfx::RectF content_rect = gfx::ScaleRect(layer_rect,
168 contents_scale_x(), 168 contents_scale_x(),
169 contents_scale_y()); 169 contents_scale_y());
170 return gfx::ToEnclosingRect(content_rect); 170 return gfx::ToEnclosingRect(content_rect);
171 } 171 }
172 172
173 void ScrollbarLayerImpl::SetCurrentPos(float current_pos) {
174 current_pos_ = current_pos;
175 NoteLayerPropertyChanged();
176 }
177
178 void ScrollbarLayerImpl::SetMaximum(int maximum) {
179 maximum_ = maximum;
danakj 2013/08/13 19:32:40 Yes please early out here if maximum_ == maximum.
180 NoteLayerPropertyChanged();
181 }
182
173 gfx::Rect ScrollbarLayerImpl::ComputeThumbQuadRect() const { 183 gfx::Rect ScrollbarLayerImpl::ComputeThumbQuadRect() const {
174 // Thumb extent is the length of the thumb in the scrolling direction, thumb 184 // Thumb extent is the length of the thumb in the scrolling direction, thumb
175 // thickness is in the perpendicular direction. Here's an example of a 185 // thickness is in the perpendicular direction. Here's an example of a
176 // horizontal scrollbar - inputs are above the scrollbar, computed values 186 // horizontal scrollbar - inputs are above the scrollbar, computed values
177 // below: 187 // below:
178 // 188 //
179 // |<------------------- track_length_ ------------------->| 189 // |<------------------- track_length_ ------------------->|
180 // 190 //
181 // |--| <-- start_offset 191 // |--| <-- start_offset
182 // 192 //
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 void ScrollbarLayerImpl::DidLoseOutputSurface() { 274 void ScrollbarLayerImpl::DidLoseOutputSurface() {
265 track_resource_id_ = 0; 275 track_resource_id_ = 0;
266 thumb_resource_id_ = 0; 276 thumb_resource_id_ = 0;
267 } 277 }
268 278
269 const char* ScrollbarLayerImpl::LayerTypeAsString() const { 279 const char* ScrollbarLayerImpl::LayerTypeAsString() const {
270 return "cc::ScrollbarLayerImpl"; 280 return "cc::ScrollbarLayerImpl";
271 } 281 }
272 282
273 } // namespace cc 283 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/scrollbar_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698