aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ReadWriteAlphaTest.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-04-22 10:57:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-22 10:57:16 -0700
commit7715e06b68a1f07f07d23c63e7128d32654e30e9 (patch)
tree262e93f8adb91025a184801671d3165ce369111a /tests/ReadWriteAlphaTest.cpp
parent272aa12c63e32c2845cbb5549660c08c31159282 (diff)
Retract SkDevice a bit more
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,