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

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

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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_unittest.cc » ('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 "cc/layers/nine_patch_layer_impl.h" 7 #include "cc/layers/nine_patch_layer_impl.h"
8 #include "cc/resources/prioritized_resource.h" 8 #include "cc/resources/prioritized_resource.h"
9 #include "cc/resources/resource_update.h" 9 #include "cc/resources/resource_update.h"
10 #include "cc/resources/resource_update_queue.h" 10 #include "cc/resources/resource_update_queue.h"
11 #include "cc/resources/scoped_ui_resource.h" 11 #include "cc/resources/scoped_ui_resource.h"
12 #include "cc/resources/ui_resource_bitmap.h" 12 #include "cc/resources/ui_resource_bitmap.h"
13 #include "cc/trees/layer_tree_host.h" 13 #include "cc/trees/layer_tree_host.h"
14 14
15 namespace cc { 15 namespace cc {
16 16
17 scoped_refptr<NinePatchLayer> NinePatchLayer::Create() { 17 scoped_refptr<NinePatchLayer> NinePatchLayer::Create(
18 return make_scoped_refptr(new NinePatchLayer()); 18 const LayerSettings& settings) {
19 return make_scoped_refptr(new NinePatchLayer(settings));
19 } 20 }
20 21
21 NinePatchLayer::NinePatchLayer() : fill_center_(false) {} 22 NinePatchLayer::NinePatchLayer(const LayerSettings& settings)
23 : UIResourceLayer(settings), fill_center_(false) {
24 }
22 25
23 NinePatchLayer::~NinePatchLayer() {} 26 NinePatchLayer::~NinePatchLayer() {}
24 27
25 scoped_ptr<LayerImpl> NinePatchLayer::CreateLayerImpl( 28 scoped_ptr<LayerImpl> NinePatchLayer::CreateLayerImpl(
26 LayerTreeImpl* tree_impl) { 29 LayerTreeImpl* tree_impl) {
27 return NinePatchLayerImpl::Create(tree_impl, id()); 30 return NinePatchLayerImpl::Create(tree_impl, id());
28 } 31 }
29 32
30 void NinePatchLayer::SetBorder(const gfx::Rect& border) { 33 void NinePatchLayer::SetBorder(const gfx::Rect& border) {
31 if (border == border_) 34 if (border == border_)
(...skipping 25 matching lines...) Expand all
57 if (!ui_resource_holder_) { 60 if (!ui_resource_holder_) {
58 layer_impl->SetUIResourceId(0); 61 layer_impl->SetUIResourceId(0);
59 } else { 62 } else {
60 DCHECK(layer_tree_host()); 63 DCHECK(layer_tree_host());
61 64
62 layer_impl->SetLayout(image_aperture_, border_, fill_center_); 65 layer_impl->SetLayout(image_aperture_, border_, fill_center_);
63 } 66 }
64 } 67 }
65 68
66 } // namespace cc 69 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer.h ('k') | cc/layers/nine_patch_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698