Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Unified Diff: tests/GpuDrawPathTest.cpp

Issue 585493002: use surface instead of explicitly making gpudevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GpuDrawPathTest.cpp
diff --git a/tests/GpuDrawPathTest.cpp b/tests/GpuDrawPathTest.cpp
index 98313aabaa3645acc88f5689965cf4bb42b31ff0..f0148ba9a2d99b6967f402ea1cebc2a7f4a0c0f6 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());
}
}
}
« no previous file with comments | « no previous file | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698