| 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 "cc/resources/tile_draw_info.h" | 9 #include "cc/resources/tile_draw_info.h" |
| 10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 bool required_for_draw() const { return required_for_draw_; } | 39 bool required_for_draw() const { return required_for_draw_; } |
| 40 void set_required_for_draw(bool is_required) { | 40 void set_required_for_draw(bool is_required) { |
| 41 required_for_draw_ = is_required; | 41 required_for_draw_ = is_required; |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool use_picture_analysis() const { | 44 bool use_picture_analysis() const { |
| 45 return !!(flags_ & USE_PICTURE_ANALYSIS); | 45 return !!(flags_ & USE_PICTURE_ANALYSIS); |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool HasResource() const { return draw_info_.has_resource(); } | |
| 49 bool NeedsRaster() const { | |
| 50 return draw_info_.mode() == TileDrawInfo::OOM_MODE || | |
| 51 !draw_info_.IsReadyToDraw(); | |
| 52 } | |
| 53 | |
| 54 void AsValueInto(base::trace_event::TracedValue* value) const; | 48 void AsValueInto(base::trace_event::TracedValue* value) const; |
| 55 | 49 |
| 56 inline bool IsReadyToDraw() const { return draw_info_.IsReadyToDraw(); } | |
| 57 | |
| 58 const TileDrawInfo& draw_info() const { return draw_info_; } | 50 const TileDrawInfo& draw_info() const { return draw_info_; } |
| 59 | |
| 60 TileDrawInfo& draw_info() { return draw_info_; } | 51 TileDrawInfo& draw_info() { return draw_info_; } |
| 61 | 52 |
| 62 float contents_scale() const { return contents_scale_; } | 53 float contents_scale() const { return contents_scale_; } |
| 63 gfx::Rect content_rect() const { return content_rect_; } | 54 gfx::Rect content_rect() const { return content_rect_; } |
| 64 | 55 |
| 65 int layer_id() const { return layer_id_; } | 56 int layer_id() const { return layer_id_; } |
| 66 | 57 |
| 67 int source_frame_number() const { return source_frame_number_; } | 58 int source_frame_number() const { return source_frame_number_; } |
| 68 | 59 |
| 69 size_t GPUMemoryUsageInBytes() const; | 60 size_t GPUMemoryUsageInBytes() const; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 scoped_refptr<RasterTask> raster_task_; | 108 scoped_refptr<RasterTask> raster_task_; |
| 118 | 109 |
| 119 DISALLOW_COPY_AND_ASSIGN(Tile); | 110 DISALLOW_COPY_AND_ASSIGN(Tile); |
| 120 }; | 111 }; |
| 121 | 112 |
| 122 using ScopedTilePtr = scoped_ptr<Tile, Tile::Deleter>; | 113 using ScopedTilePtr = scoped_ptr<Tile, Tile::Deleter>; |
| 123 | 114 |
| 124 } // namespace cc | 115 } // namespace cc |
| 125 | 116 |
| 126 #endif // CC_RESOURCES_TILE_H_ | 117 #endif // CC_RESOURCES_TILE_H_ |
| OLD | NEW |