aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/WritePixelsTest.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-07-19 18:28:58 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-20 00:21:18 +0000
commitd17f6584df9e48146dac28a1df56fb4978de6ba3 (patch)
treeaff8a4c10de409c9e07c09d936fd9c3b6b32cae3 /tests/WritePixelsTest.cpp
parent22b2d8c5e111825440fa3496be1cf030a5bbafd7 (diff)
Remove GrBackendTextureDesc
Change-Id: I2b123d1782400e97ab2ce2f11e3e3d325a13e6c8 Reviewed-on: https://skia-review.googlesource.com/24748 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/WritePixelsTest.cpp')
-rw-r--r--tests/WritePixelsTest.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index 3aec3e68da..e876c8ff05 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -13,8 +13,10 @@
#include "sk_tool_utils.h"
#if SK_SUPPORT_GPU
+#include "GrBackendSurface.h"
#include "GrContext.h"
#include "GrGpu.h"
+#include "GrTest.h"
#endif
#include <initializer_list>
@@ -429,26 +431,21 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsNonTexture_Gpu, reporter, ctxInfo)
for (auto& origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin }) {
for (int sampleCnt : {0, 4}) {
- GrBackendTextureDesc desc;
- desc.fConfig = kSkia8888_GrPixelConfig;
- desc.fWidth = DEV_W;
- desc.fHeight = DEV_H;
- desc.fFlags = kRenderTarget_GrBackendTextureFlag;
- desc.fSampleCnt = sampleCnt;
- desc.fOrigin = origin;
- desc.fTextureHandle = context->getGpu()->createTestingOnlyBackendTexture(
- nullptr, DEV_W, DEV_H, kSkia8888_GrPixelConfig, true);
- sk_sp<SkSurface> surface(SkSurface::MakeFromBackendTextureAsRenderTarget(context, desc,
- nullptr));
+ auto handle = context->getGpu()->createTestingOnlyBackendTexture(
+ nullptr, DEV_W, DEV_H, kSkia8888_GrPixelConfig, true);
+ GrBackendTexture backendTexture = GrTest::CreateBackendTexture(
+ ctxInfo.backend(), DEV_W, DEV_H, kSkia8888_GrPixelConfig, handle);
+ sk_sp<SkSurface> surface(SkSurface::MakeFromBackendTextureAsRenderTarget(
+ context, backendTexture, origin, sampleCnt, nullptr, nullptr));
if (!surface) {
- context->getGpu()->deleteTestingOnlyBackendTexture(desc.fTextureHandle);
+ context->getGpu()->deleteTestingOnlyBackendTexture(handle);
continue;
}
test_write_pixels(reporter, surface.get());
surface.reset();
- context->getGpu()->deleteTestingOnlyBackendTexture(desc.fTextureHandle);
+ context->getGpu()->deleteTestingOnlyBackendTexture(handle);
}
}
}