OLD | NEW |
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 typedef std::pair<int, int> PictureMapKey; | 82 typedef std::pair<int, int> PictureMapKey; |
83 typedef base::hash_map<PictureMapKey, PictureInfo> PictureMap; | 83 typedef base::hash_map<PictureMapKey, PictureInfo> PictureMap; |
84 | 84 |
85 virtual ~PicturePileBase(); | 85 virtual ~PicturePileBase(); |
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_; } | |
92 int buffer_pixels() const { return tiling_.border_texels(); } | 91 int buffer_pixels() const { return tiling_.border_texels(); } |
93 void Clear(); | 92 void Clear(); |
94 | 93 |
95 gfx::Rect PaddedRect(const PictureMapKey& key); | 94 gfx::Rect PaddedRect(const PictureMapKey& key); |
96 gfx::Rect PadRect(const gfx::Rect& rect); | 95 gfx::Rect PadRect(const gfx::Rect& rect); |
97 | 96 |
98 // A picture pile is a tiled set of pictures. The picture map is a map of tile | 97 // A picture pile is a tiled set of pictures. The picture map is a map of tile |
99 // indices to picture infos. | 98 // indices to picture infos. |
100 PictureMap picture_map_; | 99 PictureMap picture_map_; |
101 TilingData tiling_; | 100 TilingData tiling_; |
102 Region recorded_region_; | 101 Region recorded_region_; |
103 float min_contents_scale_; | 102 float min_contents_scale_; |
104 SkTileGridPicture::TileGridInfo tile_grid_info_; | 103 SkTileGridPicture::TileGridInfo tile_grid_info_; |
105 SkColor background_color_; | 104 SkColor background_color_; |
106 int slow_down_raster_scale_factor_for_debug_; | 105 int slow_down_raster_scale_factor_for_debug_; |
107 bool contents_opaque_; | 106 bool contents_opaque_; |
108 bool show_debug_picture_borders_; | 107 bool show_debug_picture_borders_; |
109 bool clear_canvas_with_debug_color_; | 108 bool clear_canvas_with_debug_color_; |
110 int num_raster_threads_; | |
111 | 109 |
112 private: | 110 private: |
113 void SetBufferPixels(int buffer_pixels); | 111 void SetBufferPixels(int buffer_pixels); |
114 | 112 |
115 friend class base::RefCounted<PicturePileBase>; | 113 friend class base::RefCounted<PicturePileBase>; |
116 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); | 114 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); |
117 }; | 115 }; |
118 | 116 |
119 } // namespace cc | 117 } // namespace cc |
120 | 118 |
121 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_ | 119 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_ |
OLD | NEW |