aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/imagefromyuvtextures.cpp
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2016-05-13 11:30:37 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-13 11:30:37 -0700
commitb2df0c2702329be6380a943d548e7377a51d8565 (patch)
treea5eba5adc391c21100069f6952357c9a90751d32 /gm/imagefromyuvtextures.cpp
parent17bf82052f8916c62848c5a3c1d600062bbd8c30 (diff)
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
Diffstat (limited to 'gm/imagefromyuvtextures.cpp')
-rw-r--r--gm/imagefromyuvtextures.cpp6
1 files changed, 3 insertions, 3 deletions
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<sk_sp<SkImage>> 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<SkYUVColorSpace>(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;