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

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

Issue 12865017: Makes tile-creation lazy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
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/resources/managed_tile_state.h" 11 #include "cc/resources/managed_tile_state.h"
12 #include "cc/resources/picture_pile_impl.h" 12 #include "cc/resources/picture_pile_impl.h"
13 #include "cc/resources/tile_priority.h" 13 #include "cc/resources/tile_priority.h"
14 #include "cc/trees/layer_tree_host_impl.h" 14 #include "cc/trees/layer_tree_host_impl.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 Tile; 20 class Tile;
21 class TileManager; 21 class TileManager;
22 22
23 class CC_EXPORT Tile : public base::RefCounted<Tile> { 23 class CC_EXPORT Tile : public base::RefCounted<Tile> {
24 public: 24 public:
25 Tile(TileManager* tile_manager, 25 Tile(TileManager* tile_manager,
26 PicturePileImpl* picture_pile, 26 PicturePileImpl* picture_pile,
27 gfx::Size tile_size, 27 gfx::Size tile_size,
28 GLenum format, 28 GLenum format,
29 gfx::Rect content_rect, 29 gfx::Rect content_rect,
30 gfx::Rect paint_rect,
30 gfx::Rect opaque_rect, 31 gfx::Rect opaque_rect,
31 float contents_scale, 32 float contents_scale,
32 int layer_id); 33 int layer_id);
33 34
34 PicturePileImpl* picture_pile() { 35 PicturePileImpl* picture_pile() {
35 return picture_pile_.get(); 36 return picture_pile_.get();
36 } 37 }
37 38
38 const TilePriority& priority(WhichTree tree) const { 39 const TilePriority& priority(WhichTree tree) const {
39 return priority_[tree]; 40 return priority_[tree];
(...skipping 12 matching lines...) Expand all
52 return managed_state_.drawing_info; 53 return managed_state_.drawing_info;
53 } 54 }
54 ManagedTileState::DrawingInfo& drawing_info() { 55 ManagedTileState::DrawingInfo& drawing_info() {
55 return managed_state_.drawing_info; 56 return managed_state_.drawing_info;
56 } 57 }
57 58
58 const gfx::Rect& opaque_rect() const { return opaque_rect_; } 59 const gfx::Rect& opaque_rect() const { return opaque_rect_; }
59 60
60 float contents_scale() const { return contents_scale_; } 61 float contents_scale() const { return contents_scale_; }
61 gfx::Rect content_rect() const { return content_rect_; } 62 gfx::Rect content_rect() const { return content_rect_; }
63 gfx::Rect paint_rect() const { return paint_rect_; }
62 64
63 int layer_id() const { return layer_id_; } 65 int layer_id() const { return layer_id_; }
64 66
65 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) { 67 void set_picture_pile(scoped_refptr<PicturePileImpl> pile) {
66 DCHECK(pile->CanRaster(contents_scale_, content_rect_)); 68 DCHECK(pile->CanRaster(contents_scale_, content_rect_));
67 picture_pile_ = pile; 69 picture_pile_ = pile;
68 } 70 }
69 71
70 private: 72 private:
71 // Methods called by by tile manager. 73 // Methods called by by tile manager.
(...skipping 10 matching lines...) Expand all
82 84
83 // Normal private methods. 85 // Normal private methods.
84 friend class base::RefCounted<Tile>; 86 friend class base::RefCounted<Tile>;
85 ~Tile(); 87 ~Tile();
86 88
87 TileManager* tile_manager_; 89 TileManager* tile_manager_;
88 scoped_refptr<PicturePileImpl> picture_pile_; 90 scoped_refptr<PicturePileImpl> picture_pile_;
89 gfx::Rect tile_size_; 91 gfx::Rect tile_size_;
90 GLenum format_; 92 GLenum format_;
91 gfx::Rect content_rect_; 93 gfx::Rect content_rect_;
94 gfx::Rect paint_rect_;
enne (OOO) 2013/03/27 22:15:39 As a follow-up to whunt's offline question about s
92 float contents_scale_; 95 float contents_scale_;
93 gfx::Rect opaque_rect_; 96 gfx::Rect opaque_rect_;
94 97
95 TilePriority priority_[NUM_BIN_PRIORITIES]; 98 TilePriority priority_[NUM_BIN_PRIORITIES];
96 ManagedTileState managed_state_; 99 ManagedTileState managed_state_;
97 int layer_id_; 100 int layer_id_;
98 }; 101 };
99 102
100 } // namespace cc 103 } // namespace cc
101 104
102 #endif // CC_RESOURCES_TILE_H_ 105 #endif // CC_RESOURCES_TILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698