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/traced_value.h" |
9 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
10 #include "cc/debug/traced_value.h" | |
11 #include "cc/resources/tile_manager.h" | 11 #include "cc/resources/tile_manager.h" |
12 #include "third_party/khronos/GLES2/gl2.h" | 12 #include "third_party/khronos/GLES2/gl2.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 Tile::Id Tile::s_next_id_ = 0; | 16 Tile::Id Tile::s_next_id_ = 0; |
17 | 17 |
18 Tile::Tile(TileManager* tile_manager, | 18 Tile::Tile(TileManager* tile_manager, |
19 PicturePileImpl* picture_pile, | 19 PicturePileImpl* picture_pile, |
20 const gfx::Size& tile_size, | 20 const gfx::Size& tile_size, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 void Tile::MarkRequiredForActivation() { | 54 void Tile::MarkRequiredForActivation() { |
55 if (priority_[PENDING_TREE].required_for_activation) | 55 if (priority_[PENDING_TREE].required_for_activation) |
56 return; | 56 return; |
57 | 57 |
58 priority_[PENDING_TREE].required_for_activation = true; | 58 priority_[PENDING_TREE].required_for_activation = true; |
59 tile_manager_->DidChangeTilePriority(this); | 59 tile_manager_->DidChangeTilePriority(this); |
60 } | 60 } |
61 | 61 |
62 scoped_ptr<base::Value> Tile::AsValue() const { | 62 scoped_ptr<base::Value> Tile::AsValue() const { |
63 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); | 63 scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue()); |
64 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( | 64 base::debug::TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
65 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res.get(), "cc::Tile", this); | 65 TRACE_DISABLED_BY_DEFAULT("cc.debug"), res.get(), "cc::Tile", this); |
66 res->Set("picture_pile", | 66 res->Set( |
67 TracedValue::CreateIDRef(picture_pile_.get()).release()); | 67 "picture_pile", |
| 68 base::debug::TracedValue::CreateIDRef(picture_pile_.get()).release()); |
68 res->SetDouble("contents_scale", contents_scale_); | 69 res->SetDouble("contents_scale", contents_scale_); |
69 res->Set("content_rect", MathUtil::AsValue(content_rect_).release()); | 70 res->Set("content_rect", MathUtil::AsValue(content_rect_).release()); |
70 res->SetInteger("layer_id", layer_id_); | 71 res->SetInteger("layer_id", layer_id_); |
71 res->Set("active_priority", priority_[ACTIVE_TREE].AsValue().release()); | 72 res->Set("active_priority", priority_[ACTIVE_TREE].AsValue().release()); |
72 res->Set("pending_priority", priority_[PENDING_TREE].AsValue().release()); | 73 res->Set("pending_priority", priority_[PENDING_TREE].AsValue().release()); |
73 res->Set("managed_state", managed_state_.AsValue().release()); | 74 res->Set("managed_state", managed_state_.AsValue().release()); |
74 res->SetBoolean("can_use_lcd_text", can_use_lcd_text()); | 75 res->SetBoolean("can_use_lcd_text", can_use_lcd_text()); |
75 res->SetBoolean("use_gpu_rasterization", use_gpu_rasterization()); | 76 res->SetBoolean("use_gpu_rasterization", use_gpu_rasterization()); |
76 return res.PassAs<base::Value>(); | 77 return res.PassAs<base::Value>(); |
77 } | 78 } |
(...skipping 22 matching lines...) Expand all Loading... |
100 else if (can_use_lcd_text()) | 101 else if (can_use_lcd_text()) |
101 raster_mode = HIGH_QUALITY_RASTER_MODE; | 102 raster_mode = HIGH_QUALITY_RASTER_MODE; |
102 else if (managed_state_.tile_versions[current_mode].has_text_ || | 103 else if (managed_state_.tile_versions[current_mode].has_text_ || |
103 !managed_state_.tile_versions[current_mode].IsReadyToDraw()) | 104 !managed_state_.tile_versions[current_mode].IsReadyToDraw()) |
104 raster_mode = HIGH_QUALITY_NO_LCD_RASTER_MODE; | 105 raster_mode = HIGH_QUALITY_NO_LCD_RASTER_MODE; |
105 | 106 |
106 return std::min(raster_mode, current_mode); | 107 return std::min(raster_mode, current_mode); |
107 } | 108 } |
108 | 109 |
109 } // namespace cc | 110 } // namespace cc |
OLD | NEW |