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/GrPorterDuffTest.cpp

Issue 1448873002: Generate list of GPU contexts outside tests (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-01-gpu-test-context-support
Patch Set: rebase, remove a hunk Created 5 years, 1 month 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
Index: tests/GrPorterDuffTest.cpp
diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp
index d984f92142d3dddec9e1475e12b99e509e1ff9dd..d1e706e484c46b4c65800781dbc6a6e419f6c9f5 100644
--- a/tests/GrPorterDuffTest.cpp
+++ b/tests/GrPorterDuffTest.cpp
@@ -27,16 +27,9 @@ static void test_color_opaque_with_coverage(skiatest::Reporter* reporter, const
static void test_color_opaque_no_coverage(skiatest::Reporter* reporter, const GrCaps& caps);
static void test_lcd_coverage(skiatest::Reporter* reporter, const GrCaps& caps);
static void test_lcd_coverage_fallback_case(skiatest::Reporter* reporter, const GrCaps& caps);
-static void test_no_dual_source_blending(skiatest::Reporter* reporter);
-DEF_GPUTEST(GrPorterDuff, reporter, factory) {
- GrContext* ctx = factory->get(GrContextFactory::kNull_GLContextType);
- if (!ctx) {
- SkFAIL("Failed to create null context.");
- return;
- }
-
- const GrCaps& caps = *ctx->getGpu()->caps();
+DEF_GPUTEST_FOR_NULL_CONTEXT(GrPorterDuff, reporter, context) {
+ const GrCaps& caps = *context->getGpu()->caps();
if (!caps.shaderCaps()->dualSourceBlendingSupport()) {
SkFAIL("Null context does not support dual source blending.");
return;
@@ -48,7 +41,6 @@ DEF_GPUTEST(GrPorterDuff, reporter, factory) {
test_color_opaque_no_coverage(reporter, caps);
test_lcd_coverage(reporter, caps);
test_lcd_coverage_fallback_case(reporter, caps);
- test_no_dual_source_blending(reporter);
}
////////////////////////////////////////////////////////////////////////////////
@@ -1147,12 +1139,11 @@ static void test_lcd_coverage_fallback_case(skiatest::Reporter* reporter, const
TEST_ASSERT(blendInfo.fWriteColor);
}
-static void test_no_dual_source_blending(skiatest::Reporter* reporter) {
+DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, /*factory*/) {
GrContextOptions opts;
opts.fSuppressDualSourceBlending = true;
- GrContextFactory factory(opts);
- factory.get(GrContextFactory::kNull_GLContextType);
- GrContext* ctx = factory.get(GrContextFactory::kNull_GLContextType);
+ GrContextFactory mockFactory(opts);
+ GrContext* ctx = mockFactory.get(GrContextFactory::kNull_GLContextType);
if (!ctx) {
SkFAIL("Failed to create null context without ARB_blend_func_extended.");
return;
@@ -1165,7 +1156,8 @@ static void test_no_dual_source_blending(skiatest::Reporter* reporter) {
}
GrBackendObject backendTex =
- ctx->getGpu()->createTestingOnlyBackendTexture(nullptr, 100, 100, kRGBA_8888_GrPixelConfig);
+ ctx->getGpu()->createTestingOnlyBackendTexture(nullptr, 100, 100,
+ kRGBA_8888_GrPixelConfig);
GrBackendTextureDesc fakeDesc;
fakeDesc.fConfig = kRGBA_8888_GrPixelConfig;
fakeDesc.fWidth = fakeDesc.fHeight = 100;
« tests/BlurTest.cpp ('K') | « tests/GrDrawTargetTest.cpp ('k') | tests/GrSurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698