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

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

Issue 1783613004: CC Animation: Erase cc::LayerSettings everywhere. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eraseandroid
Patch Set: Rebase. Created 4 years, 9 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
« no previous file with comments | « cc/layers/painted_scrollbar_layer.h ('k') | cc/layers/painted_scrollbar_layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 13 matching lines...) Expand all
24 24
25 namespace cc { 25 namespace cc {
26 26
27 scoped_ptr<LayerImpl> PaintedScrollbarLayer::CreateLayerImpl( 27 scoped_ptr<LayerImpl> PaintedScrollbarLayer::CreateLayerImpl(
28 LayerTreeImpl* tree_impl) { 28 LayerTreeImpl* tree_impl) {
29 return PaintedScrollbarLayerImpl::Create( 29 return PaintedScrollbarLayerImpl::Create(
30 tree_impl, id(), scrollbar_->Orientation()); 30 tree_impl, id(), scrollbar_->Orientation());
31 } 31 }
32 32
33 scoped_refptr<PaintedScrollbarLayer> PaintedScrollbarLayer::Create( 33 scoped_refptr<PaintedScrollbarLayer> PaintedScrollbarLayer::Create(
34 const LayerSettings& settings,
35 scoped_ptr<Scrollbar> scrollbar, 34 scoped_ptr<Scrollbar> scrollbar,
36 int scroll_layer_id) { 35 int scroll_layer_id) {
37 return make_scoped_refptr(new PaintedScrollbarLayer( 36 return make_scoped_refptr(
38 settings, std::move(scrollbar), scroll_layer_id)); 37 new PaintedScrollbarLayer(std::move(scrollbar), scroll_layer_id));
39 } 38 }
40 39
41 PaintedScrollbarLayer::PaintedScrollbarLayer(const LayerSettings& settings, 40 PaintedScrollbarLayer::PaintedScrollbarLayer(scoped_ptr<Scrollbar> scrollbar,
42 scoped_ptr<Scrollbar> scrollbar,
43 int scroll_layer_id) 41 int scroll_layer_id)
44 : Layer(settings), 42 : scrollbar_(std::move(scrollbar)),
45 scrollbar_(std::move(scrollbar)),
46 scroll_layer_id_(scroll_layer_id), 43 scroll_layer_id_(scroll_layer_id),
47 internal_contents_scale_(1.f), 44 internal_contents_scale_(1.f),
48 thumb_thickness_(scrollbar_->ThumbThickness()), 45 thumb_thickness_(scrollbar_->ThumbThickness()),
49 thumb_length_(scrollbar_->ThumbLength()), 46 thumb_length_(scrollbar_->ThumbLength()),
50 is_overlay_(scrollbar_->IsOverlay()), 47 is_overlay_(scrollbar_->IsOverlay()),
51 has_thumb_(scrollbar_->HasThumb()), 48 has_thumb_(scrollbar_->HasThumb()),
52 thumb_opacity_(scrollbar_->ThumbOpacity()) { 49 thumb_opacity_(scrollbar_->ThumbOpacity()) {
53 if (!scrollbar_->IsOverlay()) 50 if (!scrollbar_->IsOverlay())
54 AddMainThreadScrollingReasons( 51 AddMainThreadScrollingReasons(
55 MainThreadScrollingReason::kScrollbarScrolling); 52 MainThreadScrollingReason::kScrollbarScrolling);
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 300
304 scrollbar_->PaintPart(&skcanvas, part, layer_rect); 301 scrollbar_->PaintPart(&skcanvas, part, layer_rect);
305 // Make sure that the pixels are no longer mutable to unavoid unnecessary 302 // Make sure that the pixels are no longer mutable to unavoid unnecessary
306 // allocation and copying. 303 // allocation and copying.
307 skbitmap.setImmutable(); 304 skbitmap.setImmutable();
308 305
309 return UIResourceBitmap(skbitmap); 306 return UIResourceBitmap(skbitmap);
310 } 307 }
311 308
312 } // namespace cc 309 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/painted_scrollbar_layer.h ('k') | cc/layers/painted_scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698