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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 class ContentLayerClient; | 16 class ContentLayerClient; |
17 class DisplayItemList; | 17 class DisplayItemList; |
18 class DisplayListRasterSource; | 18 class DisplayListRasterSource; |
19 class RasterSource; | |
20 class Region; | 19 class Region; |
21 | 20 |
22 class CC_EXPORT DisplayListRecordingSource { | 21 class CC_EXPORT DisplayListRecordingSource { |
23 public: | 22 public: |
24 // TODO(schenney) Remove RECORD_WITH_SK_NULL_CANVAS when we no longer | 23 // TODO(schenney) Remove RECORD_WITH_SK_NULL_CANVAS when we no longer |
25 // support a non-Slimming Paint path. | 24 // support a non-Slimming Paint path. |
26 enum RecordingMode { | 25 enum RecordingMode { |
27 RECORD_NORMALLY, | 26 RECORD_NORMALLY, |
28 RECORD_WITH_SK_NULL_CANVAS, | 27 RECORD_WITH_SK_NULL_CANVAS, |
29 RECORD_WITH_PAINTING_DISABLED, | 28 RECORD_WITH_PAINTING_DISABLED, |
(...skipping 12 matching lines...) Expand all Loading... |
42 int frame_number, | 41 int frame_number, |
43 RecordingMode recording_mode); | 42 RecordingMode recording_mode); |
44 gfx::Size GetSize() const; | 43 gfx::Size GetSize() const; |
45 void SetEmptyBounds(); | 44 void SetEmptyBounds(); |
46 void SetSlowdownRasterScaleFactor(int factor); | 45 void SetSlowdownRasterScaleFactor(int factor); |
47 void SetGenerateDiscardableImagesMetadata(bool generate_metadata); | 46 void SetGenerateDiscardableImagesMetadata(bool generate_metadata); |
48 void SetBackgroundColor(SkColor background_color); | 47 void SetBackgroundColor(SkColor background_color); |
49 void SetRequiresClear(bool requires_clear); | 48 void SetRequiresClear(bool requires_clear); |
50 | 49 |
51 // These functions are virtual for testing. | 50 // These functions are virtual for testing. |
52 virtual scoped_refptr<RasterSource> CreateRasterSource( | 51 virtual scoped_refptr<DisplayListRasterSource> CreateRasterSource( |
53 bool can_use_lcd_text) const; | 52 bool can_use_lcd_text) const; |
54 virtual bool IsSuitableForGpuRasterization() const; | 53 virtual bool IsSuitableForGpuRasterization() const; |
55 | 54 |
56 // Returns true if the new recorded viewport exposes enough new area to be | 55 // Returns true if the new recorded viewport exposes enough new area to be |
57 // worth re-recording. | 56 // worth re-recording. |
58 static bool ExposesEnoughNewArea( | 57 static bool ExposesEnoughNewArea( |
59 const gfx::Rect& current_recorded_viewport, | 58 const gfx::Rect& current_recorded_viewport, |
60 const gfx::Rect& potential_new_recorded_viewport, | 59 const gfx::Rect& potential_new_recorded_viewport, |
61 const gfx::Size& layer_size); | 60 const gfx::Size& layer_size); |
62 | 61 |
(...skipping 20 matching lines...) Expand all Loading... |
83 friend class DisplayListRasterSource; | 82 friend class DisplayListRasterSource; |
84 | 83 |
85 void DetermineIfSolidColor(); | 84 void DetermineIfSolidColor(); |
86 | 85 |
87 DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource); | 86 DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource); |
88 }; | 87 }; |
89 | 88 |
90 } // namespace cc | 89 } // namespace cc |
91 | 90 |
92 #endif // CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ | 91 #endif // CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ |
OLD | NEW |