| 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 |
| 17 namespace proto { |
| 18 class DisplayListRecordingSource; |
| 19 } |
| 20 |
| 16 class ContentLayerClient; | 21 class ContentLayerClient; |
| 17 class DisplayItemList; | 22 class DisplayItemList; |
| 18 class DisplayListRasterSource; | 23 class DisplayListRasterSource; |
| 19 class Region; | 24 class Region; |
| 20 | 25 |
| 21 class CC_EXPORT DisplayListRecordingSource { | 26 class CC_EXPORT DisplayListRecordingSource { |
| 22 public: | 27 public: |
| 23 // TODO(schenney) Remove RECORD_WITH_SK_NULL_CANVAS when we no longer | 28 // TODO(schenney) Remove RECORD_WITH_SK_NULL_CANVAS when we no longer |
| 24 // support a non-Slimming Paint path. | 29 // support a non-Slimming Paint path. |
| 25 enum RecordingMode { | 30 enum RecordingMode { |
| 26 RECORD_NORMALLY, | 31 RECORD_NORMALLY, |
| 27 RECORD_WITH_SK_NULL_CANVAS, | 32 RECORD_WITH_SK_NULL_CANVAS, |
| 28 RECORD_WITH_PAINTING_DISABLED, | 33 RECORD_WITH_PAINTING_DISABLED, |
| 29 RECORD_WITH_CACHING_DISABLED, | 34 RECORD_WITH_CACHING_DISABLED, |
| 30 RECORD_WITH_CONSTRUCTION_DISABLED, | 35 RECORD_WITH_CONSTRUCTION_DISABLED, |
| 31 RECORDING_MODE_COUNT, // Must be the last entry. | 36 RECORDING_MODE_COUNT, // Must be the last entry. |
| 32 }; | 37 }; |
| 33 | 38 |
| 34 DisplayListRecordingSource(); | 39 DisplayListRecordingSource(); |
| 35 virtual ~DisplayListRecordingSource(); | 40 virtual ~DisplayListRecordingSource(); |
| 36 | 41 |
| 42 void ToProtobuf(proto::DisplayListRecordingSource* proto) const; |
| 43 void FromProtobuf(const proto::DisplayListRecordingSource& proto); |
| 44 |
| 37 bool UpdateAndExpandInvalidation(ContentLayerClient* painter, | 45 bool UpdateAndExpandInvalidation(ContentLayerClient* painter, |
| 38 Region* invalidation, | 46 Region* invalidation, |
| 39 const gfx::Size& layer_size, | 47 const gfx::Size& layer_size, |
| 40 const gfx::Rect& visible_layer_rect, | 48 const gfx::Rect& visible_layer_rect, |
| 41 int frame_number, | 49 int frame_number, |
| 42 RecordingMode recording_mode); | 50 RecordingMode recording_mode); |
| 43 gfx::Size GetSize() const; | 51 gfx::Size GetSize() const; |
| 44 void SetEmptyBounds(); | 52 void SetEmptyBounds(); |
| 45 void SetSlowdownRasterScaleFactor(int factor); | 53 void SetSlowdownRasterScaleFactor(int factor); |
| 46 void SetGenerateDiscardableImagesMetadata(bool generate_metadata); | 54 void SetGenerateDiscardableImagesMetadata(bool generate_metadata); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 friend class DisplayListRasterSource; | 86 friend class DisplayListRasterSource; |
| 79 | 87 |
| 80 void DetermineIfSolidColor(); | 88 void DetermineIfSolidColor(); |
| 81 | 89 |
| 82 DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource); | 90 DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource); |
| 83 }; | 91 }; |
| 84 | 92 |
| 85 } // namespace cc | 93 } // namespace cc |
| 86 | 94 |
| 87 #endif // CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ | 95 #endif // CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ |
| OLD | NEW |