| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 SetBackgroundColor(SkColor background_color); | 49 void SetBackgroundColor(SkColor background_color); |
| 50 void SetRequiresClear(bool requires_clear); | 50 void SetRequiresClear(bool requires_clear); |
| 51 | 51 |
| 52 void SetNeedsDisplayRect(const gfx::Rect& layer_rect); | 52 void SetNeedsDisplayRect(const gfx::Rect& layer_rect); |
| 53 | 53 |
| 54 void SetRecordingScaleFactor(float recording_scale_factor); |
| 55 |
| 54 // These functions are virtual for testing. | 56 // These functions are virtual for testing. |
| 55 virtual scoped_refptr<RasterSource> CreateRasterSource( | 57 virtual scoped_refptr<RasterSource> CreateRasterSource( |
| 56 bool can_use_lcd_text) const; | 58 bool can_use_lcd_text) const; |
| 57 | 59 |
| 58 const DisplayItemList* GetDisplayItemList(); | 60 const DisplayItemList* GetDisplayItemList(); |
| 59 gfx::Rect recorded_viewport() const { return recorded_viewport_; } | 61 gfx::Rect recorded_viewport() const { return recorded_viewport_; } |
| 60 | 62 |
| 61 protected: | 63 protected: |
| 62 gfx::Rect recorded_viewport_; | 64 gfx::Rect recorded_viewport_; |
| 63 gfx::Size size_; | 65 gfx::Size size_; |
| 64 int slow_down_raster_scale_factor_for_debug_; | 66 int slow_down_raster_scale_factor_for_debug_; |
| 65 bool requires_clear_; | 67 bool requires_clear_; |
| 66 bool is_solid_color_; | 68 bool is_solid_color_; |
| 67 bool clear_canvas_with_debug_color_; | 69 bool clear_canvas_with_debug_color_; |
| 68 SkColor solid_color_; | 70 SkColor solid_color_; |
| 69 SkColor background_color_; | 71 SkColor background_color_; |
| 70 scoped_refptr<DisplayItemList> display_list_; | 72 scoped_refptr<DisplayItemList> display_list_; |
| 71 size_t painter_reported_memory_usage_; | 73 size_t painter_reported_memory_usage_; |
| 74 float recording_scale_factor_; |
| 72 | 75 |
| 73 private: | 76 private: |
| 74 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, | 77 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, |
| 75 const gfx::Rect& new_recorded_viewport, | 78 const gfx::Rect& new_recorded_viewport, |
| 76 Region* invalidation); | 79 Region* invalidation); |
| 77 | 80 |
| 78 void FinishDisplayItemListUpdate(); | 81 void FinishDisplayItemListUpdate(); |
| 79 | 82 |
| 80 friend class RasterSource; | 83 friend class RasterSource; |
| 81 | 84 |
| 82 void DetermineIfSolidColor(); | 85 void DetermineIfSolidColor(); |
| 83 | 86 |
| 84 InvalidationRegion invalidation_; | 87 InvalidationRegion invalidation_; |
| 85 | 88 |
| 86 DISALLOW_COPY_AND_ASSIGN(RecordingSource); | 89 DISALLOW_COPY_AND_ASSIGN(RecordingSource); |
| 87 }; | 90 }; |
| 88 | 91 |
| 89 } // namespace cc | 92 } // namespace cc |
| 90 | 93 |
| 91 #endif // CC_LAYERS_RECORDING_SOURCE_H_ | 94 #endif // CC_LAYERS_RECORDING_SOURCE_H_ |
| OLD | NEW |