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

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

Issue 106733005: Update overlay scrollbars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsThumbResizable() method to allow PaintedScrollbarLayerImpl to avoid paint damage when ratio c… Created 6 years, 11 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
OLDNEW
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/scrollbar_layer_impl_base.h" 5 #include "cc/layers/scrollbar_layer_impl_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
9 #include "ui/gfx/rect_conversions.h" 9 #include "ui/gfx/rect_conversions.h"
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 void ScrollbarLayerImplBase::SetVerticalAdjust(float vertical_adjust) { 61 void ScrollbarLayerImplBase::SetVerticalAdjust(float vertical_adjust) {
62 if (vertical_adjust_ == vertical_adjust) 62 if (vertical_adjust_ == vertical_adjust)
63 return; 63 return;
64 vertical_adjust_ = vertical_adjust; 64 vertical_adjust_ = vertical_adjust;
65 NoteLayerPropertyChanged(); 65 NoteLayerPropertyChanged();
66 } 66 }
67 67
68 void ScrollbarLayerImplBase::SetVisibleToTotalLengthRatio(float ratio) { 68 void ScrollbarLayerImplBase::SetVisibleToTotalLengthRatio(float ratio) {
69 if (!IsThumbResizable())
70 return;
71
69 if (visible_to_total_length_ratio_ == ratio) 72 if (visible_to_total_length_ratio_ == ratio)
70 return; 73 return;
71 visible_to_total_length_ratio_ = ratio; 74 visible_to_total_length_ratio_ = ratio;
72 NoteLayerPropertyChanged(); 75 NoteLayerPropertyChanged();
73 } 76 }
74 77
75 void ScrollbarLayerImplBase::SetThumbThicknessScaleFactor(float factor) { 78 void ScrollbarLayerImplBase::SetThumbThicknessScaleFactor(float factor) {
76 if (thumb_thickness_scale_factor_ == factor) 79 if (thumb_thickness_scale_factor_ == factor)
77 return; 80 return;
78 thumb_thickness_scale_factor_ = factor; 81 thumb_thickness_scale_factor_ = factor;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 : thumb_thickness_adjustment, 171 : thumb_thickness_adjustment,
169 thumb_offset, 172 thumb_offset,
170 thumb_thickness - thumb_thickness_adjustment, 173 thumb_thickness - thumb_thickness_adjustment,
171 thumb_length); 174 thumb_length);
172 } 175 }
173 176
174 return ScrollbarLayerRectToContentRect(thumb_rect); 177 return ScrollbarLayerRectToContentRect(thumb_rect);
175 } 178 }
176 179
177 } // namespace cc 180 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698