aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/rectangletexture.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-04-18 17:12:32 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-18 21:55:10 +0000
commit7da62b9059f3c1d31624a0e4da96ee5f908f9c12 (patch)
treefc57f951a4e8c1900311e8a1ffbdbbaf189715c2 /gm/rectangletexture.cpp
parentb712a85aea212cf5bfe5514a4fefc184545a8d3c (diff)
Plumb GrBackendTexture throughout skia.
Bug: skia: Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875 Reviewed-on: https://skia-review.googlesource.com/13645 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'gm/rectangletexture.cpp')
-rw-r--r--gm/rectangletexture.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/gm/rectangletexture.cpp b/gm/rectangletexture.cpp
index 1359d34a69..d4f4552e10 100644
--- a/gm/rectangletexture.cpp
+++ b/gm/rectangletexture.cpp
@@ -11,6 +11,7 @@
#if SK_SUPPORT_GPU
+#include "GrBackendSurface.h"
#include "GrContext.h"
#include "GrGpu.h"
#include "GrTest.h"
@@ -107,13 +108,11 @@ protected:
GrGLTextureInfo info;
info.fID = id;
info.fTarget = TARGET;
- GrBackendTextureDesc desc;
- desc.fConfig = kRGBA_8888_GrPixelConfig;
- desc.fWidth = width;
- desc.fHeight = height;
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
- desc.fTextureHandle = reinterpret_cast<GrBackendObject>(&info);
- if (sk_sp<SkImage> image = SkImage::MakeFromAdoptedTexture(context, desc)) {
+
+ GrBackendTexture rectangleTex(width, height, kRGBA_8888_GrPixelConfig, &info);
+
+ if (sk_sp<SkImage> image = SkImage::MakeFromAdoptedTexture(context, rectangleTex,
+ kTopLeft_GrSurfaceOrigin)) {
return image;
}
GR_GL_CALL(gl, DeleteTextures(1, &id));