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

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

Issue 24096029: Moved the majority of WebGL functionality into WebGLRenderingContextBase (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revamped extension testing, added featureLevel Created 7 years, 3 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: Source/core/html/canvas/WebGLFramebuffer.cpp
diff --git a/Source/core/html/canvas/WebGLFramebuffer.cpp b/Source/core/html/canvas/WebGLFramebuffer.cpp
index ea0352a4f4f458d81e0021dd91a5b37452172900..31d752441adcc0d44109785f8551cdb5f5f4fdaf 100644
--- a/Source/core/html/canvas/WebGLFramebuffer.cpp
+++ b/Source/core/html/canvas/WebGLFramebuffer.cpp
@@ -27,7 +27,7 @@
#include "core/html/canvas/WebGLFramebuffer.h"
-#include "core/html/canvas/WebGLRenderingContext.h"
+#include "core/html/canvas/WebGLRenderingContextBase.h"
#include "core/platform/NotImplemented.h"
#include "core/platform/graphics/Extensions3D.h"
@@ -278,12 +278,12 @@ WebGLFramebuffer::WebGLAttachment::~WebGLAttachment()
{
}
-PassRefPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRenderingContext* ctx)
+PassRefPtr<WebGLFramebuffer> WebGLFramebuffer::create(WebGLRenderingContextBase* ctx)
{
return adoptRef(new WebGLFramebuffer(ctx));
}
-WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContext* ctx)
+WebGLFramebuffer::WebGLFramebuffer(WebGLRenderingContextBase* ctx)
: WebGLContextObject(ctx)
, m_hasEverBeenBound(false)
{
@@ -355,7 +355,7 @@ bool WebGLFramebuffer::isAttachmentComplete(WebGLAttachment* attachedObject, GC3
}
} else if (object->isTexture()) {
GC3Denum type = attachedObject->getType();
- if (!(context()->m_webglDepthTexture && internalformat == GraphicsContext3D::DEPTH_COMPONENT
+ if (!(context()->extensionEnabled(WebGLDepthTextureName) && internalformat == GraphicsContext3D::DEPTH_COMPONENT
&& (type == GraphicsContext3D::UNSIGNED_SHORT || type == GraphicsContext3D::UNSIGNED_INT))) {
*reason = "the attached texture is not a depth texture";
return false;
@@ -378,14 +378,14 @@ bool WebGLFramebuffer::isAttachmentComplete(WebGLAttachment* attachedObject, GC3
}
} else if (object->isTexture()) {
GC3Denum type = attachedObject->getType();
- if (!(context()->m_webglDepthTexture && internalformat == GraphicsContext3D::DEPTH_STENCIL
+ if (!(context()->extensionEnabled(WebGLDepthTextureName) && internalformat == GraphicsContext3D::DEPTH_STENCIL
&& type == GraphicsContext3D::UNSIGNED_INT_24_8)) {
*reason = "the attached texture is not a DEPTH_STENCIL texture";
return false;
}
}
} else if (attachment == GraphicsContext3D::COLOR_ATTACHMENT0
- || (context()->m_webglDrawBuffers && attachment > GraphicsContext3D::COLOR_ATTACHMENT0
+ || (context()->extensionEnabled(WebGLDrawBuffersName) && attachment > GraphicsContext3D::COLOR_ATTACHMENT0
&& attachment < static_cast<GC3Denum>(GraphicsContext3D::COLOR_ATTACHMENT0 + context()->getMaxColorAttachments()))) {
if (object->isRenderbuffer()) {
if (!isColorRenderable(internalformat)) {
@@ -406,8 +406,8 @@ bool WebGLFramebuffer::isAttachmentComplete(WebGLAttachment* attachedObject, GC3
&& type != GraphicsContext3D::UNSIGNED_SHORT_5_6_5
&& type != GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4
&& type != GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1
- && !(type == GraphicsContext3D::FLOAT && context()->m_oesTextureFloat)
- && !(type == GraphicsContext3D::HALF_FLOAT_OES && context()->m_oesTextureHalfFloat)) {
+ && !(type == GraphicsContext3D::FLOAT && context()->extensionEnabled(OESTextureFloatName))
+ && !(type == GraphicsContext3D::HALF_FLOAT_OES && context()->extensionEnabled(OESTextureHalfFloatName))) {
*reason = "unsupported type: The attached texture is not supported to be rendered to";
return false;
}
@@ -608,7 +608,7 @@ void WebGLFramebuffer::drawBuffers(const Vector<GC3Denum>& bufs)
void WebGLFramebuffer::drawBuffersIfNecessary(bool force)
{
- if (!context()->m_webglDrawBuffers)
+ if (!context()->extensionEnabled(WebGLDrawBuffersName))
return;
bool reset = force;
// This filtering works around graphics driver bugs on Mac OS X.

Powered by Google App Engine
This is Rietveld 408576698