Index: src/gpu/gl/GrGLCaps.cpp |
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp |
index c8684d9d836b2dcdcb1e8addd72374eb5c66de2c..4467ef9a8bd45f5e682d57a746bda93ddb78a74c 100644 |
--- a/src/gpu/gl/GrGLCaps.cpp |
+++ b/src/gpu/gl/GrGLCaps.cpp |
@@ -642,11 +642,10 @@ bool GrGLCaps::hasPathRenderingSupport(const GrGLContextInfo& ctxInfo, const GrG |
return true; |
} |
-bool GrGLCaps::readPixelsSupported(GrGLRenderTarget* target, |
+bool GrGLCaps::readPixelsSupported(GrPixelConfig rtConfig, |
GrPixelConfig readConfig, |
std::function<void (GrGLenum, GrGLint*)> getIntegerv, |
- std::function<void (GrGLRenderTarget*)> bindRenderTarget) const { |
- GrPixelConfig rtConfig = target->config(); |
+ std::function<bool ()> bindRenderTarget) const { |
SkASSERT(this->isConfigRenderable(rtConfig, false)); |
GrGLenum readFormat; |
@@ -677,7 +676,9 @@ bool GrGLCaps::readPixelsSupported(GrGLRenderTarget* target, |
ReadPixelsFormat* rpFormat = |
const_cast<ReadPixelsFormat*>(&fConfigTable[rtConfig].fSecondReadPixelsFormat); |
GrGLint format = 0, type = 0; |
- bindRenderTarget(target); |
+ if (!bindRenderTarget()) { |
+ return false; |
+ } |
getIntegerv(GR_GL_IMPLEMENTATION_COLOR_READ_FORMAT, &format); |
getIntegerv(GR_GL_IMPLEMENTATION_COLOR_READ_TYPE, &type); |
rpFormat->fFormat = format; |