| 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 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "cc/base/tiling_data.h" | 14 #include "cc/base/tiling_data.h" |
| 15 #include "cc/resources/recording_source.h" | 15 #include "cc/resources/picture.h" |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 class PicturePileImpl; | 18 class PicturePileImpl; |
| 19 | 19 |
| 20 class CC_EXPORT PicturePile : public RecordingSource { | 20 class CC_EXPORT PicturePile : public RecordingSource { |
| 21 public: | 21 public: |
| 22 PicturePile(float min_contents_scale, const gfx::Size& tile_grid_size); | 22 PicturePile(float min_contents_scale, const gfx::Size& tile_grid_size); |
| 23 ~PicturePile() override; | 23 ~PicturePile() override; |
| 24 | 24 |
| 25 // RecordingSource overrides. | 25 // RecordingSource overrides. |
| 26 bool UpdateAndExpandInvalidation( | 26 bool UpdateAndExpandInvalidation(ContentLayerClient* painter, |
| 27 ContentLayerClient* painter, | 27 Region* invalidation, |
| 28 Region* invalidation, | 28 bool can_use_lcd_text, |
| 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 RecordingMode recording_mode) override; |
| 33 Picture::RecordingMode recording_mode) override; | |
| 34 scoped_refptr<RasterSource> CreateRasterSource() const override; | 33 scoped_refptr<RasterSource> CreateRasterSource() const override; |
| 35 gfx::Size GetSize() const final; | 34 gfx::Size GetSize() const final; |
| 36 void SetEmptyBounds() override; | 35 void SetEmptyBounds() override; |
| 37 void SetSlowdownRasterScaleFactor(int factor) override; | 36 void SetSlowdownRasterScaleFactor(int factor) override; |
| 38 bool IsSuitableForGpuRasterization() const override; | 37 bool IsSuitableForGpuRasterization() const override; |
| 39 void SetUnsuitableForGpuRasterizationForTesting() override; | 38 void SetUnsuitableForGpuRasterizationForTesting() override; |
| 40 gfx::Size GetTileGridSizeForTesting() const override; | 39 gfx::Size GetTileGridSizeForTesting() const override; |
| 41 | 40 |
| 42 protected: | 41 protected: |
| 43 class CC_EXPORT PictureInfo { | 42 class CC_EXPORT PictureInfo { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // positive. | 98 // positive. |
| 100 bool has_any_recordings_; | 99 bool has_any_recordings_; |
| 101 bool is_solid_color_; | 100 bool is_solid_color_; |
| 102 SkColor solid_color_; | 101 SkColor solid_color_; |
| 103 int pixel_record_distance_; | 102 int pixel_record_distance_; |
| 104 | 103 |
| 105 private: | 104 private: |
| 106 friend class PicturePileImpl; | 105 friend class PicturePileImpl; |
| 107 | 106 |
| 108 void CreatePictures(ContentLayerClient* painter, | 107 void CreatePictures(ContentLayerClient* painter, |
| 109 Picture::RecordingMode recording_mode, | 108 RecordingMode recording_mode, |
| 110 const std::vector<gfx::Rect>& record_rects); | 109 const std::vector<gfx::Rect>& record_rects); |
| 111 void GetInvalidTileRects(const gfx::Rect& interest_rect, | 110 void GetInvalidTileRects(const gfx::Rect& interest_rect, |
| 112 Region* invalidation, | 111 Region* invalidation, |
| 113 const gfx::Rect& visible_layer_rect, | 112 const gfx::Rect& visible_layer_rect, |
| 114 int frame_number, | 113 int frame_number, |
| 115 std::vector<gfx::Rect>* invalid_tiles); | 114 std::vector<gfx::Rect>* invalid_tiles); |
| 116 bool ApplyInvalidationAndResize(const gfx::Rect& interest_rect, | 115 bool ApplyInvalidationAndResize(const gfx::Rect& interest_rect, |
| 117 Region* invalidation, | 116 Region* invalidation, |
| 118 const gfx::Size& layer_size, | 117 const gfx::Size& layer_size, |
| 119 int frame_number, | 118 int frame_number, |
| 120 bool can_use_lcd_text_changed); | 119 bool can_use_lcd_text_changed); |
| 121 void DetermineIfSolidColor(); | 120 void DetermineIfSolidColor(); |
| 122 void SetBufferPixels(int buffer_pixels); | 121 void SetBufferPixels(int buffer_pixels); |
| 123 | 122 |
| 124 bool is_suitable_for_gpu_rasterization_; | 123 bool is_suitable_for_gpu_rasterization_; |
| 125 | 124 |
| 126 DISALLOW_COPY_AND_ASSIGN(PicturePile); | 125 DISALLOW_COPY_AND_ASSIGN(PicturePile); |
| 127 }; | 126 }; |
| 128 | 127 |
| 129 } // namespace cc | 128 } // namespace cc |
| 130 | 129 |
| 131 #endif // CC_RESOURCES_PICTURE_PILE_H_ | 130 #endif // CC_RESOURCES_PICTURE_PILE_H_ |
| OLD | NEW |