aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAHardwareBufferImageGenerator.h
diff options
context:
space:
mode:
authorGravatar Stan Iliev <stani@google.com>2017-06-28 13:24:41 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-28 17:56:46 +0000
commitdbba55de7026c0ffbf1eff057d7bf87c19ec80d1 (patch)
tree0ef2df8e5568aa1dd558cd63836b049ff40d9cae /src/gpu/GrAHardwareBufferImageGenerator.h
parentc2d207603edbbd3809d5144fe4a048a2ad774910 (diff)
Cache GrTexture in GrAHardwareBufferImageGenerator
Cache last GrTexture needed by onGenerateTexture. Make sure GrTexture is destroyed by the thread that owns its GrContext. This CL avoids frequent eglDestroyImageKHR calls, which can take more than 7ms. Bug: skia: Change-Id: Ic8472e7e4c55c0f559d96e16845054dc54ec8efa Reviewed-on: https://skia-review.googlesource.com/20989 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Stan Iliev <stani@google.com>
Diffstat (limited to 'src/gpu/GrAHardwareBufferImageGenerator.h')
-rw-r--r--src/gpu/GrAHardwareBufferImageGenerator.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gpu/GrAHardwareBufferImageGenerator.h b/src/gpu/GrAHardwareBufferImageGenerator.h
index e758138507..f23738b9c5 100644
--- a/src/gpu/GrAHardwareBufferImageGenerator.h
+++ b/src/gpu/GrAHardwareBufferImageGenerator.h
@@ -41,10 +41,14 @@ protected:
private:
GrAHardwareBufferImageGenerator(const SkImageInfo&, AHardwareBuffer*, SkAlphaType);
+ sk_sp<GrTextureProxy> makeProxy(GrContext* context);
+ void clear();
static void deleteImageTexture(void* ctx);
AHardwareBuffer* fGraphicBuffer;
+ GrTexture* fOriginalTexture = nullptr;
+ uint32_t fOwningContextID;
typedef SkImageGenerator INHERITED;
};