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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 gfx::Rect tile_bounds(int x, int y) const { return tiling_.TileBounds(x, y); } | 44 gfx::Rect tile_bounds(int x, int y) const { return tiling_.TileBounds(x, y); } |
45 bool HasRecordingAt(int x, int y); | 45 bool HasRecordingAt(int x, int y); |
46 bool CanRaster(float contents_scale, const gfx::Rect& content_rect); | 46 bool CanRaster(float contents_scale, const gfx::Rect& content_rect); |
47 | 47 |
48 // If this pile contains any valid recordings. May have false positives. | 48 // If this pile contains any valid recordings. May have false positives. |
49 bool HasRecordings() const { return has_any_recordings_; } | 49 bool HasRecordings() const { return has_any_recordings_; } |
50 | 50 |
51 // If this pile has ever contained any recordings with text. | 51 // If this pile has ever contained any recordings with text. |
52 bool has_text() const { return has_text_; } | 52 bool has_text() const { return has_text_; } |
53 | 53 |
| 54 bool is_solid_color() const { return is_solid_color_; } |
| 55 SkColor solid_color() const { return solid_color_; } |
| 56 |
54 void set_is_mask(bool is_mask) { is_mask_ = is_mask; } | 57 void set_is_mask(bool is_mask) { is_mask_ = is_mask; } |
55 bool is_mask() const { return is_mask_; } | 58 bool is_mask() const { return is_mask_; } |
56 | 59 |
57 static void ComputeTileGridInfo(const gfx::Size& tile_grid_size, | 60 static void ComputeTileGridInfo(const gfx::Size& tile_grid_size, |
58 SkTileGridFactory::TileGridInfo* info); | 61 SkTileGridFactory::TileGridInfo* info); |
59 | 62 |
60 void SetTileGridSize(const gfx::Size& tile_grid_size); | 63 void SetTileGridSize(const gfx::Size& tile_grid_size); |
61 TilingData& tiling() { return tiling_; } | 64 TilingData& tiling() { return tiling_; } |
62 | 65 |
63 void AsValueInto(base::debug::TracedValue* array) const; | 66 void AsValueInto(base::debug::TracedValue* array) const; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 int slow_down_raster_scale_factor_for_debug_; | 119 int slow_down_raster_scale_factor_for_debug_; |
117 bool contents_opaque_; | 120 bool contents_opaque_; |
118 bool contents_fill_bounds_completely_; | 121 bool contents_fill_bounds_completely_; |
119 bool show_debug_picture_borders_; | 122 bool show_debug_picture_borders_; |
120 bool clear_canvas_with_debug_color_; | 123 bool clear_canvas_with_debug_color_; |
121 // A hint about whether there are any recordings. This may be a false | 124 // A hint about whether there are any recordings. This may be a false |
122 // positive. | 125 // positive. |
123 bool has_any_recordings_; | 126 bool has_any_recordings_; |
124 bool has_text_; | 127 bool has_text_; |
125 bool is_mask_; | 128 bool is_mask_; |
| 129 bool is_solid_color_; |
| 130 SkColor solid_color_; |
126 | 131 |
127 private: | 132 private: |
128 void SetBufferPixels(int buffer_pixels); | 133 void SetBufferPixels(int buffer_pixels); |
129 | 134 |
130 friend class base::RefCounted<PicturePileBase>; | 135 friend class base::RefCounted<PicturePileBase>; |
131 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); | 136 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); |
132 }; | 137 }; |
133 | 138 |
134 } // namespace cc | 139 } // namespace cc |
135 | 140 |
136 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_ | 141 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_ |
OLD | NEW |