| 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 "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 TRACE_EVENT_OBJECT_DELETED_WITH_ID( | 41 TRACE_EVENT_OBJECT_DELETED_WITH_ID( |
| 42 TRACE_DISABLED_BY_DEFAULT("cc.debug"), | 42 TRACE_DISABLED_BY_DEFAULT("cc.debug"), |
| 43 "cc::Tile", this); | 43 "cc::Tile", this); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void Tile::SetPriority(WhichTree tree, const TilePriority& priority) { | 46 void Tile::SetPriority(WhichTree tree, const TilePriority& priority) { |
| 47 if (priority == priority_[tree]) | 47 if (priority == priority_[tree]) |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 priority_[tree] = priority; | 50 priority_[tree] = priority; |
| 51 tile_manager_->DidChangeTilePriority(this); | |
| 52 } | 51 } |
| 53 | 52 |
| 54 void Tile::MarkRequiredForActivation() { | 53 void Tile::MarkRequiredForActivation() { |
| 55 if (priority_[PENDING_TREE].required_for_activation) | 54 if (priority_[PENDING_TREE].required_for_activation) |
| 56 return; | 55 return; |
| 57 | 56 |
| 58 priority_[PENDING_TREE].required_for_activation = true; | 57 priority_[PENDING_TREE].required_for_activation = true; |
| 59 tile_manager_->DidChangeTilePriority(this); | |
| 60 } | 58 } |
| 61 | 59 |
| 62 scoped_ptr<base::Value> Tile::AsValue() const { | 60 scoped_ptr<base::Value> Tile::AsValue() const { |
| 63 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); | 61 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); |
| 64 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( | 62 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
| 65 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res.get(), "cc::Tile", this); | 63 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res.get(), "cc::Tile", this); |
| 66 res->Set("picture_pile", | 64 res->Set("picture_pile", |
| 67 TracedValue::CreateIDRef(picture_pile_.get()).release()); | 65 TracedValue::CreateIDRef(picture_pile_.get()).release()); |
| 68 res->SetDouble("contents_scale", contents_scale_); | 66 res->SetDouble("contents_scale", contents_scale_); |
| 69 res->Set("content_rect", MathUtil::AsValue(content_rect_).release()); | 67 res->Set("content_rect", MathUtil::AsValue(content_rect_).release()); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 100 else if (can_use_lcd_text()) | 98 else if (can_use_lcd_text()) |
| 101 raster_mode = HIGH_QUALITY_RASTER_MODE; | 99 raster_mode = HIGH_QUALITY_RASTER_MODE; |
| 102 else if (managed_state_.tile_versions[current_mode].has_text_ || | 100 else if (managed_state_.tile_versions[current_mode].has_text_ || |
| 103 !managed_state_.tile_versions[current_mode].IsReadyToDraw()) | 101 !managed_state_.tile_versions[current_mode].IsReadyToDraw()) |
| 104 raster_mode = HIGH_QUALITY_NO_LCD_RASTER_MODE; | 102 raster_mode = HIGH_QUALITY_NO_LCD_RASTER_MODE; |
| 105 | 103 |
| 106 return std::min(raster_mode, current_mode); | 104 return std::min(raster_mode, current_mode); |
| 107 } | 105 } |
| 108 | 106 |
| 109 } // namespace cc | 107 } // namespace cc |
| OLD | NEW |