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

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

Issue 18202006: Make scrollable viewport size no longer depend on clip layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Apply to MaxScrollOffset Created 7 years, 5 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 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 "cc/animation/scrollbar_animation_controller.h" 7 #include "cc/animation/scrollbar_animation_controller.h"
8 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
9 #include "cc/layers/quad_sink.h" 9 #include "cc/layers/quad_sink.h"
10 #include "cc/quads/solid_color_draw_quad.h" 10 #include "cc/quads/solid_color_draw_quad.h"
(...skipping 23 matching lines...) Expand all
34 current_pos_(0.f), 34 current_pos_(0.f),
35 maximum_(0), 35 maximum_(0),
36 thumb_thickness_(0), 36 thumb_thickness_(0),
37 thumb_length_(0), 37 thumb_length_(0),
38 track_start_(0), 38 track_start_(0),
39 track_length_(0), 39 track_length_(0),
40 orientation_(orientation), 40 orientation_(orientation),
41 vertical_adjust_(0.f), 41 vertical_adjust_(0.f),
42 visible_to_total_length_ratio_(1.f), 42 visible_to_total_length_ratio_(1.f),
43 scroll_layer_id_(Layer::INVALID_ID), 43 scroll_layer_id_(Layer::INVALID_ID),
44 is_scrollable_area_active_(false),
45 is_scroll_view_scrollbar_(false),
46 enabled_(false),
47 is_custom_scrollbar_(false),
48 is_overlay_scrollbar_(false) {} 44 is_overlay_scrollbar_(false) {}
49 45
50 ScrollbarLayerImpl::~ScrollbarLayerImpl() {} 46 ScrollbarLayerImpl::~ScrollbarLayerImpl() {}
51 47
52 ScrollbarLayerImpl* ScrollbarLayerImpl::ToScrollbarLayer() { 48 ScrollbarLayerImpl* ScrollbarLayerImpl::ToScrollbarLayer() {
53 return this; 49 return this;
54 } 50 }
55 51
56 scoped_ptr<LayerImpl> ScrollbarLayerImpl::CreateLayerImpl( 52 scoped_ptr<LayerImpl> ScrollbarLayerImpl::CreateLayerImpl(
57 LayerTreeImpl* tree_impl) { 53 LayerTreeImpl* tree_impl) {
58 return ScrollbarLayerImpl::Create(tree_impl, 54 return ScrollbarLayerImpl::Create(tree_impl,
59 id(), 55 id(),
60 orientation_).PassAs<LayerImpl>(); 56 orientation_).PassAs<LayerImpl>();
61 } 57 }
62 58
63 void ScrollbarLayerImpl::PushPropertiesTo(LayerImpl* layer) { 59 void ScrollbarLayerImpl::PushPropertiesTo(LayerImpl* layer) {
64 LayerImpl::PushPropertiesTo(layer); 60 LayerImpl::PushPropertiesTo(layer);
65 61
66 ScrollbarLayerImpl* scrollbar_layer = static_cast<ScrollbarLayerImpl*>(layer); 62 ScrollbarLayerImpl* scrollbar_layer = static_cast<ScrollbarLayerImpl*>(layer);
67 63
68 scrollbar_layer->set_thumb_thickness(thumb_thickness_); 64 scrollbar_layer->set_thumb_thickness(thumb_thickness_);
69 scrollbar_layer->set_thumb_length(thumb_length_); 65 scrollbar_layer->set_thumb_length(thumb_length_);
70 scrollbar_layer->set_track_start(track_start_); 66 scrollbar_layer->set_track_start(track_start_);
71 scrollbar_layer->set_track_length(track_length_); 67 scrollbar_layer->set_track_length(track_length_);
68 scrollbar_layer->set_is_overlay_scrollbar(is_overlay_scrollbar_);
72 69
73 scrollbar_layer->set_track_resource_id(track_resource_id_); 70 scrollbar_layer->set_track_resource_id(track_resource_id_);
74 scrollbar_layer->set_thumb_resource_id(thumb_resource_id_); 71 scrollbar_layer->set_thumb_resource_id(thumb_resource_id_);
75 } 72 }
76 73
77 bool ScrollbarLayerImpl::WillDraw(DrawMode draw_mode, 74 bool ScrollbarLayerImpl::WillDraw(DrawMode draw_mode,
78 ResourceProvider* resource_provider) { 75 ResourceProvider* resource_provider) {
79 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE && 76 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE &&
80 !layer_tree_impl()->settings().solid_color_scrollbars) 77 !layer_tree_impl()->settings().solid_color_scrollbars)
81 return false; 78 return false;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 void ScrollbarLayerImpl::DidLoseOutputSurface() { 258 void ScrollbarLayerImpl::DidLoseOutputSurface() {
262 track_resource_id_ = 0; 259 track_resource_id_ = 0;
263 thumb_resource_id_ = 0; 260 thumb_resource_id_ = 0;
264 } 261 }
265 262
266 const char* ScrollbarLayerImpl::LayerTypeAsString() const { 263 const char* ScrollbarLayerImpl::LayerTypeAsString() const {
267 return "cc::ScrollbarLayerImpl"; 264 return "cc::ScrollbarLayerImpl";
268 } 265 }
269 266
270 } // namespace cc 267 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698