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

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

Issue 2489643002: Fix query for GR_GL_IMPLEMENTATION_COLOR_READ_FORMAT for GrPixelConfigs that aren't renderable (Closed)
Patch Set: fix Created 4 years, 1 month 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/GrGLCaps.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 0af5c57a3e515c16ec9c0d4270b5572b2b34a9d0..a37d0e093f461ab73ab9044881afa89bfa2f4f59 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -855,7 +855,8 @@ bool GrGLCaps::hasPathRenderingSupport(const GrGLContextInfo& ctxInfo, const GrG
bool GrGLCaps::readPixelsSupported(GrPixelConfig surfaceConfig,
GrPixelConfig readConfig,
std::function<void (GrGLenum, GrGLint*)> getIntegerv,
- std::function<bool ()> bindRenderTarget) const {
+ std::function<bool ()> bindRenderTarget,
+ std::function<void ()> unbindRenderTarget) const {
// If it's not possible to even have a color attachment of surfaceConfig then read pixels is
// not supported regardless of readConfig.
if (!this->canConfigBeFBOColorAttachment(surfaceConfig)) {
@@ -912,6 +913,7 @@ bool GrGLCaps::readPixelsSupported(GrPixelConfig surfaceConfig,
getIntegerv(GR_GL_IMPLEMENTATION_COLOR_READ_TYPE, &type);
rpFormat->fFormat = format;
rpFormat->fType = type;
+ unbindRenderTarget();
}
return fConfigTable[surfaceConfig].fSecondReadPixelsFormat.fFormat == readFormat &&
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698