OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file | 5 * found in the LICENSE file |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkSpecialImage_DEFINED | 8 #ifndef SkSpecialImage_DEFINED |
9 #define SkSpecialImage_DEFINED | 9 #define SkSpecialImage_DEFINED |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 typedef void(*RasterReleaseProc)(void* pixels, ReleaseContext); | 46 typedef void(*RasterReleaseProc)(void* pixels, ReleaseContext); |
47 | 47 |
48 const SkSurfaceProps& props() const { return fProps; } | 48 const SkSurfaceProps& props() const { return fProps; } |
49 | 49 |
50 int width() const { return fSubset.width(); } | 50 int width() const { return fSubset.width(); } |
51 int height() const { return fSubset.height(); } | 51 int height() const { return fSubset.height(); } |
52 const SkIRect& subset() const { return fSubset; } | 52 const SkIRect& subset() const { return fSubset; } |
53 SkColorSpace* getColorSpace() const; | 53 SkColorSpace* getColorSpace() const; |
54 | 54 |
55 uint32_t uniqueID() const { return fUniqueID; } | 55 uint32_t uniqueID() const { return fUniqueID; } |
56 virtual bool isOpaque() const { return false; } | 56 virtual SkAlphaType alphaType() const = 0; |
57 virtual size_t getSize() const = 0; | 57 virtual size_t getSize() const = 0; |
58 | 58 |
59 /** | 59 /** |
60 * Ensures that a special image is backed by a texture (when GrContext is n
on-null). If no | 60 * Ensures that a special image is backed by a texture (when GrContext is n
on-null). If no |
61 * transformation is required, the returned image may be the same as this s
pecial image. | 61 * transformation is required, the returned image may be the same as this s
pecial image. |
62 * If this special image is from a different GrContext, this will fail. | 62 * If this special image is from a different GrContext, this will fail. |
63 */ | 63 */ |
64 sk_sp<SkSpecialImage> makeTextureImage(GrContext*); | 64 sk_sp<SkSpecialImage> makeTextureImage(GrContext*); |
65 | 65 |
66 /** | 66 /** |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 private: | 141 private: |
142 const SkSurfaceProps fProps; | 142 const SkSurfaceProps fProps; |
143 const SkIRect fSubset; | 143 const SkIRect fSubset; |
144 const uint32_t fUniqueID; | 144 const uint32_t fUniqueID; |
145 | 145 |
146 typedef SkRefCnt INHERITED; | 146 typedef SkRefCnt INHERITED; |
147 }; | 147 }; |
148 | 148 |
149 #endif | 149 #endif |
OLD | NEW |