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_RASTER_SOURCE_H_ | 5 #ifndef CC_RESOURCES_RASTER_SOURCE_H_ |
6 #define CC_RESOURCES_RASTER_SOURCE_H_ | 6 #define CC_RESOURCES_RASTER_SOURCE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
12 #include "cc/debug/traced_value.h" | 12 #include "cc/debug/traced_value.h" |
13 #include "skia/ext/refptr.h" | 13 #include "skia/ext/refptr.h" |
14 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
15 | 15 |
16 class SkCanvas; | 16 class SkCanvas; |
17 class SkPicture; | 17 class SkPicture; |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 | 20 |
| 21 class Picture; |
| 22 |
21 class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> { | 23 class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> { |
22 public: | 24 public: |
23 struct CC_EXPORT SolidColorAnalysis { | 25 struct CC_EXPORT SolidColorAnalysis { |
24 SolidColorAnalysis() | 26 SolidColorAnalysis() |
25 : is_solid_color(false), solid_color(SK_ColorTRANSPARENT) {} | 27 : is_solid_color(false), solid_color(SK_ColorTRANSPARENT) {} |
26 ~SolidColorAnalysis() {} | 28 ~SolidColorAnalysis() {} |
27 | 29 |
28 bool is_solid_color; | 30 bool is_solid_color; |
29 SkColor solid_color; | 31 SkColor solid_color; |
30 }; | 32 }; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 virtual void SetRequiresClear(bool requires_clear) = 0; | 87 virtual void SetRequiresClear(bool requires_clear) = 0; |
86 | 88 |
87 // Return true iff this raster source would benefit from using distance | 89 // Return true iff this raster source would benefit from using distance |
88 // field text. | 90 // field text. |
89 virtual bool ShouldAttemptToUseDistanceFieldText() const = 0; | 91 virtual bool ShouldAttemptToUseDistanceFieldText() const = 0; |
90 | 92 |
91 // Tracing functionality. | 93 // Tracing functionality. |
92 virtual void DidBeginTracing() = 0; | 94 virtual void DidBeginTracing() = 0; |
93 virtual void AsValueInto(base::debug::TracedValue* array) const = 0; | 95 virtual void AsValueInto(base::debug::TracedValue* array) const = 0; |
94 virtual skia::RefPtr<SkPicture> GetFlattenedPicture() = 0; | 96 virtual skia::RefPtr<SkPicture> GetFlattenedPicture() = 0; |
| 97 virtual size_t GetPictureMemoryUsage() const = 0; |
95 | 98 |
96 // Return true if LCD anti-aliasing may be used when rastering text. | 99 // Return true if LCD anti-aliasing may be used when rastering text. |
97 virtual bool CanUseLCDText() const = 0; | 100 virtual bool CanUseLCDText() const = 0; |
98 | 101 |
99 protected: | 102 protected: |
100 friend class base::RefCountedThreadSafe<RasterSource>; | 103 friend class base::RefCountedThreadSafe<RasterSource>; |
101 | 104 |
102 RasterSource() {} | 105 RasterSource() {} |
103 virtual ~RasterSource() {} | 106 virtual ~RasterSource() {} |
104 | 107 |
105 private: | 108 private: |
106 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 109 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
107 }; | 110 }; |
108 | 111 |
109 } // namespace cc | 112 } // namespace cc |
110 | 113 |
111 #endif // CC_RESOURCES_RASTER_SOURCE_H_ | 114 #endif // CC_RESOURCES_RASTER_SOURCE_H_ |
OLD | NEW |