| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_H_ | 5 #ifndef CC_RESOURCES_PICTURE_PILE_H_ |
| 6 #define CC_RESOURCES_PICTURE_PILE_H_ | 6 #define CC_RESOURCES_PICTURE_PILE_H_ |
| 7 | 7 |
| 8 #include <bitset> | 8 #include <bitset> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "cc/base/tiling_data.h" | 11 #include "cc/base/tiling_data.h" |
| 12 #include "cc/resources/recording_source.h" | 12 #include "cc/resources/recording_source.h" |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 class PicturePileImpl; | 15 class PicturePileImpl; |
| 16 | 16 |
| 17 class CC_EXPORT PicturePile : public RecordingSource { | 17 class CC_EXPORT PicturePile : public RecordingSource { |
| 18 public: | 18 public: |
| 19 PicturePile(); | 19 PicturePile(); |
| 20 ~PicturePile() override; | 20 ~PicturePile() override; |
| 21 | 21 |
| 22 // RecordingSource overrides. | 22 // RecordingSource overrides. |
| 23 bool UpdateAndExpandInvalidation( | 23 bool UpdateAndExpandInvalidation( |
| 24 ContentLayerClient* painter, | 24 ContentLayerClient* painter, |
| 25 Region* invalidation, | 25 Region* invalidation, |
| 26 SkColor background_color, | 26 SkColor background_color, |
| 27 bool contents_opaque, | 27 bool contents_opaque, |
| 28 bool contents_fill_bounds_completely, | 28 bool contents_fill_bounds_completely, |
| 29 bool can_use_lcd_text, |
| 29 const gfx::Size& layer_size, | 30 const gfx::Size& layer_size, |
| 30 const gfx::Rect& visible_layer_rect, | 31 const gfx::Rect& visible_layer_rect, |
| 31 int frame_number, | 32 int frame_number, |
| 32 Picture::RecordingMode recording_mode) override; | 33 Picture::RecordingMode recording_mode) override; |
| 33 gfx::Size GetSize() const final; | 34 gfx::Size GetSize() const final; |
| 34 void SetEmptyBounds() override; | 35 void SetEmptyBounds() override; |
| 35 void SetMinContentsScale(float min_contents_scale) override; | 36 void SetMinContentsScale(float min_contents_scale) override; |
| 36 void SetTileGridSize(const gfx::Size& tile_grid_size) override; | 37 void SetTileGridSize(const gfx::Size& tile_grid_size) override; |
| 37 void SetSlowdownRasterScaleFactor(int factor) override; | 38 void SetSlowdownRasterScaleFactor(int factor) override; |
| 38 void SetIsMask(bool is_mask) override; | 39 void SetIsMask(bool is_mask) override; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // If non-empty, all pictures tiles inside this rect are recorded. There may | 93 // If non-empty, all pictures tiles inside this rect are recorded. There may |
| 93 // be recordings outside this rect, but everything inside the rect is | 94 // be recordings outside this rect, but everything inside the rect is |
| 94 // recorded. | 95 // recorded. |
| 95 gfx::Rect recorded_viewport_; | 96 gfx::Rect recorded_viewport_; |
| 96 float min_contents_scale_; | 97 float min_contents_scale_; |
| 97 SkTileGridFactory::TileGridInfo tile_grid_info_; | 98 SkTileGridFactory::TileGridInfo tile_grid_info_; |
| 98 SkColor background_color_; | 99 SkColor background_color_; |
| 99 int slow_down_raster_scale_factor_for_debug_; | 100 int slow_down_raster_scale_factor_for_debug_; |
| 100 bool contents_opaque_; | 101 bool contents_opaque_; |
| 101 bool contents_fill_bounds_completely_; | 102 bool contents_fill_bounds_completely_; |
| 103 bool can_use_lcd_text_; |
| 102 bool clear_canvas_with_debug_color_; | 104 bool clear_canvas_with_debug_color_; |
| 103 // A hint about whether there are any recordings. This may be a false | 105 // A hint about whether there are any recordings. This may be a false |
| 104 // positive. | 106 // positive. |
| 105 bool has_any_recordings_; | 107 bool has_any_recordings_; |
| 106 bool is_mask_; | 108 bool is_mask_; |
| 107 bool is_solid_color_; | 109 bool is_solid_color_; |
| 108 SkColor solid_color_; | 110 SkColor solid_color_; |
| 109 int pixel_record_distance_; | 111 int pixel_record_distance_; |
| 110 | 112 |
| 111 private: | 113 private: |
| 112 friend class PicturePileImpl; | 114 friend class PicturePileImpl; |
| 113 | 115 |
| 114 void DetermineIfSolidColor(); | 116 void DetermineIfSolidColor(); |
| 115 void SetBufferPixels(int buffer_pixels); | 117 void SetBufferPixels(int buffer_pixels); |
| 116 | 118 |
| 117 bool is_suitable_for_gpu_rasterization_; | 119 bool is_suitable_for_gpu_rasterization_; |
| 118 | 120 |
| 119 DISALLOW_COPY_AND_ASSIGN(PicturePile); | 121 DISALLOW_COPY_AND_ASSIGN(PicturePile); |
| 120 }; | 122 }; |
| 121 | 123 |
| 122 } // namespace cc | 124 } // namespace cc |
| 123 | 125 |
| 124 #endif // CC_RESOURCES_PICTURE_PILE_H_ | 126 #endif // CC_RESOURCES_PICTURE_PILE_H_ |
| OLD | NEW |