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

Unified Diff: Source/modules/webgl/WebGLFramebuffer.cpp

Issue 1315193013: Enable drawBuffers() also on ES3 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webgl/WebGLFramebuffer.cpp
diff --git a/Source/modules/webgl/WebGLFramebuffer.cpp b/Source/modules/webgl/WebGLFramebuffer.cpp
index d62069dc90d75d835a9f713f5b376f921b083666..052448724993c6bfd1818fe2ffd63b00cc870603 100644
--- a/Source/modules/webgl/WebGLFramebuffer.cpp
+++ b/Source/modules/webgl/WebGLFramebuffer.cpp
@@ -605,26 +605,27 @@ void WebGLFramebuffer::drawBuffers(const Vector<GLenum>& bufs)
void WebGLFramebuffer::drawBuffersIfNecessary(bool force)
{
- if (!context()->extensionEnabled(WebGLDrawBuffersName))
- return;
- bool reset = force;
- // This filtering works around graphics driver bugs on Mac OS X.
- for (size_t i = 0; i < m_drawBuffers.size(); ++i) {
- if (m_drawBuffers[i] != GL_NONE && getAttachment(m_drawBuffers[i])) {
- if (m_filteredDrawBuffers[i] != m_drawBuffers[i]) {
- m_filteredDrawBuffers[i] = m_drawBuffers[i];
- reset = true;
- }
- } else {
- if (m_filteredDrawBuffers[i] != GL_NONE) {
- m_filteredDrawBuffers[i] = GL_NONE;
- reset = true;
+ if (context()->isWebGL2OrHigher()
+ || context()->extensionEnabled(WebGLDrawBuffersName)) {
+ bool reset = force;
+ // This filtering works around graphics driver bugs on Mac OS X.
+ for (size_t i = 0; i < m_drawBuffers.size(); ++i) {
+ if (m_drawBuffers[i] != GL_NONE && getAttachment(m_drawBuffers[i])) {
+ if (m_filteredDrawBuffers[i] != m_drawBuffers[i]) {
+ m_filteredDrawBuffers[i] = m_drawBuffers[i];
+ reset = true;
+ }
+ } else {
+ if (m_filteredDrawBuffers[i] != GL_NONE) {
+ m_filteredDrawBuffers[i] = GL_NONE;
+ reset = true;
+ }
}
}
- }
- if (reset) {
- context()->webContext()->drawBuffersEXT(
- m_filteredDrawBuffers.size(), m_filteredDrawBuffers.data());
+ if (reset) {
+ context()->webContext()->drawBuffersEXT(
+ m_filteredDrawBuffers.size(), m_filteredDrawBuffers.data());
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698