aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GpuDrawPathTest.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-09-18 06:09:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-18 06:09:44 -0700
commit69f6f00fd975823e825c5aa0b1b8f4416e7c812b (patch)
treeba18c4aaa880eb0ffe2aea1222f025f6ba5bdfc2 /tests/GpuDrawPathTest.cpp
parent613d579471a4515dae60bdf7e3ab25cb3977fa01 (diff)
use surface instead of explicitly making gpudevice
TBR=bsalomon Author: reed@google.com Review URL: https://codereview.chromium.org/585493002
Diffstat (limited to 'tests/GpuDrawPathTest.cpp')
-rw-r--r--tests/GpuDrawPathTest.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/tests/GpuDrawPathTest.cpp b/tests/GpuDrawPathTest.cpp
index 98313aabaa..f0148ba9a2 100644
--- a/tests/GpuDrawPathTest.cpp
+++ b/tests/GpuDrawPathTest.cpp
@@ -12,10 +12,10 @@
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColor.h"
-#include "SkGpuDevice.h"
#include "SkPaint.h"
#include "SkRRect.h"
#include "SkRect.h"
+#include "SkSurface.h"
#include "Test.h"
static void test_drawPathEmpty(skiatest::Reporter*, SkCanvas* canvas) {
@@ -54,20 +54,10 @@ DEF_GPUTEST(GpuDrawPath, reporter, factory) {
static const int sampleCounts[] = { 0, 4, 16 };
for (size_t i = 0; i < SK_ARRAY_COUNT(sampleCounts); ++i) {
- const int W = 255;
- const int H = 255;
-
- GrTextureDesc desc;
- desc.fConfig = kSkia8888_GrPixelConfig;
- desc.fFlags = kRenderTarget_GrTextureFlagBit;
- desc.fWidth = W;
- desc.fHeight = H;
- desc.fSampleCnt = sampleCounts[i];
- SkAutoTUnref<GrTexture> texture(grContext->createUncachedTexture(desc, NULL, 0));
- SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(texture.get()));
- SkCanvas drawingCanvas(device.get());
-
- test_drawPathEmpty(reporter, &drawingCanvas);
+ SkImageInfo info = SkImageInfo::MakeN32Premul(255, 255);
+
+ SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(grContext, info, sampleCounts[i]));
+ test_drawPathEmpty(reporter, surface->getCanvas());
}
}
}