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