aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/imagefromyuvtextures.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-12-13 09:22:45 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-13 15:20:12 +0000
commitc25db637532cd10dde7855d868c0d033e96f61f2 (patch)
tree63a14b28af84ebf7f2bee6eef63db3de6623a811 /gm/imagefromyuvtextures.cpp
parent2a3009931d7bb0f5ca31490c4cf19eef205e4e7a (diff)
Update SkImage::MakeFromYUVTexturesCopy to GrBackendTexture
Change-Id: I7ba030c5d7856309709e892a2b1b625cf74c70b8 Reviewed-on: https://skia-review.googlesource.com/82823 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'gm/imagefromyuvtextures.cpp')
-rw-r--r--gm/imagefromyuvtextures.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/gm/imagefromyuvtextures.cpp b/gm/imagefromyuvtextures.cpp
index 7150669607..72100c2a56 100644
--- a/gm/imagefromyuvtextures.cpp
+++ b/gm/imagefromyuvtextures.cpp
@@ -93,7 +93,7 @@ protected:
fRGBImage = SkImage::MakeRasterCopy(SkPixmap(rgbBmp.info(), rgbColors, rgbBmp.rowBytes()));
}
- void createYUVTextures(GrContext* context, GrBackendObject yuvHandles[3]) {
+ void createYUVTextures(GrContext* context, GrBackendTexture yuvTextures[3]) {
GrGpu* gpu = context->getGpu();
if (!gpu) {
return;
@@ -101,15 +101,16 @@ protected:
for (int i = 0; i < 3; ++i) {
SkASSERT(fYUVBmps[i].width() == SkToInt(fYUVBmps[i].rowBytes()));
- yuvHandles[i] = gpu->createTestingOnlyBackendObject(fYUVBmps[i].getPixels(),
- fYUVBmps[i].width(),
- fYUVBmps[i].height(),
- kAlpha_8_GrPixelConfig);
+ yuvTextures[i] = gpu->createTestingOnlyBackendTexture(fYUVBmps[i].getPixels(),
+ fYUVBmps[i].width(),
+ fYUVBmps[i].height(),
+ kAlpha_8_GrPixelConfig,
+ false, GrMipMapped::kNo);
}
context->resetContext();
}
- void deleteYUVTextures(GrContext* context, const GrBackendObject yuvHandles[3]) {
+ void deleteYUVTextures(GrContext* context, GrBackendTexture yuvTextures[3]) {
GrGpu* gpu = context->getGpu();
if (!gpu) {
@@ -117,7 +118,7 @@ protected:
}
for (int i = 0; i < 3; ++i) {
- gpu->deleteTestingOnlyBackendObject(yuvHandles[i]);
+ gpu->deleteTestingOnlyBackendTexture(&yuvTextures[i]);
}
context->resetContext();
@@ -141,13 +142,13 @@ 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);
+ GrBackendTexture yuvTextures[3];
+ this->createYUVTextures(context, yuvTextures);
images.push_back(SkImage::MakeFromYUVTexturesCopy(context,
static_cast<SkYUVColorSpace>(space),
- yuvHandles, sizes,
+ yuvTextures, sizes,
kTopLeft_GrSurfaceOrigin));
- this->deleteYUVTextures(context, yuvHandles);
+ this->deleteYUVTextures(context, yuvTextures);
}
for (int i = 0; i < images.count(); ++ i) {
SkScalar y = (i + 1) * kPad + i * fYUVBmps[0].height();