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 | 10 |
11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "cc/base/tiling_data.h" | 13 #include "cc/base/tiling_data.h" |
14 #include "cc/resources/recording_source.h" | 14 #include "cc/resources/recording_source.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 class PicturePileImpl; | 17 class PicturePileImpl; |
18 | 18 |
19 class CC_EXPORT PicturePile : public RecordingSource { | 19 class CC_EXPORT PicturePile : public RecordingSource { |
20 public: | 20 public: |
21 PicturePile(); | 21 PicturePile(); |
22 ~PicturePile() override; | 22 ~PicturePile() override; |
23 | 23 |
24 // RecordingSource overrides. | 24 // RecordingSource overrides. |
25 bool UpdateAndExpandInvalidation( | 25 bool UpdateAndExpandInvalidation( |
26 ContentLayerClient* painter, | 26 ContentLayerClient* painter, |
27 Region* invalidation, | 27 Region* invalidation, |
| 28 bool can_use_lcd_text, |
28 const gfx::Size& layer_size, | 29 const gfx::Size& layer_size, |
29 const gfx::Rect& visible_layer_rect, | 30 const gfx::Rect& visible_layer_rect, |
30 int frame_number, | 31 int frame_number, |
31 Picture::RecordingMode recording_mode) override; | 32 Picture::RecordingMode recording_mode) override; |
32 scoped_refptr<RasterSource> CreateRasterSource() const override; | 33 scoped_refptr<RasterSource> CreateRasterSource() const 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 SetSlowdownRasterScaleFactor(int factor) override; | 37 void SetSlowdownRasterScaleFactor(int factor) override; |
37 bool IsSuitableForGpuRasterization() const override; | 38 bool IsSuitableForGpuRasterization() const override; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 PictureMap picture_map_; | 88 PictureMap picture_map_; |
88 TilingData tiling_; | 89 TilingData tiling_; |
89 | 90 |
90 // If non-empty, all pictures tiles inside this rect are recorded. There may | 91 // If non-empty, all pictures tiles inside this rect are recorded. There may |
91 // be recordings outside this rect, but everything inside the rect is | 92 // be recordings outside this rect, but everything inside the rect is |
92 // recorded. | 93 // recorded. |
93 gfx::Rect recorded_viewport_; | 94 gfx::Rect recorded_viewport_; |
94 float min_contents_scale_; | 95 float min_contents_scale_; |
95 SkTileGridFactory::TileGridInfo tile_grid_info_; | 96 SkTileGridFactory::TileGridInfo tile_grid_info_; |
96 int slow_down_raster_scale_factor_for_debug_; | 97 int slow_down_raster_scale_factor_for_debug_; |
| 98 bool can_use_lcd_text_; |
97 // A hint about whether there are any recordings. This may be a false | 99 // A hint about whether there are any recordings. This may be a false |
98 // positive. | 100 // positive. |
99 bool has_any_recordings_; | 101 bool has_any_recordings_; |
100 bool is_solid_color_; | 102 bool is_solid_color_; |
101 SkColor solid_color_; | 103 SkColor solid_color_; |
102 int pixel_record_distance_; | 104 int pixel_record_distance_; |
103 | 105 |
104 private: | 106 private: |
105 friend class PicturePileImpl; | 107 friend class PicturePileImpl; |
106 | 108 |
107 void DetermineIfSolidColor(); | 109 void DetermineIfSolidColor(); |
108 void SetBufferPixels(int buffer_pixels); | 110 void SetBufferPixels(int buffer_pixels); |
109 | 111 |
110 bool is_suitable_for_gpu_rasterization_; | 112 bool is_suitable_for_gpu_rasterization_; |
111 | 113 |
112 DISALLOW_COPY_AND_ASSIGN(PicturePile); | 114 DISALLOW_COPY_AND_ASSIGN(PicturePile); |
113 }; | 115 }; |
114 | 116 |
115 } // namespace cc | 117 } // namespace cc |
116 | 118 |
117 #endif // CC_RESOURCES_PICTURE_PILE_H_ | 119 #endif // CC_RESOURCES_PICTURE_PILE_H_ |
OLD | NEW |