| 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> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 Region* invalidation, | 27 Region* invalidation, |
| 28 bool can_use_lcd_text, | 28 bool can_use_lcd_text, |
| 29 const gfx::Size& layer_size, | 29 const gfx::Size& layer_size, |
| 30 const gfx::Rect& visible_layer_rect, | 30 const gfx::Rect& visible_layer_rect, |
| 31 int frame_number, | 31 int frame_number, |
| 32 RecordingMode recording_mode) override; | 32 RecordingMode recording_mode) override; |
| 33 scoped_refptr<RasterSource> CreateRasterSource() const override; | 33 scoped_refptr<RasterSource> CreateRasterSource() const override; |
| 34 gfx::Size GetSize() const final; | 34 gfx::Size GetSize() const final; |
| 35 void SetEmptyBounds() override; | 35 void SetEmptyBounds() override; |
| 36 void SetSlowdownRasterScaleFactor(int factor) override; | 36 void SetSlowdownRasterScaleFactor(int factor) override; |
| 37 void SetBackgroundColor(SkColor background_color) override; |
| 38 void SetRequiresClear(bool requires_clear) override; |
| 37 bool IsSuitableForGpuRasterization() const override; | 39 bool IsSuitableForGpuRasterization() const override; |
| 38 void SetUnsuitableForGpuRasterizationForTesting() override; | 40 void SetUnsuitableForGpuRasterizationForTesting() override; |
| 39 gfx::Size GetTileGridSizeForTesting() const override; | 41 gfx::Size GetTileGridSizeForTesting() const override; |
| 40 | 42 |
| 41 protected: | 43 protected: |
| 42 class CC_EXPORT PictureInfo { | 44 class CC_EXPORT PictureInfo { |
| 43 public: | 45 public: |
| 44 enum { INVALIDATION_FRAMES_TRACKED = 32 }; | 46 enum { INVALIDATION_FRAMES_TRACKED = 32 }; |
| 45 | 47 |
| 46 PictureInfo(); | 48 PictureInfo(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // be recordings outside this rect, but everything inside the rect is | 92 // be recordings outside this rect, but everything inside the rect is |
| 91 // recorded. | 93 // recorded. |
| 92 gfx::Rect recorded_viewport_; | 94 gfx::Rect recorded_viewport_; |
| 93 float min_contents_scale_; | 95 float min_contents_scale_; |
| 94 gfx::Size tile_grid_size_; | 96 gfx::Size tile_grid_size_; |
| 95 int slow_down_raster_scale_factor_for_debug_; | 97 int slow_down_raster_scale_factor_for_debug_; |
| 96 bool can_use_lcd_text_; | 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_; |
| 102 bool clear_canvas_with_debug_color_; |
| 103 bool requires_clear_; |
| 100 bool is_solid_color_; | 104 bool is_solid_color_; |
| 101 SkColor solid_color_; | 105 SkColor solid_color_; |
| 106 SkColor background_color_; |
| 102 int pixel_record_distance_; | 107 int pixel_record_distance_; |
| 103 | 108 |
| 104 private: | 109 private: |
| 105 friend class PicturePileImpl; | 110 friend class PicturePileImpl; |
| 106 | 111 |
| 107 void CreatePictures(ContentLayerClient* painter, | 112 void CreatePictures(ContentLayerClient* painter, |
| 108 RecordingMode recording_mode, | 113 RecordingMode recording_mode, |
| 109 const std::vector<gfx::Rect>& record_rects); | 114 const std::vector<gfx::Rect>& record_rects); |
| 110 void GetInvalidTileRects(const gfx::Rect& interest_rect, | 115 void GetInvalidTileRects(const gfx::Rect& interest_rect, |
| 111 Region* invalidation, | 116 Region* invalidation, |
| 112 const gfx::Rect& visible_layer_rect, | 117 const gfx::Rect& visible_layer_rect, |
| 113 int frame_number, | 118 int frame_number, |
| 114 std::vector<gfx::Rect>* invalid_tiles); | 119 std::vector<gfx::Rect>* invalid_tiles); |
| 115 bool ApplyInvalidationAndResize(const gfx::Rect& interest_rect, | 120 bool ApplyInvalidationAndResize(const gfx::Rect& interest_rect, |
| 116 Region* invalidation, | 121 Region* invalidation, |
| 117 const gfx::Size& layer_size, | 122 const gfx::Size& layer_size, |
| 118 int frame_number, | 123 int frame_number, |
| 119 bool can_use_lcd_text_changed); | 124 bool can_use_lcd_text_changed); |
| 120 void DetermineIfSolidColor(); | 125 void DetermineIfSolidColor(); |
| 121 void SetBufferPixels(int buffer_pixels); | 126 void SetBufferPixels(int buffer_pixels); |
| 122 | 127 |
| 123 bool is_suitable_for_gpu_rasterization_; | 128 bool is_suitable_for_gpu_rasterization_; |
| 124 | 129 |
| 125 DISALLOW_COPY_AND_ASSIGN(PicturePile); | 130 DISALLOW_COPY_AND_ASSIGN(PicturePile); |
| 126 }; | 131 }; |
| 127 | 132 |
| 128 } // namespace cc | 133 } // namespace cc |
| 129 | 134 |
| 130 #endif // CC_RESOURCES_PICTURE_PILE_H_ | 135 #endif // CC_RESOURCES_PICTURE_PILE_H_ |
| OLD | NEW |