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

Unified Diff: tests/WritePixelsTest.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/SurfaceTest.cpp ('k') | tests/skbug5221.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/WritePixelsTest.cpp
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index ec88f03c2b723634fc4afecb3c1bb3b09a76d975..1839a4018338435cfc55c6d29e2a189ad71485c2 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -407,16 +407,11 @@ DEF_TEST(WritePixels, reporter) {
}
#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixels_Gpu, reporter, ctxInfo) {
+ const SkImageInfo ii = SkImageInfo::MakeN32Premul(DEV_W, DEV_H);
+
for (auto& origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin }) {
- GrSurfaceDesc desc;
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
- desc.fWidth = DEV_W;
- desc.fHeight = DEV_H;
- desc.fConfig = kSkia8888_GrPixelConfig;
- desc.fOrigin = origin;
- SkAutoTUnref<GrTexture> texture(
- ctxInfo.grContext()->textureProvider()->createTexture(desc, SkBudgeted::kNo));
- auto surface(SkSurface::MakeRenderTargetDirect(texture->asRenderTarget(), nullptr));
+ sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo,
+ ii, 0, origin, nullptr));
test_write_pixels(reporter, surface.get());
}
}
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | tests/skbug5221.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698