@@ -252,16 +252,17 @@ class SK_API SkImage : public SkRefCnt {
252252 * If the encoded format is not supported, or subset is outside of the bounds of the decoded
253253 * image, nullptr is returned.
254254 *
255+ * @param direct the GrDirectContext in play
255256 * @param encoded the encoded data
256257 * @param length the number of bytes of encoded data
257258 * @param subset the bounds of the pixels within the decoded image to return. may be null.
258259 * @return created SkImage, or nullptr
259260 */
260- static sk_sp<SkImage> DecodeToTexture (GrContext* ctx , const void * encoded, size_t length ,
261- const SkIRect* subset = nullptr );
262- static sk_sp<SkImage> DecodeToTexture (GrContext* ctx , const sk_sp<SkData>& data,
261+ static sk_sp<SkImage> DecodeToTexture (GrDirectContext* direct , const void * encoded,
262+ size_t length, const SkIRect* subset = nullptr );
263+ static sk_sp<SkImage> DecodeToTexture (GrDirectContext* direct , const sk_sp<SkData>& data,
263264 const SkIRect* subset = nullptr ) {
264- return DecodeToTexture (ctx , data->data (), data->size (), subset);
265+ return DecodeToTexture (direct , data->data (), data->size (), subset);
265266 }
266267
267268 /*
@@ -306,7 +307,7 @@ class SK_API SkImage : public SkRefCnt {
306307 @param isProtected do the contents of 'data' require DRM protection (on Vulkan)?
307308 @return created SkImage, or nullptr
308309 */
309- static sk_sp<SkImage> MakeTextureFromCompressed (GrContext* context ,
310+ static sk_sp<SkImage> MakeTextureFromCompressed (GrDirectContext* direct ,
310311 sk_sp<SkData> data,
311312 int width, int height,
312313 CompressionType type,
@@ -319,11 +320,7 @@ class SK_API SkImage : public SkRefCnt {
319320 int width, int height,
320321 CompressionType type,
321322 GrMipMapped mipMapped = GrMipMapped::kNo ,
322- GrProtected isProtected = GrProtected::kNo ) {
323- return MakeTextureFromCompressed (context, data, width, height, type,
324- mipMapped, isProtected);
325-
326- }
323+ GrProtected isProtected = GrProtected::kNo );
327324
328325 /* * Creates a CPU-backed SkImage from compressed data.
329326
@@ -1224,17 +1221,23 @@ class SK_API SkImage : public SkRefCnt {
12241221 mipMapped is compatible with the backing GPU texture. SkBudgeted is ignored in this case.
12251222
12261223 Returns nullptr if context is nullptr, or if SkImage was created with another
1227- GrContext .
1224+ GrDirectContext .
12281225
1229- @param GrContext GPU context
1230- @param GrMipMapped whether created SkImage texture must allocate mip map levels
1231- @param SkBudgeted whether to count a newly created texture for the returned image
1232- counts against the GrContext's budget.
1233- @return created SkImage, or nullptr
1226+ @param GrDirectContext the GrDirectContext in play, if it exists
1227+ @param GrMipMapped whether created SkImage texture must allocate mip map levels
1228+ @param SkBudgeted whether to count a newly created texture for the returned image
1229+ counts against the GrContext's budget.
1230+ @return created SkImage, or nullptr
12341231 */
1232+ #ifndef SK_IMAGE_MAKE_TEXTURE_IMAGE_ALLOW_GR_CONTEXT
1233+ sk_sp<SkImage> makeTextureImage (GrDirectContext*,
1234+ GrMipMapped = GrMipMapped::kNo ,
1235+ SkBudgeted = SkBudgeted::kYes ) const ;
1236+ #else
12351237 sk_sp<SkImage> makeTextureImage (GrContext*,
12361238 GrMipMapped = GrMipMapped::kNo ,
12371239 SkBudgeted = SkBudgeted::kYes ) const ;
1240+ #endif
12381241
12391242 /* * Returns raster image or lazy image. Copies SkImage backed by GPU texture into
12401243 CPU memory if needed. Returns original SkImage if decoded in raster bitmap,
0 commit comments