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

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

Issue 806943002: Change desktop and ES 3.0 to always use sized internal texture formats. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: This time for sure 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
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL.cpp
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 2965cd4007c6bfaaab7f424142a35b2e0b6bd4f4..7d3920fad96349941eb51f6df07bd01fd65e08ea 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -554,21 +554,14 @@ bool GrGLGpu::uploadTexData(const GrSurfaceDesc& desc,
useTexStorage = desc.fConfig != kRGB_565_GrPixelConfig;
}
- GrGLenum internalFormat;
- GrGLenum externalFormat = 0x0; // suprress warning
- GrGLenum externalType = 0x0;// suprress warning
-
- // glTexStorage requires sized internal formats on both desktop and ES. ES2 requires an unsized
- // format for glTexImage, unlike ES3 and desktop. However, we allow the driver to decide the
- // size of the internal format whenever possible and so only use a sized internal format when
- // using texture storage.
- bool useSizedFormat = useTexStorage;
- // Many versions of the ES3 drivers on various platforms will not accept GL_RED in
- // glTexImage2D for the internal format but will accept GL_R8.
- if (kGLES_GrGLStandard == this->glStandard() && this->glVersion() >= GR_GL_VER(3, 0) &&
- kAlpha_8_GrPixelConfig == dataConfig) {
- useSizedFormat = true;
- }
+ GrGLenum internalFormat = 0x0; // suppress warning
+ GrGLenum externalFormat = 0x0; // suppress warning
+ GrGLenum externalType = 0x0; // suppress warning
+
+ // glTexStorage requires sized internal formats on both desktop and ES.
+ // ES2 requires an unsized format for glTexImage. On ES3 and desktop we default to sized.
+ bool useSizedFormat = useTexStorage || kGL_GrGLStandard == this->glStandard() ||
+ this->glVersion() >= GR_GL_VER(3, 0);
if (!this->configToGLFormats(dataConfig, useSizedFormat, &internalFormat,
&externalFormat, &externalType)) {
return false;
@@ -2276,8 +2269,8 @@ bool GrGLGpu::configToGLFormats(GrPixelConfig config,
*internalFormat = GR_GL_RGB;
*externalFormat = GR_GL_RGB;
if (getSizedInternalFormat) {
- if (this->glStandard() == kGL_GrGLStandard) {
- return false;
+ if (!this->glCaps().ES2CompatibilitySupport()) {
+ *internalFormat = GR_GL_RGB5;
} else {
*internalFormat = GR_GL_RGB565;
}
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698