OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkImage_DEFINED | 8 #ifndef SkImage_DEFINED |
9 #define SkImage_DEFINED | 9 #define SkImage_DEFINED |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 * If a subset is specified, it must be contained within the encoded data's bounds. | 82 * If a subset is specified, it must be contained within the encoded data's bounds. |
83 */ | 83 */ |
84 static sk_sp<SkImage> MakeFromEncoded(sk_sp<SkData> encoded, const SkIRect* subset = NULL); | 84 static sk_sp<SkImage> MakeFromEncoded(sk_sp<SkData> encoded, const SkIRect* subset = NULL); |
85 | 85 |
86 /** | 86 /** |
87 * Create a new image from the specified descriptor. Note - the caller is r esponsible for | 87 * Create a new image from the specified descriptor. Note - the caller is r esponsible for |
88 * managing the lifetime of the underlying platform texture. | 88 * managing the lifetime of the underlying platform texture. |
89 * | 89 * |
90 * Will return NULL if the specified descriptor is unsupported. | 90 * Will return NULL if the specified descriptor is unsupported. |
91 */ | 91 */ |
92 static sk_sp<SkImage> MakeFromTexture(GrContext* ctx, const GrBackendTexture Desc& desc) { | 92 static sk_sp<SkImage> MakeFromTexture(GrContext* ctx, const GrBackendTexture Desc& desc) { |
robertphillips
2016/07/20 17:25:39
make all these nullptrs ?
| |
93 return MakeFromTexture(ctx, desc, kPremul_SkAlphaType, NULL, NULL); | 93 return MakeFromTexture(ctx, desc, kPremul_SkAlphaType, NULL, NULL, NULL) ; |
94 } | 94 } |
95 | 95 |
96 static sk_sp<SkImage> MakeFromTexture(GrContext* ctx, const GrBackendTexture Desc& de, | 96 static sk_sp<SkImage> MakeFromTexture(GrContext* ctx, const GrBackendTexture Desc& de, |
97 SkAlphaType at) { | 97 SkAlphaType at) { |
98 return MakeFromTexture(ctx, de, at, NULL, NULL); | 98 return MakeFromTexture(ctx, de, at, NULL, NULL, NULL); |
99 } | 99 } |
100 | 100 |
101 typedef void (*TextureReleaseProc)(ReleaseContext); | 101 typedef void (*TextureReleaseProc)(ReleaseContext); |
102 | 102 |
103 /** | 103 /** |
104 * Create a new image from the specified descriptor. The underlying platfor m texture must stay | 104 * Create a new image from the specified descriptor. The underlying platfor m texture must stay |
105 * valid and unaltered until the specified release-proc is invoked, indicat ing that Skia | 105 * valid and unaltered until the specified release-proc is invoked, indicat ing that Skia |
106 * no longer is holding a reference to it. | 106 * no longer is holding a reference to it. |
107 * | 107 * |
108 * Will return NULL if the specified descriptor is unsupported. | 108 * Will return NULL if the specified descriptor is unsupported. |
109 */ | 109 */ |
110 static sk_sp<SkImage> MakeFromTexture(GrContext* ctx, const GrBackendTexture Desc& desc, | |
bsalomon
2016/07/20 17:14:27
Is this used?
Brian Osman
2016/07/20 17:34:05
Looks like three hits: https://cs.chromium.org/sea
| |
111 SkAlphaType at, TextureReleaseProc trp , | |
112 ReleaseContext rc) { | |
113 return MakeFromTexture(ctx, desc, at, NULL, trp, rc); | |
bsalomon
2016/07/20 17:14:27
nullptr
Brian Osman
2016/07/20 17:34:05
Done. (This file had a mix of nullptr and NULL, wa
| |
114 } | |
115 | |
116 /** | |
117 * Create a new image from the specified descriptor. The underlying platform texture must stay | |
118 * valid and unaltered until the specified release-proc is invoked, indicati ng that Skia | |
119 * no longer is holding a reference to it. | |
120 * | |
121 * Will return NULL if the specified descriptor is unsupported. | |
122 */ | |
110 static sk_sp<SkImage> MakeFromTexture(GrContext*, const GrBackendTextureDesc &, SkAlphaType, | 123 static sk_sp<SkImage> MakeFromTexture(GrContext*, const GrBackendTextureDesc &, SkAlphaType, |
111 TextureReleaseProc, ReleaseContext); | 124 sk_sp<SkColorSpace>, TextureReleasePro c, ReleaseContext); |
112 | 125 |
113 /** | 126 /** |
114 * Create a new image from the specified descriptor. Note - Skia will delet e or recycle the | 127 * Create a new image from the specified descriptor. Note - Skia will delet e or recycle the |
115 * texture when the image is released. | 128 * texture when the image is released. |
116 * | 129 * |
117 * Will return NULL if the specified descriptor is unsupported. | 130 * Will return NULL if the specified descriptor is unsupported. |
118 */ | 131 */ |
119 static sk_sp<SkImage> MakeFromAdoptedTexture(GrContext*, const GrBackendText ureDesc&, | 132 static sk_sp<SkImage> MakeFromAdoptedTexture(GrContext*, const GrBackendText ureDesc&, |
120 SkAlphaType = kPremul_SkAlphaTy pe); | 133 SkAlphaType = kPremul_SkAlphaTy pe, |
134 sk_sp<SkColorSpace> = nullptr); | |
121 | 135 |
122 /** | 136 /** |
123 * Create a new image by copying the pixels from the specified y, u, v text ures. The data | 137 * Create a new image by copying the pixels from the specified y, u, v text ures. The data |
124 * from the textures is immediately ingested into the image and the texture s can be modified or | 138 * from the textures is immediately ingested into the image and the texture s can be modified or |
125 * deleted after the function returns. The image will have the dimensions o f the y texture. | 139 * deleted after the function returns. The image will have the dimensions o f the y texture. |
126 */ | 140 */ |
127 static sk_sp<SkImage> MakeFromYUVTexturesCopy(GrContext*, SkYUVColorSpace, | 141 static sk_sp<SkImage> MakeFromYUVTexturesCopy(GrContext*, SkYUVColorSpace, |
128 const GrBackendObject yuvTextu reHandles[3], | 142 const GrBackendObject yuvTextu reHandles[3], |
129 const SkISize yuvSizes[3], | 143 const SkISize yuvSizes[3], |
130 GrSurfaceOrigin); | 144 GrSurfaceOrigin, |
145 sk_sp<SkColorSpace> = nullptr) ; | |
131 | 146 |
132 /** | 147 /** |
133 * Create a new image by copying the pixels from the specified y and uv tex tures. The data | 148 * Create a new image by copying the pixels from the specified y and uv tex tures. The data |
134 * from the textures is immediately ingested into the image and the texture s can be modified or | 149 * from the textures is immediately ingested into the image and the texture s can be modified or |
135 * deleted after the function returns. The image will have the dimensions o f the y texture. | 150 * deleted after the function returns. The image will have the dimensions o f the y texture. |
136 */ | 151 */ |
137 static sk_sp<SkImage> MakeFromNV12TexturesCopy(GrContext*, SkYUVColorSpace, | 152 static sk_sp<SkImage> MakeFromNV12TexturesCopy(GrContext*, SkYUVColorSpace, |
138 const GrBackendObject nv12Tex tureHandles[2], | 153 const GrBackendObject nv12Tex tureHandles[2], |
139 const SkISize nv12Sizes[2], G rSurfaceOrigin); | 154 const SkISize nv12Sizes[2], G rSurfaceOrigin, |
155 sk_sp<SkColorSpace> = nullptr ); | |
140 | 156 |
141 static sk_sp<SkImage> MakeFromPicture(sk_sp<SkPicture>, const SkISize& dimen sions, | 157 static sk_sp<SkImage> MakeFromPicture(sk_sp<SkPicture>, const SkISize& dimen sions, |
142 const SkMatrix*, const SkPaint*); | 158 const SkMatrix*, const SkPaint*); |
143 | 159 |
144 static sk_sp<SkImage> MakeTextureFromPixmap(GrContext*, const SkPixmap&, SkB udgeted budgeted); | 160 static sk_sp<SkImage> MakeTextureFromPixmap(GrContext*, const SkPixmap&, SkB udgeted budgeted); |
145 | 161 |
146 //////////////////////////////////////////////////////////////////////////// /////////////////// | 162 //////////////////////////////////////////////////////////////////////////// /////////////////// |
147 | 163 |
148 int width() const { return fWidth; } | 164 int width() const { return fWidth; } |
149 int height() const { return fHeight; } | 165 int height() const { return fHeight; } |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
456 SkBudgeted); | 472 SkBudgeted); |
457 | 473 |
458 const int fWidth; | 474 const int fWidth; |
459 const int fHeight; | 475 const int fHeight; |
460 const uint32_t fUniqueID; | 476 const uint32_t fUniqueID; |
461 | 477 |
462 typedef SkRefCnt INHERITED; | 478 typedef SkRefCnt INHERITED; |
463 }; | 479 }; |
464 | 480 |
465 #endif | 481 #endif |
OLD | NEW |