| 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 #ifndef CC_RESOURCES_TILE_H_ | 5 #ifndef CC_RESOURCES_TILE_H_ |
| 6 #define CC_RESOURCES_TILE_H_ | 6 #define CC_RESOURCES_TILE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "cc/base/ref_counted_managed.h" | 11 #include "cc/base/ref_counted_managed.h" |
| 12 #include "cc/resources/managed_tile_state.h" | 12 #include "cc/resources/managed_tile_state.h" |
| 13 #include "cc/resources/picture_pile_impl.h" | 13 #include "cc/resources/picture_pile_impl.h" |
| 14 #include "cc/resources/raster_mode.h" | 14 #include "cc/resources/raster_mode.h" |
| 15 #include "cc/resources/tile_priority.h" | 15 #include "cc/resources/tile_priority.h" |
| 16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 17 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
| 18 | 18 |
| 19 namespace cc { | 19 namespace cc { |
| 20 | 20 |
| 21 class CC_EXPORT Tile : public RefCountedManaged<Tile> { | 21 class CC_EXPORT Tile : public RefCountedManaged<Tile> { |
| 22 public: | 22 public: |
| 23 enum TileRasterFlags { USE_LCD_TEXT = 1 << 0, USE_PICTURE_ANALYSIS = 1 << 1 }; | 23 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0 }; |
| 24 | 24 |
| 25 typedef uint64 Id; | 25 typedef uint64 Id; |
| 26 | 26 |
| 27 Id id() const { | 27 Id id() const { |
| 28 return id_; | 28 return id_; |
| 29 } | 29 } |
| 30 | 30 |
| 31 PicturePileImpl* picture_pile() { | 31 PicturePileImpl* picture_pile() { |
| 32 return picture_pile_.get(); | 32 return picture_pile_.get(); |
| 33 } | 33 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 void SetPriority(WhichTree tree, const TilePriority& priority); | 61 void SetPriority(WhichTree tree, const TilePriority& priority); |
| 62 | 62 |
| 63 void MarkRequiredForActivation(); | 63 void MarkRequiredForActivation(); |
| 64 | 64 |
| 65 bool required_for_activation() const { | 65 bool required_for_activation() const { |
| 66 return priority_[PENDING_TREE].required_for_activation; | 66 return priority_[PENDING_TREE].required_for_activation; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void set_can_use_lcd_text(bool can_use_lcd_text) { | |
| 70 if (can_use_lcd_text) | |
| 71 flags_ |= USE_LCD_TEXT; | |
| 72 else | |
| 73 flags_ &= ~USE_LCD_TEXT; | |
| 74 } | |
| 75 | |
| 76 bool can_use_lcd_text() const { | |
| 77 return !!(flags_ & USE_LCD_TEXT); | |
| 78 } | |
| 79 | |
| 80 bool use_picture_analysis() const { | 69 bool use_picture_analysis() const { |
| 81 return !!(flags_ & USE_PICTURE_ANALYSIS); | 70 return !!(flags_ & USE_PICTURE_ANALYSIS); |
| 82 } | 71 } |
| 83 | 72 |
| 84 bool NeedsRasterForMode(RasterMode mode) const { | 73 bool NeedsRasterForMode(RasterMode mode) const { |
| 85 return !managed_state_.tile_versions[mode].IsReadyToDraw(); | 74 return !managed_state_.tile_versions[mode].IsReadyToDraw(); |
| 86 } | 75 } |
| 87 | 76 |
| 88 bool HasResources() const { | 77 bool HasResources() const { |
| 89 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { | 78 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 170 |
| 182 Id id_; | 171 Id id_; |
| 183 static Id s_next_id_; | 172 static Id s_next_id_; |
| 184 | 173 |
| 185 DISALLOW_COPY_AND_ASSIGN(Tile); | 174 DISALLOW_COPY_AND_ASSIGN(Tile); |
| 186 }; | 175 }; |
| 187 | 176 |
| 188 } // namespace cc | 177 } // namespace cc |
| 189 | 178 |
| 190 #endif // CC_RESOURCES_TILE_H_ | 179 #endif // CC_RESOURCES_TILE_H_ |
| OLD | NEW |