Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: cc/resources/tile.h

Issue 817133006: Support different formats in the same resource pool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/base/ref_counted_managed.h" 9 #include "cc/base/ref_counted_managed.h"
10 #include "cc/resources/raster_source.h" 10 #include "cc/resources/raster_source.h"
11 #include "cc/resources/tile_draw_info.h" 11 #include "cc/resources/tile_draw_info.h"
12 #include "cc/resources/tile_priority.h" 12 #include "cc/resources/tile_priority.h"
13 #include "ui/gfx/geometry/rect.h" 13 #include "ui/gfx/geometry/rect.h"
14 #include "ui/gfx/geometry/size.h" 14 #include "ui/gfx/geometry/size.h"
15 15
16 namespace cc { 16 namespace cc {
17 17
18 class TileManager; 18 class TileManager;
19 19
20 class CC_EXPORT Tile : public RefCountedManaged<Tile> { 20 class CC_EXPORT Tile : public RefCountedManaged<Tile> {
21 public: 21 public:
22 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0 }; 22 enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0, IS_OPAQUE = 1 << 1 };
23 23
24 typedef uint64 Id; 24 typedef uint64 Id;
25 25
26 Id id() const { 26 Id id() const {
27 return id_; 27 return id_;
28 } 28 }
29 29
30 RasterSource* raster_source() { return raster_source_.get(); } 30 RasterSource* raster_source() { return raster_source_.get(); }
31 31
32 const RasterSource* raster_source() const { return raster_source_.get(); } 32 const RasterSource* raster_source() const { return raster_source_.get(); }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 bool HasResource() const { return draw_info_.has_resource(); } 99 bool HasResource() const { return draw_info_.has_resource(); }
100 bool NeedsRaster() const { 100 bool NeedsRaster() const {
101 return draw_info_.mode() == TileDrawInfo::PICTURE_PILE_MODE || 101 return draw_info_.mode() == TileDrawInfo::PICTURE_PILE_MODE ||
102 !draw_info_.IsReadyToDraw(); 102 !draw_info_.IsReadyToDraw();
103 } 103 }
104 104
105 void AsValueInto(base::debug::TracedValue* dict) const; 105 void AsValueInto(base::debug::TracedValue* dict) const;
106 106
107 inline bool IsReadyToDraw() const { return draw_info_.IsReadyToDraw(); } 107 inline bool IsReadyToDraw() const { return draw_info_.IsReadyToDraw(); }
108 108
109 bool IsOpaque() const { return !!(flags_ & IS_OPAQUE); }
110
109 const TileDrawInfo& draw_info() const { return draw_info_; } 111 const TileDrawInfo& draw_info() const { return draw_info_; }
110 112
111 TileDrawInfo& draw_info() { return draw_info_; } 113 TileDrawInfo& draw_info() { return draw_info_; }
112 114
113 float contents_scale() const { return contents_scale_; } 115 float contents_scale() const { return contents_scale_; }
114 gfx::Rect content_rect() const { return content_rect_; } 116 gfx::Rect content_rect() const { return content_rect_; }
115 117
116 int layer_id() const { return layer_id_; } 118 int layer_id() const { return layer_id_; }
117 119
118 int source_frame_number() const { return source_frame_number_; } 120 int source_frame_number() const { return source_frame_number_; }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 unsigned scheduled_priority_; 182 unsigned scheduled_priority_;
181 183
182 scoped_refptr<RasterTask> raster_task_; 184 scoped_refptr<RasterTask> raster_task_;
183 185
184 DISALLOW_COPY_AND_ASSIGN(Tile); 186 DISALLOW_COPY_AND_ASSIGN(Tile);
185 }; 187 };
186 188
187 } // namespace cc 189 } // namespace cc
188 190
189 #endif // CC_RESOURCES_TILE_H_ 191 #endif // CC_RESOURCES_TILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698