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

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

Issue 62283012: cc: Added tile bundles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/prioritized_tile_set_unittest.cc ('k') | cc/resources/tile.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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/raster_mode.h" 13 #include "cc/resources/raster_mode.h"
14 #include "cc/resources/tile_priority.h" 14 #include "cc/resources/tile_bundle.h"
15 #include "ui/gfx/rect.h" 15 #include "ui/gfx/rect.h"
16 #include "ui/gfx/size.h" 16 #include "ui/gfx/size.h"
17 17
18 namespace cc { 18 namespace cc {
19 19
20 class PicturePileImpl; 20 class PicturePileImpl;
21 21
22 class CC_EXPORT Tile : public RefCountedManaged<Tile> { 22 class CC_EXPORT Tile : public RefCountedManaged<Tile> {
23 public: 23 public:
24 enum TileRasterFlags { 24 enum TileRasterFlags {
25 USE_LCD_TEXT = 1 << 0, 25 USE_LCD_TEXT = 1 << 0,
26 USE_GPU_RASTERIZATION = 1 << 1 26 USE_GPU_RASTERIZATION = 1 << 1
27 }; 27 };
28 28
29 typedef uint64 Id; 29 typedef uint64 Id;
30 30
31 Id id() const { 31 Id id() const {
32 return id_; 32 return id_;
33 } 33 }
34 34
35 PicturePileImpl* picture_pile() { 35 PicturePileImpl* picture_pile() {
36 return picture_pile_.get(); 36 return picture_pile_.get();
37 } 37 }
38 38
39 const PicturePileImpl* picture_pile() const { 39 const PicturePileImpl* picture_pile() const {
40 return picture_pile_.get(); 40 return picture_pile_.get();
41 } 41 }
42 42
43 const TilePriority& priority(WhichTree tree) const {
44 return priority_[tree];
45 }
46
47 TilePriority combined_priority() const {
48 return TilePriority(priority_[ACTIVE_TREE],
49 priority_[PENDING_TREE]);
50 }
51
52 void SetPriority(WhichTree tree, const TilePriority& priority);
53
54 void MarkRequiredForActivation(); 43 void MarkRequiredForActivation();
55 44
56 bool required_for_activation() const { 45 bool required_for_activation() const {
57 return priority_[PENDING_TREE].required_for_activation; 46 return required_for_activation_;
58 } 47 }
59 48
60 void set_can_use_lcd_text(bool can_use_lcd_text) { 49 void set_can_use_lcd_text(bool can_use_lcd_text) {
61 if (can_use_lcd_text) 50 if (can_use_lcd_text)
62 flags_ |= USE_LCD_TEXT; 51 flags_ |= USE_LCD_TEXT;
63 else 52 else
64 flags_ &= ~USE_LCD_TEXT; 53 flags_ &= ~USE_LCD_TEXT;
65 } 54 }
66 55
67 bool can_use_lcd_text() const { 56 bool can_use_lcd_text() const {
68 return !!(flags_ & USE_LCD_TEXT); 57 return !!(flags_ & USE_LCD_TEXT);
69 } 58 }
70 59
71 void set_use_gpu_rasterization(bool use_gpu_rasterization) { 60 void set_use_gpu_rasterization(bool use_gpu_rasterization) {
72 if (use_gpu_rasterization) 61 if (use_gpu_rasterization)
73 flags_ |= USE_GPU_RASTERIZATION; 62 flags_ |= USE_GPU_RASTERIZATION;
74 else 63 else
75 flags_ &= ~USE_GPU_RASTERIZATION; 64 flags_ &= ~USE_GPU_RASTERIZATION;
76 } 65 }
77 66
78 bool use_gpu_rasterization() const { 67 bool use_gpu_rasterization() const {
79 return !!(flags_ & USE_GPU_RASTERIZATION); 68 return !!(flags_ & USE_GPU_RASTERIZATION);
80 } 69 }
81 70
71 bool is_visible() const {
72 return is_visible_;
73 }
74
75 void set_is_visible(bool is_visible) {
76 is_visible_ = is_visible;
77 }
78
82 scoped_ptr<base::Value> AsValue() const; 79 scoped_ptr<base::Value> AsValue() const;
83 80
84 inline bool IsReadyToDraw() const { 81 inline bool IsReadyToDraw() const {
85 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { 82 for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) {
86 if (managed_state_.tile_versions[mode].IsReadyToDraw()) 83 if (managed_state_.tile_versions[mode].IsReadyToDraw())
87 return true; 84 return true;
88 } 85 }
89 return false; 86 return false;
90 } 87 }
91 88
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 ManagedTileState& managed_state() { return managed_state_; } 144 ManagedTileState& managed_state() { return managed_state_; }
148 const ManagedTileState& managed_state() const { return managed_state_; } 145 const ManagedTileState& managed_state() const { return managed_state_; }
149 146
150 TileManager* tile_manager_; 147 TileManager* tile_manager_;
151 scoped_refptr<PicturePileImpl> picture_pile_; 148 scoped_refptr<PicturePileImpl> picture_pile_;
152 gfx::Rect tile_size_; 149 gfx::Rect tile_size_;
153 gfx::Rect content_rect_; 150 gfx::Rect content_rect_;
154 float contents_scale_; 151 float contents_scale_;
155 gfx::Rect opaque_rect_; 152 gfx::Rect opaque_rect_;
156 153
157 TilePriority priority_[NUM_TREES];
158 ManagedTileState managed_state_; 154 ManagedTileState managed_state_;
159 int layer_id_; 155 int layer_id_;
160 int source_frame_number_; 156 int source_frame_number_;
161 int flags_; 157 int flags_;
158 bool required_for_activation_;
159 bool is_visible_;
162 160
163 Id id_; 161 Id id_;
164 static Id s_next_id_; 162 static Id s_next_id_;
165 163
166 DISALLOW_COPY_AND_ASSIGN(Tile); 164 DISALLOW_COPY_AND_ASSIGN(Tile);
167 }; 165 };
168 166
169 } // namespace cc 167 } // namespace cc
170 168
171 #endif // CC_RESOURCES_TILE_H_ 169 #endif // CC_RESOURCES_TILE_H_
OLDNEW
« no previous file with comments | « cc/resources/prioritized_tile_set_unittest.cc ('k') | cc/resources/tile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698