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

Unified Diff: tests/ResourceCacheTest.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 | « tests/GpuDrawPathTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ResourceCacheTest.cpp
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index a66b0360ebab49c83b050ac089de697d375daab2..9a4a129c7f31f4cc7367dbcad85010b47768e006 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -7,9 +7,10 @@
#if SK_SUPPORT_GPU
+#include "SkCanvas.h"
#include "GrContextFactory.h"
#include "GrResourceCache.h"
-#include "SkGpuDevice.h"
+#include "SkSurface.h"
#include "Test.h"
static const int gWidth = 640;
@@ -296,12 +297,10 @@ DEF_GPUTEST(ResourceCache, reporter, factory) {
desc.fFlags = kRenderTarget_GrTextureFlagBit;
desc.fWidth = gWidth;
desc.fHeight = gHeight;
+ SkImageInfo info = SkImageInfo::MakeN32Premul(gWidth, gHeight);
+ SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(context, info, 0));
- SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc, NULL, 0));
- SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(texture.get()));
- SkCanvas canvas(device.get());
-
- test_cache(reporter, context, &canvas);
+ test_cache(reporter, context, surface->getCanvas());
test_purge_invalidated(reporter, context);
test_cache_delete_on_destruction(reporter, context);
test_resource_size_changed(reporter, context);
« no previous file with comments | « tests/GpuDrawPathTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698