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

Side by Side Diff: cc/layers/tiled_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/tiled_layer.cc ('k') | cc/layers/tiled_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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/tiled_layer_impl.h" 5 #include "cc/layers/tiled_layer_impl.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/debug/trace_event_argument.h" 8 #include "base/debug/trace_event_argument.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return HasTileAt(i, j) && TileAt(i, j)->resource_id(); 78 return HasTileAt(i, j) && TileAt(i, j)->resource_id();
79 } 79 }
80 80
81 DrawableTile* TiledLayerImpl::TileAt(int i, int j) const { 81 DrawableTile* TiledLayerImpl::TileAt(int i, int j) const {
82 return static_cast<DrawableTile*>(tiler_->TileAt(i, j)); 82 return static_cast<DrawableTile*>(tiler_->TileAt(i, j));
83 } 83 }
84 84
85 DrawableTile* TiledLayerImpl::CreateTile(int i, int j) { 85 DrawableTile* TiledLayerImpl::CreateTile(int i, int j) {
86 scoped_ptr<DrawableTile> tile(DrawableTile::Create()); 86 scoped_ptr<DrawableTile> tile(DrawableTile::Create());
87 DrawableTile* added_tile = tile.get(); 87 DrawableTile* added_tile = tile.get();
88 tiler_->AddTile(tile.PassAs<LayerTilingData::Tile>(), i, j); 88 tiler_->AddTile(tile.Pass(), i, j);
89 89
90 return added_tile; 90 return added_tile;
91 } 91 }
92 92
93 void TiledLayerImpl::GetDebugBorderProperties(SkColor* color, 93 void TiledLayerImpl::GetDebugBorderProperties(SkColor* color,
94 float* width) const { 94 float* width) const {
95 *color = DebugColors::TiledContentLayerBorderColor(); 95 *color = DebugColors::TiledContentLayerBorderColor();
96 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); 96 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl());
97 } 97 }
98 98
99 scoped_ptr<LayerImpl> TiledLayerImpl::CreateLayerImpl( 99 scoped_ptr<LayerImpl> TiledLayerImpl::CreateLayerImpl(
100 LayerTreeImpl* tree_impl) { 100 LayerTreeImpl* tree_impl) {
101 return TiledLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); 101 return TiledLayerImpl::Create(tree_impl, id());
102 } 102 }
103 103
104 void TiledLayerImpl::AsValueInto(base::debug::TracedValue* state) const { 104 void TiledLayerImpl::AsValueInto(base::debug::TracedValue* state) const {
105 LayerImpl::AsValueInto(state); 105 LayerImpl::AsValueInto(state);
106 state->BeginArray("invalidation"); 106 state->BeginArray("invalidation");
107 MathUtil::AddToTracedValue(update_rect(), state); 107 MathUtil::AddToTracedValue(update_rect(), state);
108 state->EndArray(); 108 state->EndArray();
109 } 109 }
110 110
111 size_t TiledLayerImpl::GPUMemoryUsageInBytes() const { 111 size_t TiledLayerImpl::GPUMemoryUsageInBytes() const {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
307 void TiledLayerImpl::ReleaseResources() { 307 void TiledLayerImpl::ReleaseResources() {
308 tiler_->reset(); 308 tiler_->reset();
309 } 309 }
310 310
311 const char* TiledLayerImpl::LayerTypeAsString() const { 311 const char* TiledLayerImpl::LayerTypeAsString() const {
312 return "cc::TiledLayerImpl"; 312 return "cc::TiledLayerImpl";
313 } 313 }
314 314
315 } // namespace cc 315 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/tiled_layer.cc ('k') | cc/layers/tiled_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698