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/layers/nine_patch_layer_impl.h" | 5 #include "cc/layers/nine_patch_layer_impl.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
10 #include "cc/quads/texture_draw_quad.h" | 10 #include "cc/quads/texture_draw_quad.h" |
11 #include "cc/trees/layer_tree_impl.h" | 11 #include "cc/trees/layer_tree_impl.h" |
12 #include "cc/trees/occlusion.h" | 12 #include "cc/trees/occlusion.h" |
13 #include "ui/gfx/geometry/rect_f.h" | 13 #include "ui/gfx/geometry/rect_f.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 NinePatchLayerImpl::NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id) | 17 NinePatchLayerImpl::NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id) |
18 : UIResourceLayerImpl(tree_impl, id), | 18 : UIResourceLayerImpl(tree_impl, id), |
19 fill_center_(false), | 19 fill_center_(false), |
20 nearest_neighbor_(false) {} | 20 nearest_neighbor_(false) {} |
21 | 21 |
22 NinePatchLayerImpl::~NinePatchLayerImpl() {} | 22 NinePatchLayerImpl::~NinePatchLayerImpl() {} |
23 | 23 |
24 scoped_ptr<LayerImpl> NinePatchLayerImpl::CreateLayerImpl( | 24 std::unique_ptr<LayerImpl> NinePatchLayerImpl::CreateLayerImpl( |
25 LayerTreeImpl* tree_impl) { | 25 LayerTreeImpl* tree_impl) { |
26 return NinePatchLayerImpl::Create(tree_impl, id()); | 26 return NinePatchLayerImpl::Create(tree_impl, id()); |
27 } | 27 } |
28 | 28 |
29 void NinePatchLayerImpl::PushPropertiesTo(LayerImpl* layer) { | 29 void NinePatchLayerImpl::PushPropertiesTo(LayerImpl* layer) { |
30 UIResourceLayerImpl::PushPropertiesTo(layer); | 30 UIResourceLayerImpl::PushPropertiesTo(layer); |
31 NinePatchLayerImpl* layer_impl = static_cast<NinePatchLayerImpl*>(layer); | 31 NinePatchLayerImpl* layer_impl = static_cast<NinePatchLayerImpl*>(layer); |
32 | 32 |
33 layer_impl->SetLayout(image_aperture_, border_, fill_center_, | 33 layer_impl->SetLayout(image_aperture_, border_, fill_center_, |
34 nearest_neighbor_); | 34 nearest_neighbor_); |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 result->Set("ImageBounds", list); | 366 result->Set("ImageBounds", list); |
367 | 367 |
368 result->Set("Border", MathUtil::AsValue(border_).release()); | 368 result->Set("Border", MathUtil::AsValue(border_).release()); |
369 | 369 |
370 result->SetBoolean("FillCenter", fill_center_); | 370 result->SetBoolean("FillCenter", fill_center_); |
371 | 371 |
372 return result; | 372 return result; |
373 } | 373 } |
374 | 374 |
375 } // namespace cc | 375 } // namespace cc |
OLD | NEW |