| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 thumb_.get(), | 427 thumb_.get(), |
| 423 origin_thumb_rect, | 428 origin_thumb_rect, |
| 424 queue, | 429 queue, |
| 425 stats); | 430 stats); |
| 426 } | 431 } |
| 427 | 432 |
| 428 dirty_rect_ = gfx::RectF(); | 433 dirty_rect_ = gfx::RectF(); |
| 429 } | 434 } |
| 430 | 435 |
| 431 } // namespace cc | 436 } // namespace cc |
| OLD | NEW |