| 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() const; | 57 virtual scoped_refptr<RasterSource> CreateRasterSource() const; |
| 56 | 58 |
| 57 const DisplayItemList* GetDisplayItemList(); | 59 const DisplayItemList* GetDisplayItemList(); |
| 58 gfx::Rect recorded_viewport() const { return recorded_viewport_; } | 60 gfx::Rect recorded_viewport() const { return recorded_viewport_; } |
| 59 | 61 |
| 60 protected: | 62 protected: |
| 61 gfx::Rect recorded_viewport_; | 63 gfx::Rect recorded_viewport_; |
| 62 gfx::Size size_; | 64 gfx::Size size_; |
| 63 int slow_down_raster_scale_factor_for_debug_; | 65 int slow_down_raster_scale_factor_for_debug_; |
| 64 bool requires_clear_; | 66 bool requires_clear_; |
| 65 bool is_solid_color_; | 67 bool is_solid_color_; |
| 66 bool clear_canvas_with_debug_color_; | 68 bool clear_canvas_with_debug_color_; |
| 67 SkColor solid_color_; | 69 SkColor solid_color_; |
| 68 SkColor background_color_; | 70 SkColor background_color_; |
| 69 scoped_refptr<DisplayItemList> display_list_; | 71 scoped_refptr<DisplayItemList> display_list_; |
| 70 size_t painter_reported_memory_usage_; | 72 size_t painter_reported_memory_usage_; |
| 73 float recording_scale_factor_; |
| 71 | 74 |
| 72 private: | 75 private: |
| 73 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, | 76 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, |
| 74 const gfx::Rect& new_recorded_viewport, | 77 const gfx::Rect& new_recorded_viewport, |
| 75 Region* invalidation); | 78 Region* invalidation); |
| 76 | 79 |
| 77 void FinishDisplayItemListUpdate(); | 80 void FinishDisplayItemListUpdate(); |
| 78 | 81 |
| 79 friend class RasterSource; | 82 friend class RasterSource; |
| 80 | 83 |
| 81 void DetermineIfSolidColor(); | 84 void DetermineIfSolidColor(); |
| 82 | 85 |
| 83 InvalidationRegion invalidation_; | 86 InvalidationRegion invalidation_; |
| 84 | 87 |
| 85 DISALLOW_COPY_AND_ASSIGN(RecordingSource); | 88 DISALLOW_COPY_AND_ASSIGN(RecordingSource); |
| 86 }; | 89 }; |
| 87 | 90 |
| 88 } // namespace cc | 91 } // namespace cc |
| 89 | 92 |
| 90 #endif // CC_LAYERS_RECORDING_SOURCE_H_ | 93 #endif // CC_LAYERS_RECORDING_SOURCE_H_ |
| OLD | NEW |