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

Unified Diff: tests/ReadPixelsTest.cpp

Issue 2187573002: Reduce usage of MakeRenderTargetDirect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up Created 4 years, 5 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/DeviceTest.cpp ('k') | tests/ReadWriteAlphaTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ReadPixelsTest.cpp
diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp
index 5d3bfc990255916662a0cc72590e6f9a20cc69ab..c1fa4d2328090a4d9c61b342373c926659cfb6e9 100644
--- a/tests/ReadPixelsTest.cpp
+++ b/tests/ReadPixelsTest.cpp
@@ -387,17 +387,10 @@ DEF_TEST(ReadPixels, reporter) {
}
#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadPixels_Gpu, reporter, ctxInfo) {
+ const SkImageInfo ii = SkImageInfo::MakeN32Premul(DEV_W, DEV_H);
for (auto& origin : {kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin}) {
- GrSurfaceDesc desc;
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
- desc.fWidth = DEV_W;
- desc.fHeight = DEV_H;
- desc.fConfig = kSkia8888_GrPixelConfig;
- desc.fOrigin = origin;
- SkAutoTUnref<GrTexture> surfaceTexture(
- ctxInfo.grContext()->textureProvider()->createTexture(desc, SkBudgeted::kNo));
- auto surface(SkSurface::MakeRenderTargetDirect(surfaceTexture->asRenderTarget(), nullptr));
- desc.fFlags = kNone_GrSurfaceFlags;
+ sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo,
+ ii, 0, origin, nullptr));
test_readpixels(reporter, surface, kLast_BitmapInit);
}
}
« no previous file with comments | « tests/DeviceTest.cpp ('k') | tests/ReadWriteAlphaTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698