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

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

Issue 1983803003: Revert of cc: nine patch: add occlusion support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/nine_patch_layer.h ('k') | cc/layers/nine_patch_layer_impl.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 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
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
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer.h ('k') | cc/layers/nine_patch_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698