aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLCaps.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-01-14 07:19:47 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-14 07:19:47 -0800
commit23e566664b85472766c921cd2f5615c846919934 (patch)
treef1700f55fea1e1ea3ea5964fbe7ea678ab568fba /src/gpu/gl/GrGLCaps.cpp
parent4c7040bf8a30a191d5c9a3a7286b0ae3ed162611 (diff)
Revert of Make A8 readback work in more cases and improve testing. (patchset #5 id:70001 of https://codereview.chromium.org/1584563002/ )
Reason for revert: Breaking video tests in Chrome. Original issue's description: > Make A8 readback work in more cases and improve testing. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1584563002 > > Committed: https://skia.googlesource.com/skia/+/b76afedf11c7fe933954d030048c3222860249e1 TBR=egdaniel@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1581203005
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 0c2ed73d7c..678c62abb8 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -637,22 +637,7 @@ bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf,
}
if (kGL_GrGLStandard == intf->fStandard) {
- // Some OpenGL implementations allow GL_ALPHA as a format to glReadPixels. However,
- // the manual (https://www.opengl.org/sdk/docs/man/) says only these formats are allowed:
- // GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_DEPTH_STENCIL, GL_RED, GL_GREEN, GL_BLUE,
- // GL_RGB, GL_BGR, GL_RGBA, and GL_BGRA. We check for the subset that we would use.
- if (readFormat != GR_GL_RED && readFormat != GR_GL_RGB && readFormat != GR_GL_RGBA &&
- readFormat != GR_GL_BGRA) {
- return false;
- }
- // There is also a set of allowed types, but all the types we use are in the set:
- // GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT,
- // GL_HALF_FLOAT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
- // GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4,
- // GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
- // GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV,GL_UNSIGNED_INT_10_10_10_2,
- // GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, GL_UNSIGNED_INT_10F_11F_11F_REV,
- // GL_UNSIGNED_INT_5_9_9_9_REV, or GL_FLOAT_32_UNSIGNED_INT_24_8_REV.
+ // All of our renderable configs can be converted to each other by glReadPixels in OpenGL.
return true;
}
@@ -1066,17 +1051,6 @@ bool GrGLCaps::getExternalFormat(GrPixelConfig surfaceConfig, GrPixelConfig memo
*externalFormat = fConfigTable[memoryConfig].fFormats.fExternalFormat[usage];
*externalType = fConfigTable[memoryConfig].fFormats.fExternalType;
- // When GL_RED is supported as a texture format, our alpha-only textures are stored using
- // GL_RED and we swizzle in order to map all components to 'r'. However, in this case the
- // surface is not alpha-only and we want alpha to really mean the alpha component of the
- // texture, not the red component.
- if (memoryIsAlphaOnly && !surfaceIsAlphaOnly) {
- if (this->textureRedSupport()) {
- SkASSERT(GR_GL_RED == *externalFormat);
- *externalFormat = GR_GL_ALPHA;
- }
- }
-
return true;
}