OLD | NEW |
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/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/trace_event/trace_event_argument.h" | 9 #include "base/trace_event/trace_event_argument.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 float* width) const { | 106 float* width) const { |
107 *color = DebugColors::TiledContentLayerBorderColor(); | 107 *color = DebugColors::TiledContentLayerBorderColor(); |
108 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); | 108 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); |
109 } | 109 } |
110 | 110 |
111 scoped_ptr<LayerImpl> TiledLayerImpl::CreateLayerImpl( | 111 scoped_ptr<LayerImpl> TiledLayerImpl::CreateLayerImpl( |
112 LayerTreeImpl* tree_impl) { | 112 LayerTreeImpl* tree_impl) { |
113 return TiledLayerImpl::Create(tree_impl, id(), synced_scroll_offset()); | 113 return TiledLayerImpl::Create(tree_impl, id(), synced_scroll_offset()); |
114 } | 114 } |
115 | 115 |
116 void TiledLayerImpl::AsValueInto(base::debug::TracedValue* state) const { | 116 void TiledLayerImpl::AsValueInto(base::trace_event::TracedValue* state) const { |
117 LayerImpl::AsValueInto(state); | 117 LayerImpl::AsValueInto(state); |
118 MathUtil::AddToTracedValue("invalidation", update_rect(), state); | 118 MathUtil::AddToTracedValue("invalidation", update_rect(), state); |
119 } | 119 } |
120 | 120 |
121 size_t TiledLayerImpl::GPUMemoryUsageInBytes() const { | 121 size_t TiledLayerImpl::GPUMemoryUsageInBytes() const { |
122 size_t amount = 0; | 122 size_t amount = 0; |
123 const size_t kMemoryUsagePerTileInBytes = | 123 const size_t kMemoryUsagePerTileInBytes = |
124 4 * tiler_->tile_size().width() * tiler_->tile_size().height(); | 124 4 * tiler_->tile_size().width() * tiler_->tile_size().height(); |
125 for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin(); | 125 for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin(); |
126 iter != tiler_->tiles().end(); | 126 iter != tiler_->tiles().end(); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 void TiledLayerImpl::ReleaseResources() { | 315 void TiledLayerImpl::ReleaseResources() { |
316 tiler_->reset(); | 316 tiler_->reset(); |
317 } | 317 } |
318 | 318 |
319 const char* TiledLayerImpl::LayerTypeAsString() const { | 319 const char* TiledLayerImpl::LayerTypeAsString() const { |
320 return "cc::TiledLayerImpl"; | 320 return "cc::TiledLayerImpl"; |
321 } | 321 } |
322 | 322 |
323 } // namespace cc | 323 } // namespace cc |
OLD | NEW |