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

Unified Diff: tests/SurfaceTest.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/ReadWriteAlphaTest.cpp ('k') | tests/WritePixelsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SurfaceTest.cpp
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 8d2ba51e199f496315dcdf3bbc9fc664fed4ee33..87c3a52fc9fdfcc700051ff310c9ae4d34521fbd 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -56,7 +56,7 @@ static sk_sp<SkSurface> create_gpu_surface(GrContext* context, SkAlphaType at =
if (requestedInfo) {
*requestedInfo = info;
}
- return SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info, 0, nullptr);
+ return SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info);
}
static sk_sp<SkSurface> create_gpu_scratch_surface(GrContext* context,
SkAlphaType at = kPremul_SkAlphaType,
@@ -65,7 +65,7 @@ static sk_sp<SkSurface> create_gpu_scratch_surface(GrContext* context,
if (requestedInfo) {
*requestedInfo = info;
}
- return SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info, 0, nullptr);
+ return SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info);
}
#endif
@@ -79,8 +79,7 @@ DEF_TEST(SurfaceEmpty, reporter) {
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceEmpty_Gpu, reporter, ctxInfo) {
const SkImageInfo info = SkImageInfo::Make(0, 0, kN32_SkColorType, kPremul_SkAlphaType);
REPORTER_ASSERT(reporter, nullptr ==
- SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo, info, 0,
- nullptr));
+ SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo, info));
}
#endif
@@ -335,13 +334,13 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(UniqueImageSnapshot_Gpu, reporter, ctxInfo) {
desc.fHeight = 10;
desc.fFlags = kRenderTarget_GrBackendTextureFlag;
desc.fTextureHandle = textureObject;
- GrTexture* texture = context->textureProvider()->wrapBackendTexture(desc);
+
{
- auto surface(SkSurface::MakeRenderTargetDirect(texture->asRenderTarget(), nullptr));
+ sk_sp<SkSurface> surface(SkSurface::MakeFromBackendTexture(context, desc, nullptr));
test_unique_image_snap(reporter, surface.get(), true, imageBackingStore,
surfaceBackingStore);
}
- texture->unref();
+
context->getGpu()->deleteTestingOnlyBackendTexture(textureObject);
}
}
« no previous file with comments | « tests/ReadWriteAlphaTest.cpp ('k') | tests/WritePixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698