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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 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
« no previous file with comments | « cc/resources/picture_pile.cc ('k') | cc/resources/picture_pile_base.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 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 22 matching lines...) Expand all
33 gfx::Size size() const { return tiling_.total_size(); } 33 gfx::Size size() const { return tiling_.total_size(); }
34 void SetMinContentsScale(float min_contents_scale); 34 void SetMinContentsScale(float min_contents_scale);
35 35
36 void UpdateRecordedRegion(); 36 void UpdateRecordedRegion();
37 const Region& recorded_region() const { return recorded_region_; } 37 const Region& recorded_region() const { return recorded_region_; }
38 38
39 int num_tiles_x() const { return tiling_.num_tiles_x(); } 39 int num_tiles_x() const { return tiling_.num_tiles_x(); }
40 int num_tiles_y() const { return tiling_.num_tiles_y(); } 40 int num_tiles_y() const { return tiling_.num_tiles_y(); }
41 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); }
42 bool HasRecordingAt(int x, int y); 42 bool HasRecordingAt(int x, int y);
43 bool CanRaster(float contents_scale, gfx::Rect content_rect); 43 bool CanRaster(float contents_scale, const gfx::Rect& content_rect);
44 44
45 static void ComputeTileGridInfo(gfx::Size tile_grid_size, 45 static void ComputeTileGridInfo(gfx::Size tile_grid_size,
46 SkTileGridPicture::TileGridInfo* info); 46 SkTileGridPicture::TileGridInfo* info);
47 47
48 void SetTileGridSize(gfx::Size tile_grid_size); 48 void SetTileGridSize(gfx::Size tile_grid_size);
49 TilingData& tiling() { return tiling_; } 49 TilingData& tiling() { return tiling_; }
50 50
51 scoped_ptr<base::Value> AsValue() const; 51 scoped_ptr<base::Value> AsValue() const;
52 52
53 protected: 53 protected:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 void SetRecordedRegionForTesting(const Region& recorded_region) { 87 void SetRecordedRegionForTesting(const Region& recorded_region) {
88 recorded_region_ = recorded_region; 88 recorded_region_ = recorded_region;
89 } 89 }
90 90
91 int num_raster_threads() { return num_raster_threads_; } 91 int num_raster_threads() { return num_raster_threads_; }
92 int buffer_pixels() const { return tiling_.border_texels(); } 92 int buffer_pixels() const { return tiling_.border_texels(); }
93 void Clear(); 93 void Clear();
94 94
95 gfx::Rect PaddedRect(const PictureMapKey& key); 95 gfx::Rect PaddedRect(const PictureMapKey& key);
96 gfx::Rect PadRect(gfx::Rect rect); 96 gfx::Rect PadRect(const gfx::Rect& rect);
97 97
98 // A picture pile is a tiled set of pictures. The picture map is a map of tile 98 // A picture pile is a tiled set of pictures. The picture map is a map of tile
99 // indices to picture infos. 99 // indices to picture infos.
100 PictureMap picture_map_; 100 PictureMap picture_map_;
101 TilingData tiling_; 101 TilingData tiling_;
102 Region recorded_region_; 102 Region recorded_region_;
103 float min_contents_scale_; 103 float min_contents_scale_;
104 SkTileGridPicture::TileGridInfo tile_grid_info_; 104 SkTileGridPicture::TileGridInfo tile_grid_info_;
105 SkColor background_color_; 105 SkColor background_color_;
106 int slow_down_raster_scale_factor_for_debug_; 106 int slow_down_raster_scale_factor_for_debug_;
107 bool contents_opaque_; 107 bool contents_opaque_;
108 bool show_debug_picture_borders_; 108 bool show_debug_picture_borders_;
109 bool clear_canvas_with_debug_color_; 109 bool clear_canvas_with_debug_color_;
110 int num_raster_threads_; 110 int num_raster_threads_;
111 111
112 private: 112 private:
113 void SetBufferPixels(int buffer_pixels); 113 void SetBufferPixels(int buffer_pixels);
114 114
115 friend class base::RefCounted<PicturePileBase>; 115 friend class base::RefCounted<PicturePileBase>;
116 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); 116 DISALLOW_COPY_AND_ASSIGN(PicturePileBase);
117 }; 117 };
118 118
119 } // namespace cc 119 } // namespace cc
120 120
121 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_ 121 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_
OLDNEW
« no previous file with comments | « cc/resources/picture_pile.cc ('k') | cc/resources/picture_pile_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698