| 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_RESOURCES_RECORDING_SOURCE_H_ | 5 #ifndef CC_RESOURCES_RECORDING_SOURCE_H_ |
| 6 #define CC_RESOURCES_RECORDING_SOURCE_H_ | 6 #define CC_RESOURCES_RECORDING_SOURCE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" |
| 8 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 9 #include "cc/resources/picture.h" | |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 class ContentLayerClient; | 15 class ContentLayerClient; |
| 16 class Region; | 16 class Region; |
| 17 class RasterSource; | 17 class RasterSource; |
| 18 | 18 |
| 19 class CC_EXPORT RecordingSource { | 19 class CC_EXPORT RecordingSource { |
| 20 public: | 20 public: |
| 21 enum RecordingMode { |
| 22 RECORD_NORMALLY, |
| 23 RECORD_WITH_SK_NULL_CANVAS, |
| 24 RECORD_WITH_PAINTING_DISABLED, |
| 25 RECORD_WITH_CACHING_DISABLED, |
| 26 RECORDING_MODE_COUNT, // Must be the last entry. |
| 27 }; |
| 28 |
| 21 virtual ~RecordingSource() {} | 29 virtual ~RecordingSource() {} |
| 22 // Re-record parts of the picture that are invalid. | 30 // Re-record parts of the picture that are invalid. |
| 23 // Invalidations are in layer space, and will be expanded to cover everything | 31 // Invalidations are in layer space, and will be expanded to cover everything |
| 24 // that was either recorded/changed or that has no recording, leaving out only | 32 // that was either recorded/changed or that has no recording, leaving out only |
| 25 // pieces that we had a recording for and it was not changed. | 33 // pieces that we had a recording for and it was not changed. |
| 26 // Return true iff the pile was modified. | 34 // Return true iff the pile was modified. |
| 27 virtual bool UpdateAndExpandInvalidation( | 35 virtual bool UpdateAndExpandInvalidation(ContentLayerClient* painter, |
| 28 ContentLayerClient* painter, | 36 Region* invalidation, |
| 29 Region* invalidation, | 37 bool can_use_lcd_text, |
| 30 bool can_use_lcd_text, | 38 const gfx::Size& layer_size, |
| 31 const gfx::Size& layer_size, | 39 const gfx::Rect& visible_layer_rect, |
| 32 const gfx::Rect& visible_layer_rect, | 40 int frame_number, |
| 33 int frame_number, | 41 RecordingMode recording_mode) = 0; |
| 34 Picture::RecordingMode recording_mode) = 0; | |
| 35 | 42 |
| 36 virtual scoped_refptr<RasterSource> CreateRasterSource() const = 0; | 43 virtual scoped_refptr<RasterSource> CreateRasterSource() const = 0; |
| 37 | 44 |
| 38 virtual gfx::Size GetSize() const = 0; | 45 virtual gfx::Size GetSize() const = 0; |
| 39 virtual void SetEmptyBounds() = 0; | 46 virtual void SetEmptyBounds() = 0; |
| 40 virtual void SetSlowdownRasterScaleFactor(int factor) = 0; | 47 virtual void SetSlowdownRasterScaleFactor(int factor) = 0; |
| 41 virtual bool IsSuitableForGpuRasterization() const = 0; | 48 virtual bool IsSuitableForGpuRasterization() const = 0; |
| 42 | 49 |
| 43 // TODO(hendrikw): Figure out how to remove this. | 50 // TODO(hendrikw): Figure out how to remove this. |
| 44 virtual void SetUnsuitableForGpuRasterizationForTesting() = 0; | 51 virtual void SetUnsuitableForGpuRasterizationForTesting() = 0; |
| 45 virtual gfx::Size GetTileGridSizeForTesting() const = 0; | 52 virtual gfx::Size GetTileGridSizeForTesting() const = 0; |
| 46 }; | 53 }; |
| 47 | 54 |
| 48 } // namespace cc | 55 } // namespace cc |
| 49 | 56 |
| 50 #endif // CC_RESOURCES_RECORDING_SOURCE_H_ | 57 #endif // CC_RESOURCES_RECORDING_SOURCE_H_ |
| OLD | NEW |