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

Unified Diff: src/gpu/gl/GrGLCaps.cpp

Issue 791823003: Add sRGB texture support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add in changes for copy_to_new_texture_pixelref Created 6 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
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index cfb9558c76cdf41af061f12820e32490d09c3894..b729820ca5fdd2efd9ef51a1f12edc5447df2f5f 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -478,6 +478,23 @@ void GrGLCaps::initConfigRenderableTable(const GrGLContextInfo& ctxInfo) {
}
}
+ if (this->fRGBA8RenderbufferSupport && this->isConfigTexturable(kSRGBA_8888_GrPixelConfig)) {
+ if (kGL_GrGLStandard == standard) {
+ if (ctxInfo.version() >= GR_GL_VER(3,0) ||
+ ctxInfo.hasExtension("GL_ARB_framebuffer_sRGB") ||
+ ctxInfo.hasExtension("GL_EXT_framebuffer_sRGB")) {
+ fConfigRenderSupport[kSRGBA_8888_GrPixelConfig][kNo_MSAA] = true;
+ fConfigRenderSupport[kSRGBA_8888_GrPixelConfig][kYes_MSAA] = true;
+ }
+ } else {
+ if (ctxInfo.version() >= GR_GL_VER(3,0) ||
+ ctxInfo.hasExtension("GL_EXT_sRGB")) {
+ fConfigRenderSupport[kSRGBA_8888_GrPixelConfig][kNo_MSAA] = true;
+ fConfigRenderSupport[kSRGBA_8888_GrPixelConfig][kYes_MSAA] = true;
+ }
+ }
+ }
+
if (this->isConfigTexturable(kRGBA_float_GrPixelConfig)) {
if (kGL_GrGLStandard == standard) {
fConfigRenderSupport[kRGBA_float_GrPixelConfig][kNo_MSAA] = true;
@@ -560,6 +577,15 @@ void GrGLCaps::initConfigTexturableTable(const GrGLContextInfo& ctxInfo, const G
kSkia8888_GrPixelConfig != kBGRA_8888_GrPixelConfig);
}
+ // Check for sRGBA
+ if (kGL_GrGLStandard == standard) {
+ fConfigTextureSupport[kSRGBA_8888_GrPixelConfig] =
+ (version >= GR_GL_VER(3,0) || ctxInfo.hasExtension("GL_EXT_texture_sRGB"));
+ } else {
+ fConfigTextureSupport[kSRGBA_8888_GrPixelConfig] =
+ (version >= GR_GL_VER(3,0) || ctxInfo.hasExtension("GL_EXT_sRGB"));
+ }
+
// Compressed texture support
// glCompressedTexImage2D is available on all OpenGL ES devices...

Powered by Google App Engine
This is Rietveld 408576698