aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ReadWriteAlphaTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ReadWriteAlphaTest.cpp')
-rw-r--r--tests/ReadWriteAlphaTest.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp
index 1f235fd97a..811ce5840b 100644
--- a/tests/ReadWriteAlphaTest.cpp
+++ b/tests/ReadWriteAlphaTest.cpp
@@ -11,7 +11,8 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
-#include "SkGpuDevice.h"
+#include "SkCanvas.h"
+#include "SkSurface.h"
// This was made indivisible by 4 to ensure we test setting GL_PACK_ALIGNMENT properly.
static const int X_SIZE = 13;
@@ -92,10 +93,8 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) {
// Now try writing on the single channel texture (if we could create as a RT).
if (texture->asRenderTarget()) {
- SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType);
- SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(
- texture->asRenderTarget(), &props, SkGpuDevice::kUninit_InitContents));
- SkCanvas canvas(device);
+ sk_sp<SkSurface> surf(SkSurface::MakeRenderTargetDirect(texture->asRenderTarget()));
+ SkCanvas* canvas = surf->getCanvas();
SkPaint paint;
@@ -103,7 +102,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) {
paint.setColor(SK_ColorWHITE);
- canvas.drawRect(rect, paint);
+ canvas->drawRect(rect, paint);
memset(readback.get(), kClearValue, nonZeroRowBytes * Y_SIZE);
result = texture->readPixels(0, 0, desc.fWidth, desc.fHeight,