diff options
author | Brian Osman <brianosman@google.com> | 2018-07-02 15:21:46 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-02 20:13:52 +0000 |
commit | 9aa30c6ee0e5e2ba4ccc25a4913966a65f808f28 (patch) | |
tree | 51a77c3460dbb9237fb504ad971c36d2633c4d76 /tests | |
parent | 2f046f1f526715f2c2179e825529770fae5ff078 (diff) |
Remove sRGB config checks based on color space
All of the restrictions/assumptions that led to this code are gone,
so we can always use appropriate color space.
For the YUV provider, if/when we re-introduce 8888 sRGB, the color
space will have a linear transfer function, so the color space
xform will automatically do what was happening here. That removes
the last usage of framebuffer sRGB control, so we can remove all
kinds of GrPaint and GrPipeline plumbing for that feature.
Change-Id: I24af1d498dbc75210f92f8c61b10aa31eec022f6
Reviewed-on: https://skia-review.googlesource.com/138986
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GLProgramsTest.cpp | 7 | ||||
-rw-r--r-- | tests/GrSurfaceTest.cpp | 8 | ||||
-rw-r--r-- | tests/ReadWriteAlphaTest.cpp | 6 |
3 files changed, 3 insertions, 18 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 359527fce5..31c2931bc8 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -248,12 +248,6 @@ static void set_random_color_coverage_stages(GrPaint* paint, } } -static void set_random_state(GrPaint* paint, SkRandom* random) { - if (random->nextBool()) { - paint->setDisableOutputConversionToSRGB(true); - } -} - #endif #if !GR_TEST_UTILS @@ -310,7 +304,6 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages, int ma GrProcessorTestData ptd(&random, context, renderTargetContext.get(), proxies); set_random_color_coverage_stages(&paint, &ptd, maxStages, maxLevels); set_random_xpf(&paint, &ptd); - set_random_state(&paint, &random); GrDrawRandomOp(&random, renderTargetContext.get(), std::move(paint)); } // Flush everything, test passes if flush is successful(ie, no asserts are hit, no crashes) diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp index 80d54df05a..807fe428b0 100644 --- a/tests/GrSurfaceTest.cpp +++ b/tests/GrSurfaceTest.cpp @@ -151,10 +151,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(InitialTextureClear, reporter, context_info) for (int c = 0; c <= kLast_GrPixelConfig; ++c) { desc.fConfig = static_cast<GrPixelConfig>(c); - sk_sp<SkColorSpace> colorSpace; - if (GrPixelConfigIsSRGB(desc.fConfig)) { - colorSpace = SkColorSpace::MakeSRGB(); - } if (!context->contextPriv().caps()->isConfigTexturable(desc.fConfig)) { continue; } @@ -176,7 +172,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(InitialTextureClear, reporter, context_info) continue; } auto texCtx = context->contextPriv().makeWrappedSurfaceContext( - std::move(proxy), colorSpace); + std::move(proxy)); SkImageInfo info = SkImageInfo::Make( kSize, kSize, kRGBA_8888_SkColorType, kPremul_SkAlphaType); memset(data.get(), 0xAB, kSize * kSize * sizeof(uint32_t)); @@ -201,7 +197,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(InitialTextureClear, reporter, context_info) // Try creating the texture as a deferred proxy. for (int i = 0; i < 2; ++i) { auto surfCtx = context->contextPriv().makeDeferredSurfaceContext( - desc, origin, GrMipMapped::kNo, fit, SkBudgeted::kYes, colorSpace); + desc, origin, GrMipMapped::kNo, fit, SkBudgeted::kYes); if (!surfCtx) { continue; } diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp index d7f4d54ae1..8f72d9b7db 100644 --- a/tests/ReadWriteAlphaTest.cpp +++ b/tests/ReadWriteAlphaTest.cpp @@ -191,12 +191,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { continue; } - sk_sp<SkColorSpace> colorSpace; - if (GrPixelConfigIsSRGB(proxy->config())) { - colorSpace = SkColorSpace::MakeSRGB(); - } sk_sp<GrSurfaceContext> sContext = context->contextPriv().makeWrappedSurfaceContext( - std::move(proxy), std::move(colorSpace)); + std::move(proxy)); for (auto rowBytes : kRowBytes) { size_t nonZeroRowBytes = rowBytes ? rowBytes : X_SIZE; |