| 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_TILES_TILE_H_ | 5 #ifndef CC_TILES_TILE_H_ |
| 6 #define CC_TILES_TILE_H_ | 6 #define CC_TILES_TILE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "cc/tiles/tile_draw_info.h" | 9 #include "cc/tiles/tile_draw_info.h" |
| 10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const gfx::Rect& enclosing_layer_rect, | 36 const gfx::Rect& enclosing_layer_rect, |
| 37 const gfx::Rect& content_rect, | 37 const gfx::Rect& content_rect, |
| 38 float contents_scale) | 38 float contents_scale) |
| 39 : tiling_i_index(tiling_i_index), | 39 : tiling_i_index(tiling_i_index), |
| 40 tiling_j_index(tiling_j_index), | 40 tiling_j_index(tiling_j_index), |
| 41 enclosing_layer_rect(enclosing_layer_rect), | 41 enclosing_layer_rect(enclosing_layer_rect), |
| 42 content_rect(content_rect), | 42 content_rect(content_rect), |
| 43 contents_scale(contents_scale) {} | 43 contents_scale(contents_scale) {} |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0 }; | 46 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0, IS_OPAQUE = 1 << 1 }; |
| 47 | 47 |
| 48 typedef uint64 Id; | 48 typedef uint64 Id; |
| 49 | 49 |
| 50 Id id() const { | 50 Id id() const { |
| 51 return id_; | 51 return id_; |
| 52 } | 52 } |
| 53 | 53 |
| 54 // TODO(vmpstr): Move this to the iterators. | 54 // TODO(vmpstr): Move this to the iterators. |
| 55 bool required_for_activation() const { return required_for_activation_; } | 55 bool required_for_activation() const { return required_for_activation_; } |
| 56 void set_required_for_activation(bool is_required) { | 56 void set_required_for_activation(bool is_required) { |
| 57 required_for_activation_ = is_required; | 57 required_for_activation_ = is_required; |
| 58 } | 58 } |
| 59 bool required_for_draw() const { return required_for_draw_; } | 59 bool required_for_draw() const { return required_for_draw_; } |
| 60 void set_required_for_draw(bool is_required) { | 60 void set_required_for_draw(bool is_required) { |
| 61 required_for_draw_ = is_required; | 61 required_for_draw_ = is_required; |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool use_picture_analysis() const { | 64 bool use_picture_analysis() const { |
| 65 return !!(flags_ & USE_PICTURE_ANALYSIS); | 65 return !!(flags_ & USE_PICTURE_ANALYSIS); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool is_opaque() const { return !!(flags_ & IS_OPAQUE); } |
| 69 |
| 68 void AsValueInto(base::trace_event::TracedValue* value) const; | 70 void AsValueInto(base::trace_event::TracedValue* value) const; |
| 69 | 71 |
| 70 const TileDrawInfo& draw_info() const { return draw_info_; } | 72 const TileDrawInfo& draw_info() const { return draw_info_; } |
| 71 TileDrawInfo& draw_info() { return draw_info_; } | 73 TileDrawInfo& draw_info() { return draw_info_; } |
| 72 | 74 |
| 73 float contents_scale() const { return contents_scale_; } | 75 float contents_scale() const { return contents_scale_; } |
| 74 const gfx::Rect& content_rect() const { return content_rect_; } | 76 const gfx::Rect& content_rect() const { return content_rect_; } |
| 75 const gfx::Rect& enclosing_layer_rect() const { | 77 const gfx::Rect& enclosing_layer_rect() const { |
| 76 return enclosing_layer_rect_; | 78 return enclosing_layer_rect_; |
| 77 } | 79 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 scoped_refptr<RasterTask> raster_task_; | 143 scoped_refptr<RasterTask> raster_task_; |
| 142 | 144 |
| 143 DISALLOW_COPY_AND_ASSIGN(Tile); | 145 DISALLOW_COPY_AND_ASSIGN(Tile); |
| 144 }; | 146 }; |
| 145 | 147 |
| 146 using ScopedTilePtr = scoped_ptr<Tile, Tile::Deleter>; | 148 using ScopedTilePtr = scoped_ptr<Tile, Tile::Deleter>; |
| 147 | 149 |
| 148 } // namespace cc | 150 } // namespace cc |
| 149 | 151 |
| 150 #endif // CC_TILES_TILE_H_ | 152 #endif // CC_TILES_TILE_H_ |
| OLD | NEW |