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/solid_color_layer.h" | 5 #include "cc/solid_color_layer.h" |
6 | 6 |
7 #include "cc/solid_color_layer_impl.h" | 7 #include "cc/solid_color_layer_impl.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
11 scoped_ptr<LayerImpl> SolidColorLayer::createLayerImpl(LayerTreeHostImpl* hostIm
pl) | 11 scoped_ptr<LayerImpl> SolidColorLayer::createLayerImpl(LayerTreeImpl* treeImpl) |
12 { | 12 { |
13 return SolidColorLayerImpl::create(hostImpl, id()).PassAs<LayerImpl>(); | 13 return SolidColorLayerImpl::create(treeImpl, id()).PassAs<LayerImpl>(); |
14 } | 14 } |
15 | 15 |
16 scoped_refptr<SolidColorLayer> SolidColorLayer::create() | 16 scoped_refptr<SolidColorLayer> SolidColorLayer::create() |
17 { | 17 { |
18 return make_scoped_refptr(new SolidColorLayer()); | 18 return make_scoped_refptr(new SolidColorLayer()); |
19 } | 19 } |
20 | 20 |
21 SolidColorLayer::SolidColorLayer() | 21 SolidColorLayer::SolidColorLayer() |
22 : Layer() | 22 : Layer() |
23 { | 23 { |
24 } | 24 } |
25 | 25 |
26 SolidColorLayer::~SolidColorLayer() | 26 SolidColorLayer::~SolidColorLayer() |
27 { | 27 { |
28 } | 28 } |
29 | 29 |
30 void SolidColorLayer::setBackgroundColor(SkColor color) | 30 void SolidColorLayer::setBackgroundColor(SkColor color) |
31 { | 31 { |
32 setContentsOpaque(SkColorGetA(color) == 255); | 32 setContentsOpaque(SkColorGetA(color) == 255); |
33 Layer::setBackgroundColor(color); | 33 Layer::setBackgroundColor(color); |
34 } | 34 } |
35 | 35 |
36 } // namespace cc | 36 } // namespace cc |
OLD | NEW |