| 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.h" | 5 #include "cc/layers/nine_patch_layer.h" |
| 6 | 6 |
| 7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
| 8 #include "cc/layers/nine_patch_layer_impl.h" | 8 #include "cc/layers/nine_patch_layer_impl.h" |
| 9 #include "cc/resources/scoped_ui_resource.h" | 9 #include "cc/resources/scoped_ui_resource.h" |
| 10 #include "cc/resources/ui_resource_bitmap.h" | 10 #include "cc/resources/ui_resource_bitmap.h" |
| 11 #include "cc/trees/layer_tree_host.h" | 11 #include "cc/trees/layer_tree_host.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 scoped_refptr<NinePatchLayer> NinePatchLayer::Create( | 15 scoped_refptr<NinePatchLayer> NinePatchLayer::Create() { |
| 16 const LayerSettings& settings) { | 16 return make_scoped_refptr(new NinePatchLayer()); |
| 17 return make_scoped_refptr(new NinePatchLayer(settings)); | |
| 18 } | 17 } |
| 19 | 18 |
| 20 NinePatchLayer::NinePatchLayer(const LayerSettings& settings) | 19 NinePatchLayer::NinePatchLayer() |
| 21 : UIResourceLayer(settings), | 20 : UIResourceLayer(), fill_center_(false), nearest_neighbor_(false) {} |
| 22 fill_center_(false), | |
| 23 nearest_neighbor_(false) {} | |
| 24 | 21 |
| 25 NinePatchLayer::~NinePatchLayer() {} | 22 NinePatchLayer::~NinePatchLayer() {} |
| 26 | 23 |
| 27 scoped_ptr<LayerImpl> NinePatchLayer::CreateLayerImpl( | 24 scoped_ptr<LayerImpl> NinePatchLayer::CreateLayerImpl( |
| 28 LayerTreeImpl* tree_impl) { | 25 LayerTreeImpl* tree_impl) { |
| 29 return NinePatchLayerImpl::Create(tree_impl, id()); | 26 return NinePatchLayerImpl::Create(tree_impl, id()); |
| 30 } | 27 } |
| 31 | 28 |
| 32 void NinePatchLayer::SetBorder(const gfx::Rect& border) { | 29 void NinePatchLayer::SetBorder(const gfx::Rect& border) { |
| 33 if (border == border_) | 30 if (border == border_) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 layer_impl->SetUIResourceId(0); | 66 layer_impl->SetUIResourceId(0); |
| 70 } else { | 67 } else { |
| 71 DCHECK(layer_tree_host()); | 68 DCHECK(layer_tree_host()); |
| 72 | 69 |
| 73 layer_impl->SetLayout(image_aperture_, border_, fill_center_, | 70 layer_impl->SetLayout(image_aperture_, border_, fill_center_, |
| 74 nearest_neighbor_); | 71 nearest_neighbor_); |
| 75 } | 72 } |
| 76 } | 73 } |
| 77 | 74 |
| 78 } // namespace cc | 75 } // namespace cc |
| OLD | NEW |