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_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ | 5 #ifndef CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ |
6 #define CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ | 6 #define CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
14 #include "cc/base/invalidation_region.h" | 14 #include "cc/base/invalidation_region.h" |
15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
16 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
17 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 | 20 |
21 namespace proto { | 21 namespace proto { |
22 class DisplayListRecordingSource; | 22 class DisplayListRecordingSource; |
23 } // namespace proto | 23 } // namespace proto |
24 | 24 |
25 class ContentLayerClient; | 25 class ContentLayerClient; |
26 class DisplayItemList; | 26 class DisplayItemList; |
27 class DisplayListRasterSource; | 27 class RasterSource; |
28 class ImageSerializationProcessor; | 28 class ImageSerializationProcessor; |
29 class Region; | 29 class Region; |
30 | 30 |
31 class CC_EXPORT DisplayListRecordingSource { | 31 class CC_EXPORT DisplayListRecordingSource { |
32 public: | 32 public: |
33 // TODO(schenney) Remove RECORD_WITH_SK_NULL_CANVAS when we no longer | 33 // TODO(schenney) Remove RECORD_WITH_SK_NULL_CANVAS when we no longer |
34 // support a non-Slimming Paint path. | 34 // support a non-Slimming Paint path. |
35 enum RecordingMode { | 35 enum RecordingMode { |
36 RECORD_NORMALLY, | 36 RECORD_NORMALLY, |
37 RECORD_WITH_SK_NULL_CANVAS, | 37 RECORD_WITH_SK_NULL_CANVAS, |
(...skipping 22 matching lines...) Expand all Loading... |
60 gfx::Size GetSize() const; | 60 gfx::Size GetSize() const; |
61 void SetEmptyBounds(); | 61 void SetEmptyBounds(); |
62 void SetSlowdownRasterScaleFactor(int factor); | 62 void SetSlowdownRasterScaleFactor(int factor); |
63 void SetGenerateDiscardableImagesMetadata(bool generate_metadata); | 63 void SetGenerateDiscardableImagesMetadata(bool generate_metadata); |
64 void SetBackgroundColor(SkColor background_color); | 64 void SetBackgroundColor(SkColor background_color); |
65 void SetRequiresClear(bool requires_clear); | 65 void SetRequiresClear(bool requires_clear); |
66 | 66 |
67 void SetNeedsDisplayRect(const gfx::Rect& layer_rect); | 67 void SetNeedsDisplayRect(const gfx::Rect& layer_rect); |
68 | 68 |
69 // These functions are virtual for testing. | 69 // These functions are virtual for testing. |
70 virtual scoped_refptr<DisplayListRasterSource> CreateRasterSource( | 70 virtual scoped_refptr<RasterSource> CreateRasterSource( |
71 bool can_use_lcd_text) const; | 71 bool can_use_lcd_text) const; |
72 virtual bool IsSuitableForGpuRasterization() const; | 72 virtual bool IsSuitableForGpuRasterization() const; |
73 | 73 |
74 gfx::Rect recorded_viewport() const { return recorded_viewport_; } | 74 gfx::Rect recorded_viewport() const { return recorded_viewport_; } |
75 | 75 |
76 protected: | 76 protected: |
77 void Clear(); | 77 void Clear(); |
78 | 78 |
79 gfx::Rect recorded_viewport_; | 79 gfx::Rect recorded_viewport_; |
80 gfx::Size size_; | 80 gfx::Size size_; |
81 int slow_down_raster_scale_factor_for_debug_; | 81 int slow_down_raster_scale_factor_for_debug_; |
82 bool generate_discardable_images_metadata_; | 82 bool generate_discardable_images_metadata_; |
83 bool requires_clear_; | 83 bool requires_clear_; |
84 bool is_solid_color_; | 84 bool is_solid_color_; |
85 bool clear_canvas_with_debug_color_; | 85 bool clear_canvas_with_debug_color_; |
86 SkColor solid_color_; | 86 SkColor solid_color_; |
87 SkColor background_color_; | 87 SkColor background_color_; |
88 | 88 |
89 scoped_refptr<DisplayItemList> display_list_; | 89 scoped_refptr<DisplayItemList> display_list_; |
90 size_t painter_reported_memory_usage_; | 90 size_t painter_reported_memory_usage_; |
91 | 91 |
92 private: | 92 private: |
93 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, | 93 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, |
94 const gfx::Rect& new_recorded_viewport, | 94 const gfx::Rect& new_recorded_viewport, |
95 Region* invalidation); | 95 Region* invalidation); |
96 void FinishDisplayItemListUpdate(); | 96 void FinishDisplayItemListUpdate(); |
97 | 97 |
98 friend class DisplayListRasterSource; | 98 friend class RasterSource; |
99 | 99 |
100 void DetermineIfSolidColor(); | 100 void DetermineIfSolidColor(); |
101 | 101 |
102 InvalidationRegion invalidation_; | 102 InvalidationRegion invalidation_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource); | 104 DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace cc | 107 } // namespace cc |
108 | 108 |
109 #endif // CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ | 109 #endif // CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ |
OLD | NEW |