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" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 virtual bool CoversRect(const gfx::Rect& content_rect, | 74 virtual bool CoversRect(const gfx::Rect& content_rect, |
75 float contents_scale) const = 0; | 75 float contents_scale) const = 0; |
76 | 76 |
77 // Returns true if this raster source has anything to rasterize. | 77 // Returns true if this raster source has anything to rasterize. |
78 virtual bool HasRecordings() const = 0; | 78 virtual bool HasRecordings() const = 0; |
79 | 79 |
80 // Informs the raster source that it should attempt to use distance field text | 80 // Informs the raster source that it should attempt to use distance field text |
81 // during rasterization. | 81 // during rasterization. |
82 virtual void SetShouldAttemptToUseDistanceFieldText() = 0; | 82 virtual void SetShouldAttemptToUseDistanceFieldText() = 0; |
83 | 83 |
| 84 virtual void SetBackgoundColor(SkColor background_color) = 0; |
| 85 virtual void SetRequiresClear(bool requires_clear) = 0; |
| 86 |
84 // Return true iff this raster source would benefit from using distance | 87 // Return true iff this raster source would benefit from using distance |
85 // field text. | 88 // field text. |
86 virtual bool ShouldAttemptToUseDistanceFieldText() const = 0; | 89 virtual bool ShouldAttemptToUseDistanceFieldText() const = 0; |
87 | 90 |
88 // Tracing functionality. | 91 // Tracing functionality. |
89 virtual void DidBeginTracing() = 0; | 92 virtual void DidBeginTracing() = 0; |
90 virtual void AsValueInto(base::debug::TracedValue* array) const = 0; | 93 virtual void AsValueInto(base::debug::TracedValue* array) const = 0; |
91 virtual skia::RefPtr<SkPicture> GetFlattenedPicture() = 0; | 94 virtual skia::RefPtr<SkPicture> GetFlattenedPicture() = 0; |
92 | 95 |
93 // TODO(vmpstr): This should be a layer property. | |
94 virtual bool IsMask() const = 0; | |
95 | |
96 protected: | 96 protected: |
97 friend class base::RefCountedThreadSafe<RasterSource>; | 97 friend class base::RefCountedThreadSafe<RasterSource>; |
98 | 98 |
99 RasterSource() {} | 99 RasterSource() {} |
100 virtual ~RasterSource() {} | 100 virtual ~RasterSource() {} |
101 | 101 |
102 private: | 102 private: |
103 DISALLOW_COPY_AND_ASSIGN(RasterSource); | 103 DISALLOW_COPY_AND_ASSIGN(RasterSource); |
104 }; | 104 }; |
105 | 105 |
106 } // namespace cc | 106 } // namespace cc |
107 | 107 |
108 #endif // CC_RESOURCES_RASTER_SOURCE_H_ | 108 #endif // CC_RESOURCES_RASTER_SOURCE_H_ |
OLD | NEW |