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.h" | 5 #include "cc/layers/painted_scrollbar_layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 new PaintedScrollbarLayer(settings, scrollbar.Pass(), scroll_layer_id)); | 39 new PaintedScrollbarLayer(settings, scrollbar.Pass(), scroll_layer_id)); |
40 } | 40 } |
41 | 41 |
42 PaintedScrollbarLayer::PaintedScrollbarLayer(const LayerSettings& settings, | 42 PaintedScrollbarLayer::PaintedScrollbarLayer(const LayerSettings& settings, |
43 scoped_ptr<Scrollbar> scrollbar, | 43 scoped_ptr<Scrollbar> scrollbar, |
44 int scroll_layer_id) | 44 int scroll_layer_id) |
45 : Layer(settings), | 45 : Layer(settings), |
46 scrollbar_(scrollbar.Pass()), | 46 scrollbar_(scrollbar.Pass()), |
47 scroll_layer_id_(scroll_layer_id), | 47 scroll_layer_id_(scroll_layer_id), |
48 clip_layer_id_(Layer::INVALID_ID), | 48 clip_layer_id_(Layer::INVALID_ID), |
49 internal_contents_scale_(0.f), | 49 internal_contents_scale_(1.f), |
50 thumb_thickness_(scrollbar_->ThumbThickness()), | 50 thumb_thickness_(scrollbar_->ThumbThickness()), |
51 thumb_length_(scrollbar_->ThumbLength()), | 51 thumb_length_(scrollbar_->ThumbLength()), |
52 is_overlay_(scrollbar_->IsOverlay()), | 52 is_overlay_(scrollbar_->IsOverlay()), |
53 has_thumb_(scrollbar_->HasThumb()) { | 53 has_thumb_(scrollbar_->HasThumb()) { |
54 if (!scrollbar_->IsOverlay()) | 54 if (!scrollbar_->IsOverlay()) |
55 SetShouldScrollOnMainThread(true); | 55 SetShouldScrollOnMainThread(true); |
56 } | 56 } |
57 | 57 |
58 PaintedScrollbarLayer::~PaintedScrollbarLayer() {} | 58 PaintedScrollbarLayer::~PaintedScrollbarLayer() {} |
59 | 59 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 scrollbar_->PaintPart(&skcanvas, part, layer_rect); | 317 scrollbar_->PaintPart(&skcanvas, part, layer_rect); |
318 // Make sure that the pixels are no longer mutable to unavoid unnecessary | 318 // Make sure that the pixels are no longer mutable to unavoid unnecessary |
319 // allocation and copying. | 319 // allocation and copying. |
320 skbitmap.setImmutable(); | 320 skbitmap.setImmutable(); |
321 | 321 |
322 return UIResourceBitmap(skbitmap); | 322 return UIResourceBitmap(skbitmap); |
323 } | 323 } |
324 | 324 |
325 } // namespace cc | 325 } // namespace cc |
OLD | NEW |