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

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

Issue 609663003: cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc-passas: PassAs-presubmit-warning Created 6 years, 2 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.cc ('k') | cc/layers/painted_scrollbar_layer.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_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_tracker.h" 12 #include "cc/trees/occlusion_tracker.h"
13 #include "ui/gfx/rect_f.h" 13 #include "ui/gfx/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 20
21 NinePatchLayerImpl::~NinePatchLayerImpl() {} 21 NinePatchLayerImpl::~NinePatchLayerImpl() {}
22 22
23 scoped_ptr<LayerImpl> NinePatchLayerImpl::CreateLayerImpl( 23 scoped_ptr<LayerImpl> NinePatchLayerImpl::CreateLayerImpl(
24 LayerTreeImpl* tree_impl) { 24 LayerTreeImpl* tree_impl) {
25 return NinePatchLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); 25 return NinePatchLayerImpl::Create(tree_impl, id());
26 } 26 }
27 27
28 void NinePatchLayerImpl::PushPropertiesTo(LayerImpl* layer) { 28 void NinePatchLayerImpl::PushPropertiesTo(LayerImpl* layer) {
29 UIResourceLayerImpl::PushPropertiesTo(layer); 29 UIResourceLayerImpl::PushPropertiesTo(layer);
30 NinePatchLayerImpl* layer_impl = static_cast<NinePatchLayerImpl*>(layer); 30 NinePatchLayerImpl* layer_impl = static_cast<NinePatchLayerImpl*>(layer);
31 31
32 layer_impl->SetLayout(image_aperture_, border_, fill_center_); 32 layer_impl->SetLayout(image_aperture_, border_, fill_center_);
33 } 33 }
34 34
35 static gfx::RectF NormalizedRect(float x, 35 static gfx::RectF NormalizedRect(float x,
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 result->Set("ImageBounds", list); 392 result->Set("ImageBounds", list);
393 393
394 result->Set("Border", MathUtil::AsValue(border_).release()); 394 result->Set("Border", MathUtil::AsValue(border_).release());
395 395
396 result->SetBoolean("FillCenter", fill_center_); 396 result->SetBoolean("FillCenter", fill_center_);
397 397
398 return result; 398 return result;
399 } 399 }
400 400
401 } // namespace cc 401 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer.cc ('k') | cc/layers/painted_scrollbar_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698