| OLD | NEW |
| 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/tiles/tile.h" | 5 #include "cc/tiles/tile.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 required_for_draw_(false), | 36 required_for_draw_(false), |
| 37 is_solid_color_analysis_performed_(false), | 37 is_solid_color_analysis_performed_(false), |
| 38 id_(tile_manager->GetUniqueTileId()), | 38 id_(tile_manager->GetUniqueTileId()), |
| 39 invalidated_id_(0), | 39 invalidated_id_(0), |
| 40 scheduled_priority_(0) {} | 40 scheduled_priority_(0) {} |
| 41 | 41 |
| 42 Tile::~Tile() { | 42 Tile::~Tile() { |
| 43 TRACE_EVENT_OBJECT_DELETED_WITH_ID( | 43 TRACE_EVENT_OBJECT_DELETED_WITH_ID( |
| 44 TRACE_DISABLED_BY_DEFAULT("cc.debug"), | 44 TRACE_DISABLED_BY_DEFAULT("cc.debug"), |
| 45 "cc::Tile", this); | 45 "cc::Tile", this); |
| 46 tile_manager_->Release(this); |
| 46 } | 47 } |
| 47 | 48 |
| 48 void Tile::AsValueInto(base::trace_event::TracedValue* value) const { | 49 void Tile::AsValueInto(base::trace_event::TracedValue* value) const { |
| 49 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( | 50 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
| 50 TRACE_DISABLED_BY_DEFAULT("cc.debug"), value, "cc::Tile", this); | 51 TRACE_DISABLED_BY_DEFAULT("cc.debug"), value, "cc::Tile", this); |
| 51 // TODO(vmpstr): Update tracing to use x/y scales. | 52 // TODO(vmpstr): Update tracing to use x/y scales. |
| 52 value->SetDouble("contents_scale", contents_scale_key()); | 53 value->SetDouble("contents_scale", contents_scale_key()); |
| 53 | 54 |
| 54 value->BeginArray("raster_scales"); | 55 value->BeginArray("raster_scales"); |
| 55 value->AppendDouble(raster_scales_.width()); | 56 value->AppendDouble(raster_scales_.width()); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 76 size_t Tile::GPUMemoryUsageInBytes() const { | 77 size_t Tile::GPUMemoryUsageInBytes() const { |
| 77 if (draw_info_.resource_) { | 78 if (draw_info_.resource_) { |
| 78 // We can use UncheckedSizeInBytes, since the tile size is determined by the | 79 // We can use UncheckedSizeInBytes, since the tile size is determined by the |
| 79 // compositor. | 80 // compositor. |
| 80 return ResourceUtil::UncheckedSizeInBytes<size_t>( | 81 return ResourceUtil::UncheckedSizeInBytes<size_t>( |
| 81 draw_info_.resource_->size(), draw_info_.resource_->format()); | 82 draw_info_.resource_->size(), draw_info_.resource_->format()); |
| 82 } | 83 } |
| 83 return 0; | 84 return 0; |
| 84 } | 85 } |
| 85 | 86 |
| 86 void Tile::Deleter::operator()(Tile* tile) const { | |
| 87 tile->tile_manager_->Release(tile); | |
| 88 } | |
| 89 | |
| 90 } // namespace cc | 87 } // namespace cc |
| OLD | NEW |