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

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

Issue 1615023003: Add ability to query read pixels support without a render target. (Closed) Base URL: https://skia.googlesource.com/skia.git@fixsupp
Patch Set: add newline Created 4 years, 11 months 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 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;
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLGpu.h » ('j') | src/gpu/gl/GrGLGpu.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698