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>
2 files changed