From 914a36b248ffb538874483d86759254838866dd7 Mon Sep 17 00:00:00 2001 From: Eric Karl Date: Thu, 12 Oct 2017 12:44:50 -0700 Subject: MakeBackendTextureFromSkImage Creates a static function on SkImage which converts the SkImage to a GrBackendTexture. The texture is unowned by Skia, and must be deleted by the caller. Allows for a no-copy / no-conversion fast path if the provided image is unowned (unique()) and texture backed. Change-Id: I8a48f9cc39de792725cd72057d98cd1c4594daab Reviewed-on: https://skia-review.googlesource.com/52440 Reviewed-by: Brian Salomon Commit-Queue: Eric Karl --- include/gpu/GrGpuResource.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/gpu/GrGpuResource.h') diff --git a/include/gpu/GrGpuResource.h b/include/gpu/GrGpuResource.h index 6d28c1231d..70c94c0e55 100644 --- a/include/gpu/GrGpuResource.h +++ b/include/gpu/GrGpuResource.h @@ -91,6 +91,7 @@ protected: bool internalHasPendingIO() const { return SkToBool(fPendingWrites | fPendingReads); } bool internalHasRef() const { return SkToBool(fRefCnt); } + bool internalHasUniqueRef() const { return fRefCnt == 1; } private: friend class GrIORefProxy; // needs to forward on wrapped IO calls -- cgit v1.2.3