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

Unified Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 1099853002: WebGL: add targets for WebGL 2 when check FBO targets (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed kbr@'s feedback Created 5 years, 8 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 | « Source/core/html/canvas/WebGLRenderingContextBase.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
index 52dcf86a3a5c3c83adc5477ba3ff7e8d3009a97c..c82d36c09622aa7fe6c03e485ce8a745aa199d36 100644
--- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
@@ -1367,15 +1367,27 @@ void WebGLRenderingContextBase::bufferSubData(GLenum target, long long offset, D
bufferSubDataImpl(target, offset, data->byteLength(), data->baseAddress());
}
+bool WebGLRenderingContextBase::validateFramebufferTarget(GLenum target)
+{
+ if (target == GL_FRAMEBUFFER)
+ return true;
+ return false;
+}
+
+WebGLFramebuffer* WebGLRenderingContextBase::getFramebufferBinding(GLenum target)
+{
+ return m_framebufferBinding.get();
+}
+
GLenum WebGLRenderingContextBase::checkFramebufferStatus(GLenum target)
{
if (isContextLost())
return GL_FRAMEBUFFER_UNSUPPORTED;
- if (target != GL_FRAMEBUFFER) {
+ if (!validateFramebufferTarget(target)) {
synthesizeGLError(GL_INVALID_ENUM, "checkFramebufferStatus", "invalid target");
return 0;
}
- if (!m_framebufferBinding || !m_framebufferBinding->object())
+ if (!getFramebufferBinding(target) || !getFramebufferBinding(target)->object())
return GL_FRAMEBUFFER_COMPLETE;
const char* reason = "framebuffer incomplete";
GLenum result = m_framebufferBinding->checkStatus(&reason);
@@ -5464,7 +5476,7 @@ void WebGLRenderingContextBase::printWarningToConsole(const String& message)
bool WebGLRenderingContextBase::validateFramebufferFuncParameters(const char* functionName, GLenum target, GLenum attachment)
{
- if (target != GL_FRAMEBUFFER) {
+ if (!validateFramebufferTarget(target)) {
synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target");
return false;
}
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContextBase.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698