OLD | NEW |
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/scrollbar_layer.h" | 5 #include "cc/scrollbar_layer.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/caching_bitmap_content_layer_updater.h" | 9 #include "cc/caching_bitmap_content_layer_updater.h" |
10 #include "cc/layer_painter.h" | 10 #include "cc/layer_painter.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 scrollbar_layer->set_fore_track_resource_id( | 122 scrollbar_layer->set_fore_track_resource_id( |
123 fore_track_->texture()->resourceId()); | 123 fore_track_->texture()->resourceId()); |
124 } else { | 124 } else { |
125 scrollbar_layer->set_fore_track_resource_id(0); | 125 scrollbar_layer->set_fore_track_resource_id(0); |
126 } | 126 } |
127 | 127 |
128 if (thumb_ && thumb_->texture()->haveBackingTexture()) | 128 if (thumb_ && thumb_->texture()->haveBackingTexture()) |
129 scrollbar_layer->set_thumb_resource_id(thumb_->texture()->resourceId()); | 129 scrollbar_layer->set_thumb_resource_id(thumb_->texture()->resourceId()); |
130 else | 130 else |
131 scrollbar_layer->set_thumb_resource_id(0); | 131 scrollbar_layer->set_thumb_resource_id(0); |
| 132 |
| 133 // Pinch zoom scrollbarLayerImpl does not get its scroll_layer_id_ |
| 134 // set in LayerImpl, so we need to push it here. |
| 135 if (scroll_layer_id_ == Layer::PINCH_ZOOM_ROOT_SCROLL_LAYER_ID) |
| 136 scrollbar_layer->set_scroll_layer_id(scroll_layer_id_); |
132 } | 137 } |
133 | 138 |
134 ScrollbarLayer* ScrollbarLayer::ToScrollbarLayer() { | 139 ScrollbarLayer* ScrollbarLayer::ToScrollbarLayer() { |
135 return this; | 140 return this; |
136 } | 141 } |
137 | 142 |
138 class ScrollbarBackgroundPainter : public LayerPainter { | 143 class ScrollbarBackgroundPainter : public LayerPainter { |
139 public: | 144 public: |
140 static scoped_ptr<ScrollbarBackgroundPainter> Create( | 145 static scoped_ptr<ScrollbarBackgroundPainter> Create( |
141 WebKit::WebScrollbar* scrollbar, | 146 WebKit::WebScrollbar* scrollbar, |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 thumb_.get(), | 428 thumb_.get(), |
424 origin_thumb_rect, | 429 origin_thumb_rect, |
425 queue, | 430 queue, |
426 stats); | 431 stats); |
427 } | 432 } |
428 | 433 |
429 dirty_rect_ = gfx::RectF(); | 434 dirty_rect_ = gfx::RectF(); |
430 } | 435 } |
431 | 436 |
432 } // namespace cc | 437 } // namespace cc |
OLD | NEW |