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

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

Issue 294163009: cc: Expand invalidation to full tile when recording is missing for the tile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pictureslow: doitinpicturepile Created 6 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_PILE_BASE_H_ 5 #ifndef CC_RESOURCES_PICTURE_PILE_BASE_H_
6 #define CC_RESOURCES_PICTURE_PILE_BASE_H_ 6 #define CC_RESOURCES_PICTURE_PILE_BASE_H_
7 7
8 #include <bitset> 8 #include <bitset>
9 #include <list> 9 #include <list>
10 #include <utility> 10 #include <utility>
(...skipping 15 matching lines...) Expand all
26 class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> { 26 class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> {
27 public: 27 public:
28 PicturePileBase(); 28 PicturePileBase();
29 explicit PicturePileBase(const PicturePileBase* other); 29 explicit PicturePileBase(const PicturePileBase* other);
30 PicturePileBase(const PicturePileBase* other, unsigned thread_index); 30 PicturePileBase(const PicturePileBase* other, unsigned thread_index);
31 31
32 void SetTilingRect(const gfx::Rect& tiling_rect); 32 void SetTilingRect(const gfx::Rect& tiling_rect);
33 gfx::Rect tiling_rect() const { return tiling_.tiling_rect(); } 33 gfx::Rect tiling_rect() const { return tiling_.tiling_rect(); }
34 void SetMinContentsScale(float min_contents_scale); 34 void SetMinContentsScale(float min_contents_scale);
35 35
36 // If non-empty, all pictures tiles inside this rect are recorded.
37 gfx::Rect recorded_viewport() const { return recorded_viewport_; }
38
36 int num_tiles_x() const { return tiling_.num_tiles_x(); } 39 int num_tiles_x() const { return tiling_.num_tiles_x(); }
37 int num_tiles_y() const { return tiling_.num_tiles_y(); } 40 int num_tiles_y() const { return tiling_.num_tiles_y(); }
38 gfx::Rect tile_bounds(int x, int y) const { return tiling_.TileBounds(x, y); } 41 gfx::Rect tile_bounds(int x, int y) const { return tiling_.TileBounds(x, y); }
39 bool HasRecordingAt(int x, int y); 42 bool HasRecordingAt(int x, int y);
40 bool CanRaster(float contents_scale, const gfx::Rect& content_rect); 43 bool CanRaster(float contents_scale, const gfx::Rect& content_rect);
41 44
42 // If this pile contains any valid recordings. May have false positives. 45 // If this pile contains any valid recordings. May have false positives.
43 bool HasRecordings() const { return has_any_recordings_; } 46 bool HasRecordings() const { return has_any_recordings_; }
44 47
45 static void ComputeTileGridInfo(const gfx::Size& tile_grid_size, 48 static void ComputeTileGridInfo(const gfx::Size& tile_grid_size,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 gfx::Rect PadRect(const gfx::Rect& rect); 94 gfx::Rect PadRect(const gfx::Rect& rect);
92 95
93 // An internal CanRaster check that goes to the picture_map rather than 96 // An internal CanRaster check that goes to the picture_map rather than
94 // using the recorded_viewport hint. 97 // using the recorded_viewport hint.
95 bool CanRasterSlowTileCheck(const gfx::Rect& layer_rect) const; 98 bool CanRasterSlowTileCheck(const gfx::Rect& layer_rect) const;
96 99
97 // A picture pile is a tiled set of pictures. The picture map is a map of tile 100 // A picture pile is a tiled set of pictures. The picture map is a map of tile
98 // indices to picture infos. 101 // indices to picture infos.
99 PictureMap picture_map_; 102 PictureMap picture_map_;
100 TilingData tiling_; 103 TilingData tiling_;
101 // If non-empty, all pictures tiles inside this rect are recorded.
102 gfx::Rect recorded_viewport_; 104 gfx::Rect recorded_viewport_;
103 float min_contents_scale_; 105 float min_contents_scale_;
104 SkTileGridFactory::TileGridInfo tile_grid_info_; 106 SkTileGridFactory::TileGridInfo tile_grid_info_;
105 SkColor background_color_; 107 SkColor background_color_;
106 int slow_down_raster_scale_factor_for_debug_; 108 int slow_down_raster_scale_factor_for_debug_;
107 bool contents_opaque_; 109 bool contents_opaque_;
108 bool contents_fill_bounds_completely_; 110 bool contents_fill_bounds_completely_;
109 bool show_debug_picture_borders_; 111 bool show_debug_picture_borders_;
110 bool clear_canvas_with_debug_color_; 112 bool clear_canvas_with_debug_color_;
111 // A hint about whether there are any recordings. This may be a false 113 // A hint about whether there are any recordings. This may be a false
112 // positive. 114 // positive.
113 bool has_any_recordings_; 115 bool has_any_recordings_;
114 116
115 private: 117 private:
116 void SetBufferPixels(int buffer_pixels); 118 void SetBufferPixels(int buffer_pixels);
117 119
118 friend class base::RefCounted<PicturePileBase>; 120 friend class base::RefCounted<PicturePileBase>;
119 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); 121 DISALLOW_COPY_AND_ASSIGN(PicturePileBase);
120 }; 122 };
121 123
122 } // namespace cc 124 } // namespace cc
123 125
124 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_ 126 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698