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 --- src/gpu/gl/GrGLTexture.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gpu/gl/GrGLTexture.h') diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h index bb46d8d9b6..dfce602bf1 100644 --- a/src/gpu/gl/GrGLTexture.h +++ b/src/gpu/gl/GrGLTexture.h @@ -85,6 +85,8 @@ protected: void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, const SkString& dumpName) const override; + bool onStealBackendTexture(GrBackendTexture*, SkImage::BackendTextureReleaseProc*) override; + private: void invokeReleaseProc() { if (fReleaseProc) { -- cgit v1.2.3