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

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

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 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/picture_image_layer.h » ('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 "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 14 matching lines...) Expand all
25 25
26 namespace cc { 26 namespace cc {
27 27
28 scoped_ptr<LayerImpl> PaintedScrollbarLayer::CreateLayerImpl( 28 scoped_ptr<LayerImpl> PaintedScrollbarLayer::CreateLayerImpl(
29 LayerTreeImpl* tree_impl) { 29 LayerTreeImpl* tree_impl) {
30 return PaintedScrollbarLayerImpl::Create( 30 return PaintedScrollbarLayerImpl::Create(
31 tree_impl, id(), scrollbar_->Orientation()); 31 tree_impl, id(), scrollbar_->Orientation());
32 } 32 }
33 33
34 scoped_refptr<PaintedScrollbarLayer> PaintedScrollbarLayer::Create( 34 scoped_refptr<PaintedScrollbarLayer> PaintedScrollbarLayer::Create(
35 const LayerSettings& settings,
35 scoped_ptr<Scrollbar> scrollbar, 36 scoped_ptr<Scrollbar> scrollbar,
36 int scroll_layer_id) { 37 int scroll_layer_id) {
37 return make_scoped_refptr( 38 return make_scoped_refptr(
38 new PaintedScrollbarLayer(scrollbar.Pass(), scroll_layer_id)); 39 new PaintedScrollbarLayer(settings, scrollbar.Pass(), scroll_layer_id));
39 } 40 }
40 41
41 PaintedScrollbarLayer::PaintedScrollbarLayer(scoped_ptr<Scrollbar> scrollbar, 42 PaintedScrollbarLayer::PaintedScrollbarLayer(const LayerSettings& settings,
43 scoped_ptr<Scrollbar> scrollbar,
42 int scroll_layer_id) 44 int scroll_layer_id)
43 : scrollbar_(scrollbar.Pass()), 45 : Layer(settings),
46 scrollbar_(scrollbar.Pass()),
44 scroll_layer_id_(scroll_layer_id), 47 scroll_layer_id_(scroll_layer_id),
45 clip_layer_id_(Layer::INVALID_ID), 48 clip_layer_id_(Layer::INVALID_ID),
46 internal_contents_scale_(0.f), 49 internal_contents_scale_(0.f),
47 thumb_thickness_(scrollbar_->ThumbThickness()), 50 thumb_thickness_(scrollbar_->ThumbThickness()),
48 thumb_length_(scrollbar_->ThumbLength()), 51 thumb_length_(scrollbar_->ThumbLength()),
49 is_overlay_(scrollbar_->IsOverlay()), 52 is_overlay_(scrollbar_->IsOverlay()),
50 has_thumb_(scrollbar_->HasThumb()) { 53 has_thumb_(scrollbar_->HasThumb()) {
51 if (!scrollbar_->IsOverlay()) 54 if (!scrollbar_->IsOverlay())
52 SetShouldScrollOnMainThread(true); 55 SetShouldScrollOnMainThread(true);
53 } 56 }
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 316
314 scrollbar_->PaintPart(&skcanvas, part, layer_rect); 317 scrollbar_->PaintPart(&skcanvas, part, layer_rect);
315 // 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
316 // allocation and copying. 319 // allocation and copying.
317 skbitmap.setImmutable(); 320 skbitmap.setImmutable();
318 321
319 return UIResourceBitmap(skbitmap); 322 return UIResourceBitmap(skbitmap);
320 } 323 }
321 324
322 } // namespace cc 325 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/painted_scrollbar_layer.h ('k') | cc/layers/picture_image_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698