OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_LAYERS_RECORDING_SOURCE_H_ | 5 #ifndef CC_LAYERS_RECORDING_SOURCE_H_ |
6 #define CC_LAYERS_RECORDING_SOURCE_H_ | 6 #define CC_LAYERS_RECORDING_SOURCE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 28 matching lines...) Expand all Loading... |
39 virtual ~RecordingSource(); | 39 virtual ~RecordingSource(); |
40 | 40 |
41 bool UpdateAndExpandInvalidation(Region* invalidation, | 41 bool UpdateAndExpandInvalidation(Region* invalidation, |
42 const gfx::Size& layer_size, | 42 const gfx::Size& layer_size, |
43 const gfx::Rect& new_recorded_viewport); | 43 const gfx::Rect& new_recorded_viewport); |
44 void UpdateDisplayItemList(const scoped_refptr<DisplayItemList>& display_list, | 44 void UpdateDisplayItemList(const scoped_refptr<DisplayItemList>& display_list, |
45 const size_t& painter_reported_memory_usage); | 45 const size_t& painter_reported_memory_usage); |
46 gfx::Size GetSize() const; | 46 gfx::Size GetSize() const; |
47 void SetEmptyBounds(); | 47 void SetEmptyBounds(); |
48 void SetSlowdownRasterScaleFactor(int factor); | 48 void SetSlowdownRasterScaleFactor(int factor); |
49 void SetGenerateDiscardableImagesMetadata(bool generate_metadata); | |
50 void SetBackgroundColor(SkColor background_color); | 49 void SetBackgroundColor(SkColor background_color); |
51 void SetRequiresClear(bool requires_clear); | 50 void SetRequiresClear(bool requires_clear); |
52 | 51 |
53 void SetNeedsDisplayRect(const gfx::Rect& layer_rect); | 52 void SetNeedsDisplayRect(const gfx::Rect& layer_rect); |
54 | 53 |
55 // These functions are virtual for testing. | 54 // These functions are virtual for testing. |
56 virtual scoped_refptr<RasterSource> CreateRasterSource( | 55 virtual scoped_refptr<RasterSource> CreateRasterSource( |
57 bool can_use_lcd_text) const; | 56 bool can_use_lcd_text) const; |
58 | 57 |
59 const DisplayItemList* GetDisplayItemList(); | 58 const DisplayItemList* GetDisplayItemList(); |
60 gfx::Rect recorded_viewport() const { return recorded_viewport_; } | 59 gfx::Rect recorded_viewport() const { return recorded_viewport_; } |
61 | 60 |
62 protected: | 61 protected: |
63 gfx::Rect recorded_viewport_; | 62 gfx::Rect recorded_viewport_; |
64 gfx::Size size_; | 63 gfx::Size size_; |
65 int slow_down_raster_scale_factor_for_debug_; | 64 int slow_down_raster_scale_factor_for_debug_; |
66 bool generate_discardable_images_metadata_; | |
67 bool requires_clear_; | 65 bool requires_clear_; |
68 bool is_solid_color_; | 66 bool is_solid_color_; |
69 bool clear_canvas_with_debug_color_; | 67 bool clear_canvas_with_debug_color_; |
70 SkColor solid_color_; | 68 SkColor solid_color_; |
71 SkColor background_color_; | 69 SkColor background_color_; |
72 scoped_refptr<DisplayItemList> display_list_; | 70 scoped_refptr<DisplayItemList> display_list_; |
73 size_t painter_reported_memory_usage_; | 71 size_t painter_reported_memory_usage_; |
74 | 72 |
75 private: | 73 private: |
76 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, | 74 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, |
77 const gfx::Rect& new_recorded_viewport, | 75 const gfx::Rect& new_recorded_viewport, |
78 Region* invalidation); | 76 Region* invalidation); |
79 | 77 |
80 void FinishDisplayItemListUpdate(); | 78 void FinishDisplayItemListUpdate(); |
81 | 79 |
82 friend class RasterSource; | 80 friend class RasterSource; |
83 | 81 |
84 void DetermineIfSolidColor(); | 82 void DetermineIfSolidColor(); |
85 | 83 |
86 InvalidationRegion invalidation_; | 84 InvalidationRegion invalidation_; |
87 | 85 |
88 DISALLOW_COPY_AND_ASSIGN(RecordingSource); | 86 DISALLOW_COPY_AND_ASSIGN(RecordingSource); |
89 }; | 87 }; |
90 | 88 |
91 } // namespace cc | 89 } // namespace cc |
92 | 90 |
93 #endif // CC_LAYERS_RECORDING_SOURCE_H_ | 91 #endif // CC_LAYERS_RECORDING_SOURCE_H_ |
OLD | NEW |