| 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/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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); | 100 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); |
| 101 } | 101 } |
| 102 | 102 |
| 103 scoped_ptr<LayerImpl> TiledLayerImpl::CreateLayerImpl( | 103 scoped_ptr<LayerImpl> TiledLayerImpl::CreateLayerImpl( |
| 104 LayerTreeImpl* tree_impl) { | 104 LayerTreeImpl* tree_impl) { |
| 105 return TiledLayerImpl::Create(tree_impl, id()); | 105 return TiledLayerImpl::Create(tree_impl, id()); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void TiledLayerImpl::AsValueInto(base::debug::TracedValue* state) const { | 108 void TiledLayerImpl::AsValueInto(base::debug::TracedValue* state) const { |
| 109 LayerImpl::AsValueInto(state); | 109 LayerImpl::AsValueInto(state); |
| 110 state->BeginArray("invalidation"); | 110 MathUtil::AddToTracedValue("invalidation", update_rect(), state); |
| 111 MathUtil::AddToTracedValue(update_rect(), state); | |
| 112 state->EndArray(); | |
| 113 } | 111 } |
| 114 | 112 |
| 115 size_t TiledLayerImpl::GPUMemoryUsageInBytes() const { | 113 size_t TiledLayerImpl::GPUMemoryUsageInBytes() const { |
| 116 size_t amount = 0; | 114 size_t amount = 0; |
| 117 const size_t kMemoryUsagePerTileInBytes = | 115 const size_t kMemoryUsagePerTileInBytes = |
| 118 4 * tiler_->tile_size().width() * tiler_->tile_size().height(); | 116 4 * tiler_->tile_size().width() * tiler_->tile_size().height(); |
| 119 for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin(); | 117 for (LayerTilingData::TileMap::const_iterator iter = tiler_->tiles().begin(); |
| 120 iter != tiler_->tiles().end(); | 118 iter != tiler_->tiles().end(); |
| 121 ++iter) { | 119 ++iter) { |
| 122 const DrawableTile* tile = static_cast<DrawableTile*>(iter->second); | 120 const DrawableTile* tile = static_cast<DrawableTile*>(iter->second); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 306 |
| 309 void TiledLayerImpl::ReleaseResources() { | 307 void TiledLayerImpl::ReleaseResources() { |
| 310 tiler_->reset(); | 308 tiler_->reset(); |
| 311 } | 309 } |
| 312 | 310 |
| 313 const char* TiledLayerImpl::LayerTypeAsString() const { | 311 const char* TiledLayerImpl::LayerTypeAsString() const { |
| 314 return "cc::TiledLayerImpl"; | 312 return "cc::TiledLayerImpl"; |
| 315 } | 313 } |
| 316 | 314 |
| 317 } // namespace cc | 315 } // namespace cc |
| OLD | NEW |