| 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 17 matching lines...) Expand all Loading... |
| 28 : RefCountedManaged<Tile>(tile_manager), | 28 : RefCountedManaged<Tile>(tile_manager), |
| 29 tile_manager_(tile_manager), | 29 tile_manager_(tile_manager), |
| 30 size_(tile_size), | 30 size_(tile_size), |
| 31 content_rect_(content_rect), | 31 content_rect_(content_rect), |
| 32 contents_scale_(contents_scale), | 32 contents_scale_(contents_scale), |
| 33 opaque_rect_(opaque_rect), | 33 opaque_rect_(opaque_rect), |
| 34 layer_id_(layer_id), | 34 layer_id_(layer_id), |
| 35 source_frame_number_(source_frame_number), | 35 source_frame_number_(source_frame_number), |
| 36 flags_(flags), | 36 flags_(flags), |
| 37 is_shared_(false), | 37 is_shared_(false), |
| 38 tiling_i_index_(-1), |
| 39 tiling_j_index_(-1), |
| 40 required_for_activation_(false), |
| 38 id_(s_next_id_++) { | 41 id_(s_next_id_++) { |
| 39 set_picture_pile(picture_pile); | 42 set_picture_pile(picture_pile); |
| 40 for (int i = 0; i < NUM_TREES; i++) | 43 for (int i = 0; i < NUM_TREES; i++) |
| 41 is_occluded_[i] = false; | 44 is_occluded_[i] = false; |
| 42 } | 45 } |
| 43 | 46 |
| 44 Tile::~Tile() { | 47 Tile::~Tile() { |
| 45 TRACE_EVENT_OBJECT_DELETED_WITH_ID( | 48 TRACE_EVENT_OBJECT_DELETED_WITH_ID( |
| 46 TRACE_DISABLED_BY_DEFAULT("cc.debug"), | 49 TRACE_DISABLED_BY_DEFAULT("cc.debug"), |
| 47 "cc::Tile", this); | 50 "cc::Tile", this); |
| 48 } | 51 } |
| 49 | 52 |
| 50 void Tile::SetPriority(WhichTree tree, const TilePriority& priority) { | 53 void Tile::SetPriority(WhichTree tree, const TilePriority& priority) { |
| 51 if (priority == priority_[tree]) | 54 if (priority == priority_[tree]) |
| 52 return; | 55 return; |
| 53 | 56 |
| 54 priority_[tree] = priority; | 57 priority_[tree] = priority; |
| 55 tile_manager_->DidChangeTilePriority(this); | |
| 56 } | |
| 57 | |
| 58 void Tile::MarkRequiredForActivation() { | |
| 59 if (priority_[PENDING_TREE].required_for_activation) | |
| 60 return; | |
| 61 | |
| 62 priority_[PENDING_TREE].required_for_activation = true; | |
| 63 tile_manager_->DidChangeTilePriority(this); | |
| 64 } | 58 } |
| 65 | 59 |
| 66 void Tile::AsValueInto(base::debug::TracedValue* res) const { | 60 void Tile::AsValueInto(base::debug::TracedValue* res) const { |
| 67 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( | 61 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
| 68 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this); | 62 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res, "cc::Tile", this); |
| 69 TracedValue::SetIDRef(picture_pile_.get(), res, "picture_pile"); | 63 TracedValue::SetIDRef(picture_pile_.get(), res, "picture_pile"); |
| 70 res->SetDouble("contents_scale", contents_scale_); | 64 res->SetDouble("contents_scale", contents_scale_); |
| 71 | 65 |
| 72 res->BeginArray("content_rect"); | 66 res->BeginArray("content_rect"); |
| 73 MathUtil::AddToTracedValue(content_rect_, res); | 67 MathUtil::AddToTracedValue(content_rect_, res); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 112 |
| 119 bool Tile::HasRasterTask() const { | 113 bool Tile::HasRasterTask() const { |
| 120 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 114 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
| 121 if (managed_state_.tile_versions[mode].raster_task_.get()) | 115 if (managed_state_.tile_versions[mode].raster_task_.get()) |
| 122 return true; | 116 return true; |
| 123 } | 117 } |
| 124 return false; | 118 return false; |
| 125 } | 119 } |
| 126 | 120 |
| 127 } // namespace cc | 121 } // namespace cc |
| OLD | NEW |