From b2df0c2702329be6380a943d548e7377a51d8565 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Fri, 13 May 2016 11:30:37 -0700 Subject: Refactor Vulkan image, texture, RTs so that create and getter handles match. This allows allows us to track and notify clients when either side changes and image layout. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974983002 Review-Url: https://codereview.chromium.org/1974983002 --- gm/imagefromyuvtextures.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gm/imagefromyuvtextures.cpp') diff --git a/gm/imagefromyuvtextures.cpp b/gm/imagefromyuvtextures.cpp index a34ec6e513..5fa55da388 100644 --- a/gm/imagefromyuvtextures.cpp +++ b/gm/imagefromyuvtextures.cpp @@ -129,8 +129,6 @@ protected: return; } - GrBackendObject yuvHandles[3]; - this->createYUVTextures(context, yuvHandles); static const SkScalar kPad = 10.f; @@ -142,12 +140,14 @@ protected: SkTArray> images; images.push_back(fRGBImage); for (int space = kJPEG_SkYUVColorSpace; space <= kLastEnum_SkYUVColorSpace; ++space) { + GrBackendObject yuvHandles[3]; + this->createYUVTextures(context, yuvHandles); images.push_back(SkImage::MakeFromYUVTexturesCopy(context, static_cast(space), yuvHandles, sizes, kTopLeft_GrSurfaceOrigin)); + this->deleteYUVTextures(context, yuvHandles); } - this->deleteYUVTextures(context, yuvHandles); for (int i = 0; i < images.count(); ++ i) { SkScalar y = (i + 1) * kPad + i * fYUVBmps[0].height(); SkScalar x = kPad; -- cgit v1.2.3