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

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

Issue 367833003: cc: Start using raster/eviction iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 6 years, 5 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_PICTURE_LAYER_TILING_SET_H_ 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_
6 #define CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_
7 7
8 #include "cc/base/region.h" 8 #include "cc/base/region.h"
9 #include "cc/base/scoped_ptr_vector.h" 9 #include "cc/base/scoped_ptr_vector.h"
10 #include "cc/resources/picture_layer_tiling.h" 10 #include "cc/resources/picture_layer_tiling.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Remove all tilings. 46 // Remove all tilings.
47 void RemoveAllTilings(); 47 void RemoveAllTilings();
48 48
49 // Remove one tiling. 49 // Remove one tiling.
50 void Remove(PictureLayerTiling* tiling); 50 void Remove(PictureLayerTiling* tiling);
51 51
52 // Remove all tiles; keep all tilings. 52 // Remove all tiles; keep all tilings.
53 void RemoveAllTiles(); 53 void RemoveAllTiles();
54 54
55 void DidBecomeActive(); 55 void DidBecomeActive();
56 void DidBecomeRecycled();
57 56
58 // For a given rect, iterates through tiles that can fill it. If no 57 // For a given rect, iterates through tiles that can fill it. If no
59 // set of tiles with resources can fill the rect, then it will iterate 58 // set of tiles with resources can fill the rect, then it will iterate
60 // through null tiles with valid geometry_rect() until the rect is full. 59 // through null tiles with valid geometry_rect() until the rect is full.
61 // If all tiles have resources, the union of all geometry_rects will 60 // If all tiles have resources, the union of all geometry_rects will
62 // exactly fill rect with no overlap. 61 // exactly fill rect with no overlap.
63 class CC_EXPORT CoverageIterator { 62 class CC_EXPORT CoverageIterator {
64 public: 63 public:
65 CoverageIterator(const PictureLayerTilingSet* set, 64 CoverageIterator(const PictureLayerTilingSet* set,
66 float contents_scale, 65 float contents_scale,
67 const gfx::Rect& content_rect, 66 const gfx::Rect& content_rect,
68 float ideal_contents_scale); 67 float ideal_contents_scale);
69 ~CoverageIterator(); 68 ~CoverageIterator();
70 69
71 // Visible rect (no borders), always in the space of rect, 70 // Visible rect (no borders), always in the space of rect,
72 // regardless of the relative contents scale of the tiling. 71 // regardless of the relative contents scale of the tiling.
73 gfx::Rect geometry_rect() const; 72 gfx::Rect geometry_rect() const;
74 // Texture rect (in texels) for geometry_rect 73 // Texture rect (in texels) for geometry_rect
75 gfx::RectF texture_rect() const; 74 gfx::RectF texture_rect() const;
76 // Texture size in texels 75 // Texture size in texels
77 gfx::Size texture_size() const; 76 gfx::Size texture_size() const;
77 // Tile resolution.
78 TileResolution resolution();
78 79
79 Tile* operator->() const; 80 Tile* operator->() const;
80 Tile* operator*() const; 81 Tile* operator*() const;
81 82
82 CoverageIterator& operator++(); 83 CoverageIterator& operator++();
83 operator bool() const; 84 operator bool() const;
84 85
85 PictureLayerTiling* CurrentTiling(); 86 PictureLayerTiling* CurrentTiling();
86 87
87 private: 88 private:
(...skipping 19 matching lines...) Expand all
107 gfx::Size layer_bounds_; 108 gfx::Size layer_bounds_;
108 ScopedPtrVector<PictureLayerTiling> tilings_; 109 ScopedPtrVector<PictureLayerTiling> tilings_;
109 110
110 friend class Iterator; 111 friend class Iterator;
111 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); 112 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet);
112 }; 113 };
113 114
114 } // namespace cc 115 } // namespace cc
115 116
116 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ 117 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698