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

Unified Diff: tests/TextureStorageAllocator.cpp

Issue 1860593002: One signature for creating unit tests that run on premade GrContexts (Closed) Base URL: https://skia.googlesource.com/skia.git@try_no_native
Patch Set: another guess to fix windows Created 4 years, 8 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/TextBlobCacheTest.cpp ('k') | tests/WritePixelsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/TextureStorageAllocator.cpp
diff --git a/tests/TextureStorageAllocator.cpp b/tests/TextureStorageAllocator.cpp
index fbd00d32f698eb623d60291c7b56b2bf6e0992d8..433b3659327a63cac4a4d4994c5eca55d7a9b13e 100644
--- a/tests/TextureStorageAllocator.cpp
+++ b/tests/TextureStorageAllocator.cpp
@@ -53,7 +53,9 @@ class TestStorageAllocator {
bool m_allowAllocation;
};
-DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CustomTexture, reporter, context, glContext) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CustomTexture, reporter, ctxInfo) {
+ GrContext* context = ctxInfo.fGrContext;
+ sk_gpu_test::GLTestContext* glContext = ctxInfo.fGLContext;
static const int kWidth = 13;
static const int kHeight = 13;
@@ -88,11 +90,11 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CustomTexture, reporter, context, glContext)
REPORTER_ASSERT(reporter, GrColorUnpackG(dest) == 255);
}
-DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CustomTextureFailure, reporter, context, glContext) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CustomTextureFailure, reporter, ctxInfo) {
static const int kWidth = 13;
static const int kHeight = 13;
- const GrGLInterface* gl = glContext->gl();
+ const GrGLInterface* gl = ctxInfo.fGLContext->gl();
TestStorageAllocator allocator;
allocator.m_allowAllocation = false;
allocator.m_gl = gl;
@@ -101,7 +103,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CustomTextureFailure, reporter, context, glCo
grAllocator.fDeallocateTextureStorage= &TestStorageAllocator::deallocateTextureStorage;
grAllocator.fCtx = &allocator;
auto surface(SkSurface_Gpu::MakeRenderTarget(
- context, SkBudgeted::kNo, SkImageInfo::MakeN32Premul(kWidth, kHeight), 0,
+ ctxInfo.fGrContext, SkBudgeted::kNo, SkImageInfo::MakeN32Premul(kWidth, kHeight), 0,
NULL, grAllocator));
REPORTER_ASSERT(reporter, !surface);
}
« no previous file with comments | « tests/TextBlobCacheTest.cpp ('k') | tests/WritePixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698