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

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
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 : Layer(),
45 scrollbar_(std::move(scrollbar)), 43 scrollbar_(std::move(scrollbar)),
46 scroll_layer_id_(scroll_layer_id), 44 scroll_layer_id_(scroll_layer_id),
47 internal_contents_scale_(1.f), 45 internal_contents_scale_(1.f),
48 thumb_thickness_(scrollbar_->ThumbThickness()), 46 thumb_thickness_(scrollbar_->ThumbThickness()),
49 thumb_length_(scrollbar_->ThumbLength()), 47 thumb_length_(scrollbar_->ThumbLength()),
50 is_overlay_(scrollbar_->IsOverlay()), 48 is_overlay_(scrollbar_->IsOverlay()),
51 has_thumb_(scrollbar_->HasThumb()), 49 has_thumb_(scrollbar_->HasThumb()),
52 thumb_opacity_(scrollbar_->ThumbOpacity()) { 50 thumb_opacity_(scrollbar_->ThumbOpacity()) {
53 if (!scrollbar_->IsOverlay()) 51 if (!scrollbar_->IsOverlay())
54 AddMainThreadScrollingReasons( 52 AddMainThreadScrollingReasons(
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 301
304 scrollbar_->PaintPart(&skcanvas, part, layer_rect); 302 scrollbar_->PaintPart(&skcanvas, part, layer_rect);
305 // Make sure that the pixels are no longer mutable to unavoid unnecessary 303 // Make sure that the pixels are no longer mutable to unavoid unnecessary
306 // allocation and copying. 304 // allocation and copying.
307 skbitmap.setImmutable(); 305 skbitmap.setImmutable();
308 306
309 return UIResourceBitmap(skbitmap); 307 return UIResourceBitmap(skbitmap);
310 } 308 }
311 309
312 } // namespace cc 310 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698