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_impl.h" | 5 #include "cc/layers/painted_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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; | 124 const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
125 TextureDrawQuad* quad = | 125 TextureDrawQuad* quad = |
126 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 126 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
127 quad->SetNew(shared_quad_state, scaled_track_quad_rect, opaque_rect, | 127 quad->SetNew(shared_quad_state, scaled_track_quad_rect, opaque_rect, |
128 scaled_visible_track_quad_rect, track_resource_id, | 128 scaled_visible_track_quad_rect, track_resource_id, |
129 premultipled_alpha, uv_top_left, uv_bottom_right, | 129 premultipled_alpha, uv_top_left, uv_bottom_right, |
130 SK_ColorTRANSPARENT, opacity, flipped, nearest_neighbor); | 130 SK_ColorTRANSPARENT, opacity, flipped, nearest_neighbor); |
131 } | 131 } |
132 } | 132 } |
133 | 133 |
| 134 gfx::Rect PaintedScrollbarLayerImpl::GetEnclosingRectInTargetSpace() const { |
| 135 return GetScaledEnclosingRectInTargetSpace(internal_contents_scale_); |
| 136 } |
| 137 |
134 void PaintedScrollbarLayerImpl::SetThumbThickness(int thumb_thickness) { | 138 void PaintedScrollbarLayerImpl::SetThumbThickness(int thumb_thickness) { |
135 if (thumb_thickness_ == thumb_thickness) | 139 if (thumb_thickness_ == thumb_thickness) |
136 return; | 140 return; |
137 thumb_thickness_ = thumb_thickness; | 141 thumb_thickness_ = thumb_thickness; |
138 NoteLayerPropertyChanged(); | 142 NoteLayerPropertyChanged(); |
139 } | 143 } |
140 | 144 |
141 int PaintedScrollbarLayerImpl::ThumbThickness() const { | 145 int PaintedScrollbarLayerImpl::ThumbThickness() const { |
142 return thumb_thickness_; | 146 return thumb_thickness_; |
143 } | 147 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 181 |
178 bool PaintedScrollbarLayerImpl::IsThumbResizable() const { | 182 bool PaintedScrollbarLayerImpl::IsThumbResizable() const { |
179 return false; | 183 return false; |
180 } | 184 } |
181 | 185 |
182 const char* PaintedScrollbarLayerImpl::LayerTypeAsString() const { | 186 const char* PaintedScrollbarLayerImpl::LayerTypeAsString() const { |
183 return "cc::PaintedScrollbarLayerImpl"; | 187 return "cc::PaintedScrollbarLayerImpl"; |
184 } | 188 } |
185 | 189 |
186 } // namespace cc | 190 } // namespace cc |
OLD | NEW |