| 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/resources/tile.h" | 5 #include "cc/resources/tile.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/debug/trace_event_argument.h" | 9 #include "base/debug/trace_event_argument.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 void Tile::MarkRequiredForActivation() { | 57 void Tile::MarkRequiredForActivation() { |
| 58 if (priority_[PENDING_TREE].required_for_activation) | 58 if (priority_[PENDING_TREE].required_for_activation) |
| 59 return; | 59 return; |
| 60 | 60 |
| 61 priority_[PENDING_TREE].required_for_activation = true; | 61 priority_[PENDING_TREE].required_for_activation = true; |
| 62 tile_manager_->DidChangeTilePriority(this); | 62 tile_manager_->DidChangeTilePriority(this); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void Tile::AsValueInto(base::debug::TracedValue* res) const { | 65 void Tile::AsValueInto(base::debug::TracedValue* res, bool is_active) const { |
| 66 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( | 66 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
| 67 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this); | 67 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this); |
| 68 TracedValue::SetIDRef(picture_pile_.get(), res, "picture_pile"); | 68 TracedValue::SetIDRef(picture_pile_.get(), res, "picture_pile"); |
| 69 res->SetDouble("contents_scale", contents_scale_); | 69 res->SetDouble("contents_scale", contents_scale_); |
| 70 res->SetBoolean("is_active_tile", is_active); |
| 70 | 71 |
| 71 res->BeginArray("content_rect"); | 72 res->BeginArray("content_rect"); |
| 72 MathUtil::AddToTracedValue(content_rect_, res); | 73 MathUtil::AddToTracedValue(content_rect_, res); |
| 73 res->EndArray(); | 74 res->EndArray(); |
| 74 | 75 |
| 75 res->SetInteger("layer_id", layer_id_); | 76 res->SetInteger("layer_id", layer_id_); |
| 76 | 77 |
| 77 res->BeginDictionary("active_priority"); | 78 res->BeginDictionary("active_priority"); |
| 78 priority_[ACTIVE_TREE].AsValueInto(res); | 79 priority_[ACTIVE_TREE].AsValueInto(res); |
| 79 res->EndDictionary(); | 80 res->EndDictionary(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 118 |
| 118 bool Tile::HasRasterTask() const { | 119 bool Tile::HasRasterTask() const { |
| 119 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 120 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
| 120 if (managed_state_.tile_versions[mode].raster_task_) | 121 if (managed_state_.tile_versions[mode].raster_task_) |
| 121 return true; | 122 return true; |
| 122 } | 123 } |
| 123 return false; | 124 return false; |
| 124 } | 125 } |
| 125 | 126 |
| 126 } // namespace cc | 127 } // namespace cc |
| OLD | NEW |