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

Unified Diff: tests/SRGBMipMapTest.cpp

Issue 2539993002: Enable sRGB on iOS, make sRGB decode support optional (Closed)
Patch Set: Remove testing hacks Created 4 years 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
« src/gpu/gl/GrGLCaps.cpp ('K') | « src/gpu/gl/GrGLGpu.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SRGBMipMapTest.cpp
diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp
index a875c5c71033afcba2d57daf008d1eaf63932fbf..b64996957ac8f97d30979a2c47d14f5e66d99b8b 100644
--- a/tests/SRGBMipMapTest.cpp
+++ b/tests/SRGBMipMapTest.cpp
@@ -10,6 +10,7 @@
#include "GrCaps.h"
#include "GrContext.h"
#include "GrRenderTargetContext.h"
+#include "gl/GrGLGpu.h"
#include "SkCanvas.h"
#include "SkSurface.h"
@@ -142,8 +143,15 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBMipMaps, reporter, ctxInfo) {
// 2) Draw texture to L32 surface (should generate/use linear mips)
paint.setGammaCorrect(false);
l32RenderTargetContext->drawRect(noClip, paint, SkMatrix::I(), rect);
- read_and_check_pixels(reporter, l32RenderTargetContext->asTexture().get(), expectedLinear,
- error, "re-render as linear");
+
+ // Right now, this test only runs on GL (because Vulkan doesn't support legacy mip-mapping
+ // skbug.com/5048). On GL, we may not have sRGB decode support. In that case, rendering sRGB
+ // textures to a legacy surface produces nonsense, so this part of the test is meaningless.
+ GrGLGpu* glGpu = static_cast<GrGLGpu*>(context->getGpu());
+ if (glGpu->glCaps().srgbDecodeSupport()) {
bsalomon 2016/11/30 17:00:21 Should we have this on GrCaps rather than GrGLCaps
+ read_and_check_pixels(reporter, l32RenderTargetContext->asTexture().get(), expectedLinear,
+ error, "re-render as linear");
+ }
// 3) Go back to sRGB
paint.setGammaCorrect(true);
« src/gpu/gl/GrGLCaps.cpp ('K') | « src/gpu/gl/GrGLGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698