| 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" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 void NinePatchLayer::SetNearestNeighbor(bool nearest_neighbor) { | 52 void NinePatchLayer::SetNearestNeighbor(bool nearest_neighbor) { |
| 53 if (nearest_neighbor_ == nearest_neighbor) | 53 if (nearest_neighbor_ == nearest_neighbor) |
| 54 return; | 54 return; |
| 55 | 55 |
| 56 nearest_neighbor_ = nearest_neighbor; | 56 nearest_neighbor_ = nearest_neighbor; |
| 57 SetNeedsCommit(); | 57 SetNeedsCommit(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void NinePatchLayer::SetLayerOcclusion(const gfx::Rect& occlusion) { | |
| 61 if (layer_occlusion_ == occlusion) | |
| 62 return; | |
| 63 | |
| 64 layer_occlusion_ = occlusion; | |
| 65 SetNeedsCommit(); | |
| 66 } | |
| 67 | |
| 68 void NinePatchLayer::PushPropertiesTo(LayerImpl* layer) { | 60 void NinePatchLayer::PushPropertiesTo(LayerImpl* layer) { |
| 69 UIResourceLayer::PushPropertiesTo(layer); | 61 UIResourceLayer::PushPropertiesTo(layer); |
| 70 TRACE_EVENT0("cc", "NinePatchLayer::PushPropertiesTo"); | 62 TRACE_EVENT0("cc", "NinePatchLayer::PushPropertiesTo"); |
| 71 NinePatchLayerImpl* layer_impl = static_cast<NinePatchLayerImpl*>(layer); | 63 NinePatchLayerImpl* layer_impl = static_cast<NinePatchLayerImpl*>(layer); |
| 72 | 64 |
| 73 if (!ui_resource_holder_) { | 65 if (!ui_resource_holder_) { |
| 74 layer_impl->SetUIResourceId(0); | 66 layer_impl->SetUIResourceId(0); |
| 75 } else { | 67 } else { |
| 76 DCHECK(layer_tree_host()); | 68 DCHECK(layer_tree_host()); |
| 77 | 69 |
| 78 layer_impl->SetLayout(image_aperture_, border_, layer_occlusion_, | 70 layer_impl->SetLayout(image_aperture_, border_, fill_center_, |
| 79 fill_center_, nearest_neighbor_); | 71 nearest_neighbor_); |
| 80 } | 72 } |
| 81 } | 73 } |
| 82 | 74 |
| 83 } // namespace cc | 75 } // namespace cc |
| OLD | NEW |