| Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| similarity index 84%
|
| copy from Source/core/html/canvas/WebGLRenderingContext.cpp
|
| copy to Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| index d3af1c6765d62a0197c5c0e7e3c5a512a49d78e7..ef416340f3d1acf2f3401144ba7a8e24935ba316 100644
|
| --- a/Source/core/html/canvas/WebGLRenderingContext.cpp
|
| +++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp
|
| @@ -24,7 +24,7 @@
|
| */
|
|
|
| #include "config.h"
|
| -#include "core/html/canvas/WebGLRenderingContext.h"
|
| +#include "core/html/canvas/WebGLRenderingContextBase.h"
|
|
|
| #include "RuntimeEnabledFeatures.h"
|
| #include "bindings/v8/ExceptionMessages.h"
|
| @@ -88,25 +88,25 @@ const double secondsBetweenRestoreAttempts = 1.0;
|
| const int maxGLErrorsAllowedToConsole = 256;
|
| const unsigned maxGLActiveContexts = 16;
|
|
|
| -Vector<WebGLRenderingContext*>& WebGLRenderingContext::activeContexts()
|
| +Vector<WebGLRenderingContextBase*>& WebGLRenderingContextBase::activeContexts()
|
| {
|
| - DEFINE_STATIC_LOCAL(Vector<WebGLRenderingContext*>, activeContexts, ());
|
| + DEFINE_STATIC_LOCAL(Vector<WebGLRenderingContextBase*>, activeContexts, ());
|
| return activeContexts;
|
| }
|
|
|
| -Vector<WebGLRenderingContext*>& WebGLRenderingContext::forciblyEvictedContexts()
|
| +Vector<WebGLRenderingContextBase*>& WebGLRenderingContextBase::forciblyEvictedContexts()
|
| {
|
| - DEFINE_STATIC_LOCAL(Vector<WebGLRenderingContext*>, forciblyEvictedContexts, ());
|
| + DEFINE_STATIC_LOCAL(Vector<WebGLRenderingContextBase*>, forciblyEvictedContexts, ());
|
| return forciblyEvictedContexts;
|
| }
|
|
|
| -void WebGLRenderingContext::forciblyLoseOldestContext(const String& reason)
|
| +void WebGLRenderingContextBase::forciblyLoseOldestContext(const String& reason)
|
| {
|
| size_t candidateID = oldestContextIndex();
|
| if (candidateID >= activeContexts().size())
|
| return;
|
|
|
| - WebGLRenderingContext* candidate = activeContexts()[candidateID];
|
| + WebGLRenderingContextBase* candidate = activeContexts()[candidateID];
|
|
|
| activeContexts().remove(candidateID);
|
|
|
| @@ -114,18 +114,18 @@ void WebGLRenderingContext::forciblyLoseOldestContext(const String& reason)
|
| InspectorInstrumentation::didFireWebGLWarning(candidate->canvas());
|
|
|
| // This will call deactivateContext once the context has actually been lost.
|
| - candidate->forceLostContext(WebGLRenderingContext::SyntheticLostContext);
|
| + candidate->forceLostContext(WebGLRenderingContextBase::SyntheticLostContext);
|
| }
|
|
|
| -size_t WebGLRenderingContext::oldestContextIndex()
|
| +size_t WebGLRenderingContextBase::oldestContextIndex()
|
| {
|
| if (!activeContexts().size())
|
| return maxGLActiveContexts;
|
|
|
| - WebGLRenderingContext* candidate = activeContexts().first();
|
| + WebGLRenderingContextBase* candidate = activeContexts().first();
|
| size_t candidateID = 0;
|
| for (size_t ii = 1; ii < activeContexts().size(); ++ii) {
|
| - WebGLRenderingContext* context = activeContexts()[ii];
|
| + WebGLRenderingContextBase* context = activeContexts()[ii];
|
| if (context->webGraphicsContext3D() && candidate->webGraphicsContext3D() && context->webGraphicsContext3D()->lastFlushID() < candidate->webGraphicsContext3D()->lastFlushID()) {
|
| candidate = context;
|
| candidateID = ii;
|
| @@ -135,13 +135,13 @@ size_t WebGLRenderingContext::oldestContextIndex()
|
| return candidateID;
|
| }
|
|
|
| -IntSize WebGLRenderingContext::oldestContextSize()
|
| +IntSize WebGLRenderingContextBase::oldestContextSize()
|
| {
|
| IntSize size;
|
|
|
| size_t candidateID = oldestContextIndex();
|
| if (candidateID < activeContexts().size()) {
|
| - WebGLRenderingContext* candidate = activeContexts()[candidateID];
|
| + WebGLRenderingContextBase* candidate = activeContexts()[candidateID];
|
| size.setWidth(candidate->drawingBufferWidth());
|
| size.setHeight(candidate->drawingBufferHeight());
|
| }
|
| @@ -149,7 +149,7 @@ IntSize WebGLRenderingContext::oldestContextSize()
|
| return size;
|
| }
|
|
|
| -void WebGLRenderingContext::activateContext(WebGLRenderingContext* context)
|
| +void WebGLRenderingContextBase::activateContext(WebGLRenderingContextBase* context)
|
| {
|
| unsigned removedContexts = 0;
|
| while (activeContexts().size() >= maxGLActiveContexts && removedContexts < maxGLActiveContexts) {
|
| @@ -161,7 +161,7 @@ void WebGLRenderingContext::activateContext(WebGLRenderingContext* context)
|
| activeContexts().append(context);
|
| }
|
|
|
| -void WebGLRenderingContext::deactivateContext(WebGLRenderingContext* context, bool addToEvictedList)
|
| +void WebGLRenderingContextBase::deactivateContext(WebGLRenderingContextBase* context, bool addToEvictedList)
|
| {
|
| size_t position = activeContexts().find(context);
|
| if (position != WTF::kNotFound)
|
| @@ -171,7 +171,7 @@ void WebGLRenderingContext::deactivateContext(WebGLRenderingContext* context, bo
|
| forciblyEvictedContexts().append(context);
|
| }
|
|
|
| -void WebGLRenderingContext::willDestroyContext(WebGLRenderingContext* context)
|
| +void WebGLRenderingContextBase::willDestroyContext(WebGLRenderingContextBase* context)
|
| {
|
| size_t position = forciblyEvictedContexts().find(context);
|
| if (position != WTF::kNotFound)
|
| @@ -181,7 +181,7 @@ void WebGLRenderingContext::willDestroyContext(WebGLRenderingContext* context)
|
|
|
| // Try to re-enable the oldest inactive contexts.
|
| while(activeContexts().size() < maxGLActiveContexts && forciblyEvictedContexts().size()) {
|
| - WebGLRenderingContext* evictedContext = forciblyEvictedContexts().first();
|
| + WebGLRenderingContextBase* evictedContext = forciblyEvictedContexts().first();
|
| if (!evictedContext->m_restoreAllowed) {
|
| forciblyEvictedContexts().remove(0);
|
| continue;
|
| @@ -202,10 +202,10 @@ void WebGLRenderingContext::willDestroyContext(WebGLRenderingContext* context)
|
| class WebGLRenderingContextEvictionManager : public ContextEvictionManager {
|
| public:
|
| void forciblyLoseOldestContext(const String& reason) {
|
| - WebGLRenderingContext::forciblyLoseOldestContext(reason);
|
| + WebGLRenderingContextBase::forciblyLoseOldestContext(reason);
|
| };
|
| IntSize oldestContextSize() {
|
| - return WebGLRenderingContext::oldestContextSize();
|
| + return WebGLRenderingContextBase::oldestContextSize();
|
| };
|
| };
|
|
|
| @@ -458,17 +458,17 @@ namespace {
|
| class WebGLRenderingContextLostCallback : public blink::WebGraphicsContext3D::WebGraphicsContextLostCallback {
|
| WTF_MAKE_FAST_ALLOCATED;
|
| public:
|
| - explicit WebGLRenderingContextLostCallback(WebGLRenderingContext* cb) : m_context(cb) { }
|
| - virtual void onContextLost() { m_context->forceLostContext(WebGLRenderingContext::RealLostContext); }
|
| + explicit WebGLRenderingContextLostCallback(WebGLRenderingContextBase* cb) : m_context(cb) { }
|
| + virtual void onContextLost() { m_context->forceLostContext(WebGLRenderingContextBase::RealLostContext); }
|
| virtual ~WebGLRenderingContextLostCallback() {}
|
| private:
|
| - WebGLRenderingContext* m_context;
|
| + WebGLRenderingContextBase* m_context;
|
| };
|
|
|
| class WebGLRenderingContextErrorMessageCallback : public blink::WebGraphicsContext3D::WebGraphicsErrorMessageCallback {
|
| WTF_MAKE_FAST_ALLOCATED;
|
| public:
|
| - explicit WebGLRenderingContextErrorMessageCallback(WebGLRenderingContext* cb) : m_context(cb) { }
|
| + explicit WebGLRenderingContextErrorMessageCallback(WebGLRenderingContextBase* cb) : m_context(cb) { }
|
| virtual void onErrorMessage(const blink::WebString& message, blink::WGC3Dint)
|
| {
|
| if (m_context->m_synthesizedErrorsToConsole)
|
| @@ -477,60 +477,17 @@ public:
|
| }
|
| virtual ~WebGLRenderingContextErrorMessageCallback() { }
|
| private:
|
| - WebGLRenderingContext* m_context;
|
| + WebGLRenderingContextBase* m_context;
|
| };
|
|
|
| -PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElement* canvas, WebGLContextAttributes* attrs)
|
| -{
|
| - Document& document = canvas->document();
|
| - Frame* frame = document.frame();
|
| - if (!frame)
|
| - return nullptr;
|
| - Settings* settings = frame->settings();
|
| -
|
| - // The FrameLoaderClient might block creation of a new WebGL context despite the page settings; in
|
| - // particular, if WebGL contexts were lost one or more times via the GL_ARB_robustness extension.
|
| - if (!frame->loader().client()->allowWebGL(settings && settings->webGLEnabled())) {
|
| - canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Web page was not allowed to create a WebGL context."));
|
| - return nullptr;
|
| - }
|
| -
|
| - // The only situation that attrs is null is through Document::getCSSCanvasContext().
|
| - RefPtr<WebGLContextAttributes> defaultAttrs;
|
| - if (!attrs) {
|
| - defaultAttrs = WebGLContextAttributes::create();
|
| - attrs = defaultAttrs.get();
|
| - }
|
| - blink::WebGraphicsContext3D::Attributes attributes = attrs->attributes(document.topDocument()->url().string(), settings);
|
| - OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(attributes));
|
| - if (!context || !context->makeContextCurrent()) {
|
| - canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Could not create a WebGL context."));
|
| - return nullptr;
|
| - }
|
| -
|
| - Extensions3DUtil extensionsUtil(context.get());
|
| - if (extensionsUtil.supportsExtension("GL_EXT_debug_marker"))
|
| - context->pushGroupMarkerEXT("WebGLRenderingContext");
|
| -
|
| - OwnPtr<WebGLRenderingContext> renderingContext = adoptPtr(new WebGLRenderingContext(canvas, context.release(), attrs));
|
| - renderingContext->suspendIfNeeded();
|
| -
|
| - if (renderingContext->m_drawingBuffer->isZeroSized()) {
|
| - canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Could not create a WebGL context."));
|
| - return nullptr;
|
| - }
|
| -
|
| - return renderingContext.release();
|
| -}
|
| -
|
| -WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, PassOwnPtr<blink::WebGraphicsContext3D> context, WebGLContextAttributes* requestedAttributes)
|
| +WebGLRenderingContextBase::WebGLRenderingContextBase(HTMLCanvasElement* passedCanvas, PassOwnPtr<blink::WebGraphicsContext3D> context, WebGLContextAttributes* requestedAttributes)
|
| : CanvasRenderingContext(passedCanvas)
|
| , ActiveDOMObject(&passedCanvas->document())
|
| , m_context(context)
|
| , m_drawingBuffer(nullptr)
|
| - , m_dispatchContextLostEventTimer(this, &WebGLRenderingContext::dispatchContextLostEvent)
|
| + , m_dispatchContextLostEventTimer(this, &WebGLRenderingContextBase::dispatchContextLostEvent)
|
| , m_restoreAllowed(false)
|
| - , m_restoreTimer(this, &WebGLRenderingContext::maybeRestoreContext)
|
| + , m_restoreTimer(this, &WebGLRenderingContextBase::maybeRestoreContext)
|
| , m_generatedImageCache(4)
|
| , m_contextLost(false)
|
| , m_contextLostMode(SyntheticLostContext)
|
| @@ -562,36 +519,9 @@ WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, Pa
|
| setupFlags();
|
| initializeNewContext();
|
| }
|
| -
|
| - // Register extensions.
|
| - static const char* const webkitPrefix[] = { "WEBKIT_", 0, };
|
| - static const char* const bothPrefixes[] = { "", "WEBKIT_", 0, };
|
| -
|
| - registerExtension<ANGLEInstancedArrays>(m_angleInstancedArrays);
|
| - registerExtension<EXTTextureFilterAnisotropic>(m_extTextureFilterAnisotropic, ApprovedExtension, bothPrefixes);
|
| - registerExtension<OESElementIndexUint>(m_oesElementIndexUint);
|
| - registerExtension<OESStandardDerivatives>(m_oesStandardDerivatives);
|
| - registerExtension<OESTextureFloat>(m_oesTextureFloat);
|
| - registerExtension<OESTextureFloatLinear>(m_oesTextureFloatLinear);
|
| - registerExtension<OESTextureHalfFloat>(m_oesTextureHalfFloat);
|
| - registerExtension<OESTextureHalfFloatLinear>(m_oesTextureHalfFloatLinear);
|
| - registerExtension<OESVertexArrayObject>(m_oesVertexArrayObject);
|
| - registerExtension<WebGLCompressedTextureATC>(m_webglCompressedTextureATC, PrefixedExtension, webkitPrefix);
|
| - registerExtension<WebGLCompressedTexturePVRTC>(m_webglCompressedTexturePVRTC, PrefixedExtension, webkitPrefix);
|
| - registerExtension<WebGLCompressedTextureS3TC>(m_webglCompressedTextureS3TC, ApprovedExtension, bothPrefixes);
|
| - registerExtension<WebGLDepthTexture>(m_webglDepthTexture, ApprovedExtension, bothPrefixes);
|
| - registerExtension<WebGLDrawBuffers>(m_webglDrawBuffers);
|
| - registerExtension<WebGLLoseContext>(m_webglLoseContext, ApprovedExtension, bothPrefixes);
|
| -
|
| - // Register draft extensions.
|
| - registerExtension<EXTFragDepth>(m_extFragDepth, DraftExtension);
|
| -
|
| - // Register privileged extensions.
|
| - registerExtension<WebGLDebugRendererInfo>(m_webglDebugRendererInfo, WebGLDebugRendererInfoExtension);
|
| - registerExtension<WebGLDebugShaders>(m_webglDebugShaders, PrivilegedExtension);
|
| }
|
|
|
| -void WebGLRenderingContext::initializeNewContext()
|
| +void WebGLRenderingContextBase::initializeNewContext()
|
| {
|
| ASSERT(!isContextLost());
|
| m_needsUpdate = true;
|
| @@ -669,10 +599,13 @@ void WebGLRenderingContext::initializeNewContext()
|
| // This ensures that the context has a valid "lastFlushID" and won't be mistakenly identified as the "least recently used" context.
|
| m_context->flush();
|
|
|
| + for (int i = 0; i < WebGLExtensionNameCount; ++i)
|
| + m_extensionEnabled[i] = false;
|
| +
|
| activateContext(this);
|
| }
|
|
|
| -void WebGLRenderingContext::setupFlags()
|
| +void WebGLRenderingContextBase::setupFlags()
|
| {
|
| ASSERT(m_context);
|
| if (Page* p = canvas()->document().page()) {
|
| @@ -689,30 +622,38 @@ void WebGLRenderingContext::setupFlags()
|
| m_isDepthStencilSupported = extensionsUtil()->isExtensionEnabled("GL_OES_packed_depth_stencil");
|
| }
|
|
|
| -bool WebGLRenderingContext::allowPrivilegedExtensions() const
|
| +bool WebGLRenderingContextBase::allowPrivilegedExtensions() const
|
| {
|
| if (Page* p = canvas()->document().page())
|
| return p->settings().privilegedWebGLExtensionsEnabled();
|
| return false;
|
| }
|
|
|
| -bool WebGLRenderingContext::allowWebGLDebugRendererInfo() const
|
| +bool WebGLRenderingContextBase::allowWebGLDebugRendererInfo() const
|
| {
|
| return true;
|
| }
|
|
|
| -void WebGLRenderingContext::addCompressedTextureFormat(GLenum format)
|
| +void WebGLRenderingContextBase::addCompressedTextureFormat(GLenum format)
|
| {
|
| if (!m_compressedTextureFormats.contains(format))
|
| m_compressedTextureFormats.append(format);
|
| }
|
|
|
| -void WebGLRenderingContext::removeAllCompressedTextureFormats()
|
| +void WebGLRenderingContextBase::removeAllCompressedTextureFormats()
|
| {
|
| m_compressedTextureFormats.clear();
|
| }
|
|
|
| -WebGLRenderingContext::~WebGLRenderingContext()
|
| +// Helper function for V8 bindings to identify what version of WebGL a CanvasRenderingContext supports.
|
| +unsigned WebGLRenderingContextBase::getWebGLVersion(const CanvasRenderingContext* context)
|
| +{
|
| + if (!context->is3d())
|
| + return 0;
|
| + return static_cast<const WebGLRenderingContextBase*>(context)->version();
|
| +}
|
| +
|
| +WebGLRenderingContextBase::~WebGLRenderingContextBase()
|
| {
|
| // Remove all references to WebGLObjects so if they are the last reference
|
| // they will be freed before the last context is removed from the context group.
|
| @@ -725,8 +666,8 @@ WebGLRenderingContext::~WebGLRenderingContext()
|
| m_renderbufferBinding = nullptr;
|
|
|
| for (size_t i = 0; i < m_textureUnits.size(); ++i) {
|
| - m_textureUnits[i].m_texture2DBinding = nullptr;
|
| - m_textureUnits[i].m_textureCubeMapBinding = nullptr;
|
| + m_textureUnits[i].m_texture2DBinding = nullptr;
|
| + m_textureUnits[i].m_textureCubeMapBinding = nullptr;
|
| }
|
|
|
| m_blackTexture2D = nullptr;
|
| @@ -753,7 +694,7 @@ WebGLRenderingContext::~WebGLRenderingContext()
|
| willDestroyContext(this);
|
| }
|
|
|
| -void WebGLRenderingContext::destroyContext()
|
| +void WebGLRenderingContextBase::destroyContext()
|
| {
|
| m_contextLost = true;
|
|
|
| @@ -770,7 +711,7 @@ void WebGLRenderingContext::destroyContext()
|
| }
|
| }
|
|
|
| -void WebGLRenderingContext::markContextChanged()
|
| +void WebGLRenderingContextBase::markContextChanged()
|
| {
|
| if (m_framebufferBinding || isContextLost())
|
| return;
|
| @@ -791,7 +732,7 @@ void WebGLRenderingContext::markContextChanged()
|
| }
|
| }
|
|
|
| -bool WebGLRenderingContext::clearIfComposited(GLbitfield mask)
|
| +bool WebGLRenderingContextBase::clearIfComposited(GLbitfield mask)
|
| {
|
| if (isContextLost())
|
| return false;
|
| @@ -840,7 +781,7 @@ bool WebGLRenderingContext::clearIfComposited(GLbitfield mask)
|
| return combinedClear;
|
| }
|
|
|
| -void WebGLRenderingContext::restoreStateAfterClear()
|
| +void WebGLRenderingContextBase::restoreStateAfterClear()
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -858,13 +799,13 @@ void WebGLRenderingContext::restoreStateAfterClear()
|
| m_context->depthMask(m_depthMask);
|
| }
|
|
|
| -void WebGLRenderingContext::markLayerComposited()
|
| +void WebGLRenderingContextBase::markLayerComposited()
|
| {
|
| if (!isContextLost())
|
| m_drawingBuffer->markLayerComposited();
|
| }
|
|
|
| -void WebGLRenderingContext::paintRenderingResultsToCanvas()
|
| +void WebGLRenderingContextBase::paintRenderingResultsToCanvas()
|
| {
|
| if (isContextLost()) {
|
| canvas()->clearPresentationCopy();
|
| @@ -903,7 +844,7 @@ void WebGLRenderingContext::paintRenderingResultsToCanvas()
|
| m_drawingBuffer->bind();
|
| }
|
|
|
| -PassRefPtr<ImageData> WebGLRenderingContext::paintRenderingResultsToImageData()
|
| +PassRefPtr<ImageData> WebGLRenderingContextBase::paintRenderingResultsToImageData()
|
| {
|
| if (isContextLost())
|
| return nullptr;
|
| @@ -923,12 +864,12 @@ PassRefPtr<ImageData> WebGLRenderingContext::paintRenderingResultsToImageData()
|
| return ImageData::create(IntSize(width, height), imageDataPixels);
|
| }
|
|
|
| -void WebGLRenderingContext::reshape(int width, int height)
|
| +void WebGLRenderingContextBase::reshape(int width, int height)
|
| {
|
| if (isContextLost())
|
| return;
|
|
|
| - // This is an approximation because at WebGLRenderingContext level we don't
|
| + // This is an approximation because at WebGLRenderingContextBase level we don't
|
| // know if the underlying FBO uses textures or renderbuffers.
|
| GLint maxSize = std::min(m_maxTextureSize, m_maxRenderbufferSize);
|
| // Limit drawing buffer size to 4k to avoid memory exhaustion.
|
| @@ -957,17 +898,17 @@ void WebGLRenderingContext::reshape(int width, int height)
|
| m_context->bindFramebuffer(GL_FRAMEBUFFER, objectOrZero(m_framebufferBinding.get()));
|
| }
|
|
|
| -int WebGLRenderingContext::drawingBufferWidth() const
|
| +int WebGLRenderingContextBase::drawingBufferWidth() const
|
| {
|
| return m_drawingBuffer->size().width();
|
| }
|
|
|
| -int WebGLRenderingContext::drawingBufferHeight() const
|
| +int WebGLRenderingContextBase::drawingBufferHeight() const
|
| {
|
| return m_drawingBuffer->size().height();
|
| }
|
|
|
| -unsigned WebGLRenderingContext::sizeInBytes(GLenum type)
|
| +unsigned WebGLRenderingContextBase::sizeInBytes(GLenum type)
|
| {
|
| switch (type) {
|
| case GL_BYTE:
|
| @@ -989,7 +930,7 @@ unsigned WebGLRenderingContext::sizeInBytes(GLenum type)
|
| return 0;
|
| }
|
|
|
| -void WebGLRenderingContext::activeTexture(GLenum texture)
|
| +void WebGLRenderingContextBase::activeTexture(GLenum texture)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1004,7 +945,7 @@ void WebGLRenderingContext::activeTexture(GLenum texture)
|
|
|
| }
|
|
|
| -void WebGLRenderingContext::attachShader(WebGLProgram* program, WebGLShader* shader)
|
| +void WebGLRenderingContextBase::attachShader(WebGLProgram* program, WebGLShader* shader)
|
| {
|
| if (isContextLost() || !validateWebGLObject("attachShader", program) || !validateWebGLObject("attachShader", shader))
|
| return;
|
| @@ -1016,7 +957,7 @@ void WebGLRenderingContext::attachShader(WebGLProgram* program, WebGLShader* sha
|
| shader->onAttached();
|
| }
|
|
|
| -void WebGLRenderingContext::bindAttribLocation(WebGLProgram* program, GLuint index, const String& name)
|
| +void WebGLRenderingContextBase::bindAttribLocation(WebGLProgram* program, GLuint index, const String& name)
|
| {
|
| if (isContextLost() || !validateWebGLObject("bindAttribLocation", program))
|
| return;
|
| @@ -1035,7 +976,7 @@ void WebGLRenderingContext::bindAttribLocation(WebGLProgram* program, GLuint ind
|
| m_context->bindAttribLocation(objectOrZero(program), index, name.utf8().data());
|
| }
|
|
|
| -bool WebGLRenderingContext::checkObjectToBeBound(const char* functionName, WebGLObject* object, bool& deleted)
|
| +bool WebGLRenderingContextBase::checkObjectToBeBound(const char* functionName, WebGLObject* object, bool& deleted)
|
| {
|
| deleted = false;
|
| if (isContextLost())
|
| @@ -1050,7 +991,7 @@ bool WebGLRenderingContext::checkObjectToBeBound(const char* functionName, WebGL
|
| return true;
|
| }
|
|
|
| -void WebGLRenderingContext::bindBuffer(GLenum target, WebGLBuffer* buffer)
|
| +void WebGLRenderingContextBase::bindBuffer(GLenum target, WebGLBuffer* buffer)
|
| {
|
| bool deleted;
|
| if (!checkObjectToBeBound("bindBuffer", buffer, deleted))
|
| @@ -1075,7 +1016,7 @@ void WebGLRenderingContext::bindBuffer(GLenum target, WebGLBuffer* buffer)
|
| buffer->setTarget(target);
|
| }
|
|
|
| -void WebGLRenderingContext::bindFramebuffer(GLenum target, WebGLFramebuffer* buffer)
|
| +void WebGLRenderingContextBase::bindFramebuffer(GLenum target, WebGLFramebuffer* buffer)
|
| {
|
| bool deleted;
|
| if (!checkObjectToBeBound("bindFramebuffer", buffer, deleted))
|
| @@ -1098,7 +1039,7 @@ void WebGLRenderingContext::bindFramebuffer(GLenum target, WebGLFramebuffer* buf
|
| applyStencilTest();
|
| }
|
|
|
| -void WebGLRenderingContext::bindRenderbuffer(GLenum target, WebGLRenderbuffer* renderBuffer)
|
| +void WebGLRenderingContextBase::bindRenderbuffer(GLenum target, WebGLRenderbuffer* renderBuffer)
|
| {
|
| bool deleted;
|
| if (!checkObjectToBeBound("bindRenderbuffer", renderBuffer, deleted))
|
| @@ -1115,7 +1056,7 @@ void WebGLRenderingContext::bindRenderbuffer(GLenum target, WebGLRenderbuffer* r
|
| renderBuffer->setHasEverBeenBound();
|
| }
|
|
|
| -void WebGLRenderingContext::bindTexture(GLenum target, WebGLTexture* texture)
|
| +void WebGLRenderingContextBase::bindTexture(GLenum target, WebGLTexture* texture)
|
| {
|
| bool deleted;
|
| if (!checkObjectToBeBound("bindTexture", texture, deleted))
|
| @@ -1164,21 +1105,21 @@ void WebGLRenderingContext::bindTexture(GLenum target, WebGLTexture* texture)
|
|
|
| }
|
|
|
| -void WebGLRenderingContext::blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
|
| +void WebGLRenderingContextBase::blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
|
| {
|
| if (isContextLost())
|
| return;
|
| m_context->blendColor(red, green, blue, alpha);
|
| }
|
|
|
| -void WebGLRenderingContext::blendEquation(GLenum mode)
|
| +void WebGLRenderingContextBase::blendEquation(GLenum mode)
|
| {
|
| if (isContextLost() || !validateBlendEquation("blendEquation", mode))
|
| return;
|
| m_context->blendEquation(mode);
|
| }
|
|
|
| -void WebGLRenderingContext::blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
|
| +void WebGLRenderingContextBase::blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
|
| {
|
| if (isContextLost() || !validateBlendEquation("blendEquationSeparate", modeRGB) || !validateBlendEquation("blendEquationSeparate", modeAlpha))
|
| return;
|
| @@ -1186,14 +1127,14 @@ void WebGLRenderingContext::blendEquationSeparate(GLenum modeRGB, GLenum modeAlp
|
| }
|
|
|
|
|
| -void WebGLRenderingContext::blendFunc(GLenum sfactor, GLenum dfactor)
|
| +void WebGLRenderingContextBase::blendFunc(GLenum sfactor, GLenum dfactor)
|
| {
|
| if (isContextLost() || !validateBlendFuncFactors("blendFunc", sfactor, dfactor))
|
| return;
|
| m_context->blendFunc(sfactor, dfactor);
|
| }
|
|
|
| -void WebGLRenderingContext::blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
|
| +void WebGLRenderingContextBase::blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
|
| {
|
| // Note: Alpha does not have the same restrictions as RGB.
|
| if (isContextLost() || !validateBlendFuncFactors("blendFuncSeparate", srcRGB, dstRGB))
|
| @@ -1201,7 +1142,7 @@ void WebGLRenderingContext::blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLen
|
| m_context->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
|
| }
|
|
|
| -void WebGLRenderingContext::bufferData(GLenum target, long long size, GLenum usage)
|
| +void WebGLRenderingContextBase::bufferData(GLenum target, long long size, GLenum usage)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1220,7 +1161,7 @@ void WebGLRenderingContext::bufferData(GLenum target, long long size, GLenum usa
|
| m_context->bufferData(target, static_cast<GLsizeiptr>(size), 0, usage);
|
| }
|
|
|
| -void WebGLRenderingContext::bufferData(GLenum target, ArrayBuffer* data, GLenum usage)
|
| +void WebGLRenderingContextBase::bufferData(GLenum target, ArrayBuffer* data, GLenum usage)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1234,7 +1175,7 @@ void WebGLRenderingContext::bufferData(GLenum target, ArrayBuffer* data, GLenum
|
| m_context->bufferData(target, data->byteLength(), data->data(), usage);
|
| }
|
|
|
| -void WebGLRenderingContext::bufferData(GLenum target, ArrayBufferView* data, GLenum usage)
|
| +void WebGLRenderingContextBase::bufferData(GLenum target, ArrayBufferView* data, GLenum usage)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1249,7 +1190,7 @@ void WebGLRenderingContext::bufferData(GLenum target, ArrayBufferView* data, GLe
|
| m_context->bufferData(target, data->byteLength(), data->baseAddress(), usage);
|
| }
|
|
|
| -void WebGLRenderingContext::bufferSubData(GLenum target, long long offset, ArrayBuffer* data)
|
| +void WebGLRenderingContextBase::bufferSubData(GLenum target, long long offset, ArrayBuffer* data)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1266,7 +1207,7 @@ void WebGLRenderingContext::bufferSubData(GLenum target, long long offset, Array
|
| m_context->bufferSubData(target, static_cast<GLintptr>(offset), data->byteLength(), data->data());
|
| }
|
|
|
| -void WebGLRenderingContext::bufferSubData(GLenum target, long long offset, ArrayBufferView* data)
|
| +void WebGLRenderingContextBase::bufferSubData(GLenum target, long long offset, ArrayBufferView* data)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1283,7 +1224,7 @@ void WebGLRenderingContext::bufferSubData(GLenum target, long long offset, Array
|
| m_context->bufferSubData(target, static_cast<GLintptr>(offset), data->byteLength(), data->baseAddress());
|
| }
|
|
|
| -GLenum WebGLRenderingContext::checkFramebufferStatus(GLenum target)
|
| +GLenum WebGLRenderingContextBase::checkFramebufferStatus(GLenum target)
|
| {
|
| if (isContextLost())
|
| return GL_FRAMEBUFFER_UNSUPPORTED;
|
| @@ -1303,7 +1244,7 @@ GLenum WebGLRenderingContext::checkFramebufferStatus(GLenum target)
|
| return result;
|
| }
|
|
|
| -void WebGLRenderingContext::clear(GLbitfield mask)
|
| +void WebGLRenderingContextBase::clear(GLbitfield mask)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1321,7 +1262,7 @@ void WebGLRenderingContext::clear(GLbitfield mask)
|
| markContextChanged();
|
| }
|
|
|
| -void WebGLRenderingContext::clearColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
|
| +void WebGLRenderingContextBase::clearColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1340,7 +1281,7 @@ void WebGLRenderingContext::clearColor(GLfloat r, GLfloat g, GLfloat b, GLfloat
|
| m_context->clearColor(r, g, b, a);
|
| }
|
|
|
| -void WebGLRenderingContext::clearDepth(GLfloat depth)
|
| +void WebGLRenderingContextBase::clearDepth(GLfloat depth)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1348,7 +1289,7 @@ void WebGLRenderingContext::clearDepth(GLfloat depth)
|
| m_context->clearDepth(depth);
|
| }
|
|
|
| -void WebGLRenderingContext::clearStencil(GLint s)
|
| +void WebGLRenderingContextBase::clearStencil(GLint s)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1356,7 +1297,7 @@ void WebGLRenderingContext::clearStencil(GLint s)
|
| m_context->clearStencil(s);
|
| }
|
|
|
| -void WebGLRenderingContext::colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
|
| +void WebGLRenderingContextBase::colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1367,14 +1308,14 @@ void WebGLRenderingContext::colorMask(GLboolean red, GLboolean green, GLboolean
|
| m_context->colorMask(red, green, blue, alpha);
|
| }
|
|
|
| -void WebGLRenderingContext::compileShader(WebGLShader* shader)
|
| +void WebGLRenderingContextBase::compileShader(WebGLShader* shader)
|
| {
|
| if (isContextLost() || !validateWebGLObject("compileShader", shader))
|
| return;
|
| m_context->compileShader(objectOrZero(shader));
|
| }
|
|
|
| -void WebGLRenderingContext::compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, ArrayBufferView* data)
|
| +void WebGLRenderingContextBase::compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, ArrayBufferView* data)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1408,7 +1349,7 @@ void WebGLRenderingContext::compressedTexImage2D(GLenum target, GLint level, GLe
|
| tex->setLevelInfo(target, level, internalformat, width, height, GL_UNSIGNED_BYTE);
|
| }
|
|
|
| -void WebGLRenderingContext::compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, ArrayBufferView* data)
|
| +void WebGLRenderingContextBase::compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, ArrayBufferView* data)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1437,7 +1378,7 @@ void WebGLRenderingContext::compressedTexSubImage2D(GLenum target, GLint level,
|
| width, height, format, data->byteLength(), data->baseAddress());
|
| }
|
|
|
| -bool WebGLRenderingContext::validateSettableTexFormat(const char* functionName, GLenum format)
|
| +bool WebGLRenderingContextBase::validateSettableTexFormat(const char* functionName, GLenum format)
|
| {
|
| if (WebGLImageConversion::getClearBitsByFormat(format) & (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)) {
|
| synthesizeGLError(GL_INVALID_OPERATION, functionName, "format can not be set, only rendered to");
|
| @@ -1446,7 +1387,7 @@ bool WebGLRenderingContext::validateSettableTexFormat(const char* functionName,
|
| return true;
|
| }
|
|
|
| -void WebGLRenderingContext::copyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
|
| +void WebGLRenderingContextBase::copyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1477,7 +1418,7 @@ void WebGLRenderingContext::copyTexImage2D(GLenum target, GLint level, GLenum in
|
| tex->setLevelInfo(target, level, internalformat, width, height, GL_UNSIGNED_BYTE);
|
| }
|
|
|
| -void WebGLRenderingContext::copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
|
| +void WebGLRenderingContextBase::copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1518,7 +1459,7 @@ void WebGLRenderingContext::copyTexSubImage2D(GLenum target, GLint level, GLint
|
| m_context->copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
|
| }
|
|
|
| -PassRefPtr<WebGLBuffer> WebGLRenderingContext::createBuffer()
|
| +PassRefPtr<WebGLBuffer> WebGLRenderingContextBase::createBuffer()
|
| {
|
| if (isContextLost())
|
| return nullptr;
|
| @@ -1527,7 +1468,7 @@ PassRefPtr<WebGLBuffer> WebGLRenderingContext::createBuffer()
|
| return o;
|
| }
|
|
|
| -PassRefPtr<WebGLFramebuffer> WebGLRenderingContext::createFramebuffer()
|
| +PassRefPtr<WebGLFramebuffer> WebGLRenderingContextBase::createFramebuffer()
|
| {
|
| if (isContextLost())
|
| return nullptr;
|
| @@ -1536,7 +1477,7 @@ PassRefPtr<WebGLFramebuffer> WebGLRenderingContext::createFramebuffer()
|
| return o;
|
| }
|
|
|
| -PassRefPtr<WebGLTexture> WebGLRenderingContext::createTexture()
|
| +PassRefPtr<WebGLTexture> WebGLRenderingContextBase::createTexture()
|
| {
|
| if (isContextLost())
|
| return nullptr;
|
| @@ -1545,7 +1486,7 @@ PassRefPtr<WebGLTexture> WebGLRenderingContext::createTexture()
|
| return o;
|
| }
|
|
|
| -PassRefPtr<WebGLProgram> WebGLRenderingContext::createProgram()
|
| +PassRefPtr<WebGLProgram> WebGLRenderingContextBase::createProgram()
|
| {
|
| if (isContextLost())
|
| return nullptr;
|
| @@ -1554,7 +1495,7 @@ PassRefPtr<WebGLProgram> WebGLRenderingContext::createProgram()
|
| return o;
|
| }
|
|
|
| -PassRefPtr<WebGLRenderbuffer> WebGLRenderingContext::createRenderbuffer()
|
| +PassRefPtr<WebGLRenderbuffer> WebGLRenderingContextBase::createRenderbuffer()
|
| {
|
| if (isContextLost())
|
| return nullptr;
|
| @@ -1563,7 +1504,7 @@ PassRefPtr<WebGLRenderbuffer> WebGLRenderingContext::createRenderbuffer()
|
| return o;
|
| }
|
|
|
| -WebGLRenderbuffer* WebGLRenderingContext::ensureEmulatedStencilBuffer(GLenum target, WebGLRenderbuffer* renderbuffer)
|
| +WebGLRenderbuffer* WebGLRenderingContextBase::ensureEmulatedStencilBuffer(GLenum target, WebGLRenderbuffer* renderbuffer)
|
| {
|
| if (isContextLost())
|
| return 0;
|
| @@ -1575,7 +1516,7 @@ WebGLRenderbuffer* WebGLRenderingContext::ensureEmulatedStencilBuffer(GLenum tar
|
| return renderbuffer->emulatedStencilBuffer();
|
| }
|
|
|
| -PassRefPtr<WebGLShader> WebGLRenderingContext::createShader(GLenum type)
|
| +PassRefPtr<WebGLShader> WebGLRenderingContextBase::createShader(GLenum type)
|
| {
|
| if (isContextLost())
|
| return nullptr;
|
| @@ -1589,7 +1530,7 @@ PassRefPtr<WebGLShader> WebGLRenderingContext::createShader(GLenum type)
|
| return o;
|
| }
|
|
|
| -void WebGLRenderingContext::cullFace(GLenum mode)
|
| +void WebGLRenderingContextBase::cullFace(GLenum mode)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1605,7 +1546,7 @@ void WebGLRenderingContext::cullFace(GLenum mode)
|
| m_context->cullFace(mode);
|
| }
|
|
|
| -bool WebGLRenderingContext::deleteObject(WebGLObject* object)
|
| +bool WebGLRenderingContextBase::deleteObject(WebGLObject* object)
|
| {
|
| if (isContextLost() || !object)
|
| return false;
|
| @@ -1621,7 +1562,7 @@ bool WebGLRenderingContext::deleteObject(WebGLObject* object)
|
| return true;
|
| }
|
|
|
| -void WebGLRenderingContext::deleteBuffer(WebGLBuffer* buffer)
|
| +void WebGLRenderingContextBase::deleteBuffer(WebGLBuffer* buffer)
|
| {
|
| if (!deleteObject(buffer))
|
| return;
|
| @@ -1631,7 +1572,7 @@ void WebGLRenderingContext::deleteBuffer(WebGLBuffer* buffer)
|
| m_boundVertexArrayObject->unbindBuffer(buffer);
|
| }
|
|
|
| -void WebGLRenderingContext::deleteFramebuffer(WebGLFramebuffer* framebuffer)
|
| +void WebGLRenderingContextBase::deleteFramebuffer(WebGLFramebuffer* framebuffer)
|
| {
|
| if (!deleteObject(framebuffer))
|
| return;
|
| @@ -1643,14 +1584,14 @@ void WebGLRenderingContext::deleteFramebuffer(WebGLFramebuffer* framebuffer)
|
| }
|
| }
|
|
|
| -void WebGLRenderingContext::deleteProgram(WebGLProgram* program)
|
| +void WebGLRenderingContextBase::deleteProgram(WebGLProgram* program)
|
| {
|
| deleteObject(program);
|
| // We don't reset m_currentProgram to 0 here because the deletion of the
|
| // current program is delayed.
|
| }
|
|
|
| -void WebGLRenderingContext::deleteRenderbuffer(WebGLRenderbuffer* renderbuffer)
|
| +void WebGLRenderingContextBase::deleteRenderbuffer(WebGLRenderbuffer* renderbuffer)
|
| {
|
| if (!deleteObject(renderbuffer))
|
| return;
|
| @@ -1660,12 +1601,12 @@ void WebGLRenderingContext::deleteRenderbuffer(WebGLRenderbuffer* renderbuffer)
|
| m_framebufferBinding->removeAttachmentFromBoundFramebuffer(renderbuffer);
|
| }
|
|
|
| -void WebGLRenderingContext::deleteShader(WebGLShader* shader)
|
| +void WebGLRenderingContextBase::deleteShader(WebGLShader* shader)
|
| {
|
| deleteObject(shader);
|
| }
|
|
|
| -void WebGLRenderingContext::deleteTexture(WebGLTexture* texture)
|
| +void WebGLRenderingContextBase::deleteTexture(WebGLTexture* texture)
|
| {
|
| if (!deleteObject(texture))
|
| return;
|
| @@ -1692,7 +1633,7 @@ void WebGLRenderingContext::deleteTexture(WebGLTexture* texture)
|
| }
|
| }
|
|
|
| -void WebGLRenderingContext::depthFunc(GLenum func)
|
| +void WebGLRenderingContextBase::depthFunc(GLenum func)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1701,7 +1642,7 @@ void WebGLRenderingContext::depthFunc(GLenum func)
|
| m_context->depthFunc(func);
|
| }
|
|
|
| -void WebGLRenderingContext::depthMask(GLboolean flag)
|
| +void WebGLRenderingContextBase::depthMask(GLboolean flag)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1709,7 +1650,7 @@ void WebGLRenderingContext::depthMask(GLboolean flag)
|
| m_context->depthMask(flag);
|
| }
|
|
|
| -void WebGLRenderingContext::depthRange(GLfloat zNear, GLfloat zFar)
|
| +void WebGLRenderingContextBase::depthRange(GLfloat zNear, GLfloat zFar)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1720,7 +1661,7 @@ void WebGLRenderingContext::depthRange(GLfloat zNear, GLfloat zFar)
|
| m_context->depthRange(zNear, zFar);
|
| }
|
|
|
| -void WebGLRenderingContext::detachShader(WebGLProgram* program, WebGLShader* shader)
|
| +void WebGLRenderingContextBase::detachShader(WebGLProgram* program, WebGLShader* shader)
|
| {
|
| if (isContextLost() || !validateWebGLObject("detachShader", program) || !validateWebGLObject("detachShader", shader))
|
| return;
|
| @@ -1732,7 +1673,7 @@ void WebGLRenderingContext::detachShader(WebGLProgram* program, WebGLShader* sha
|
| shader->onDetached(m_context.get());
|
| }
|
|
|
| -void WebGLRenderingContext::disable(GLenum cap)
|
| +void WebGLRenderingContextBase::disable(GLenum cap)
|
| {
|
| if (isContextLost() || !validateCapability("disable", cap))
|
| return;
|
| @@ -1748,7 +1689,7 @@ void WebGLRenderingContext::disable(GLenum cap)
|
| m_context->disable(cap);
|
| }
|
|
|
| -void WebGLRenderingContext::disableVertexAttribArray(GLuint index)
|
| +void WebGLRenderingContextBase::disableVertexAttribArray(GLuint index)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1768,7 +1709,7 @@ void WebGLRenderingContext::disableVertexAttribArray(GLuint index)
|
| m_context->disableVertexAttribArray(index);
|
| }
|
|
|
| -bool WebGLRenderingContext::validateRenderingState(const char* functionName)
|
| +bool WebGLRenderingContextBase::validateRenderingState(const char* functionName)
|
| {
|
| if (!m_currentProgram) {
|
| synthesizeGLError(GL_INVALID_OPERATION, functionName, "no valid shader program in use");
|
| @@ -1788,7 +1729,7 @@ bool WebGLRenderingContext::validateRenderingState(const char* functionName)
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateWebGLObject(const char* functionName, WebGLObject* object)
|
| +bool WebGLRenderingContextBase::validateWebGLObject(const char* functionName, WebGLObject* object)
|
| {
|
| if (!object || !object->object()) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "no object or object deleted");
|
| @@ -1801,7 +1742,7 @@ bool WebGLRenderingContext::validateWebGLObject(const char* functionName, WebGLO
|
| return true;
|
| }
|
|
|
| -void WebGLRenderingContext::drawArrays(GLenum mode, GLint first, GLsizei count)
|
| +void WebGLRenderingContextBase::drawArrays(GLenum mode, GLint first, GLsizei count)
|
| {
|
| if (!validateDrawArrays("drawArrays", mode, first, count))
|
| return;
|
| @@ -1814,7 +1755,7 @@ void WebGLRenderingContext::drawArrays(GLenum mode, GLint first, GLsizei count)
|
| markContextChanged();
|
| }
|
|
|
| -void WebGLRenderingContext::drawElements(GLenum mode, GLsizei count, GLenum type, long long offset)
|
| +void WebGLRenderingContextBase::drawElements(GLenum mode, GLsizei count, GLenum type, long long offset)
|
| {
|
| if (!validateDrawElements("drawElements", mode, count, type, offset))
|
| return;
|
| @@ -1827,7 +1768,7 @@ void WebGLRenderingContext::drawElements(GLenum mode, GLsizei count, GLenum type
|
| markContextChanged();
|
| }
|
|
|
| -void WebGLRenderingContext::drawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
|
| +void WebGLRenderingContextBase::drawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
|
| {
|
| if (!validateDrawArrays("drawArraysInstancedANGLE", mode, first, count))
|
| return;
|
| @@ -1843,7 +1784,7 @@ void WebGLRenderingContext::drawArraysInstancedANGLE(GLenum mode, GLint first, G
|
| markContextChanged();
|
| }
|
|
|
| -void WebGLRenderingContext::drawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount)
|
| +void WebGLRenderingContextBase::drawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount)
|
| {
|
| if (!validateDrawElements("drawElementsInstancedANGLE", mode, count, type, offset))
|
| return;
|
| @@ -1859,7 +1800,7 @@ void WebGLRenderingContext::drawElementsInstancedANGLE(GLenum mode, GLsizei coun
|
| markContextChanged();
|
| }
|
|
|
| -void WebGLRenderingContext::enable(GLenum cap)
|
| +void WebGLRenderingContextBase::enable(GLenum cap)
|
| {
|
| if (isContextLost() || !validateCapability("enable", cap))
|
| return;
|
| @@ -1875,7 +1816,7 @@ void WebGLRenderingContext::enable(GLenum cap)
|
| m_context->enable(cap);
|
| }
|
|
|
| -void WebGLRenderingContext::enableVertexAttribArray(GLuint index)
|
| +void WebGLRenderingContextBase::enableVertexAttribArray(GLuint index)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -1892,21 +1833,21 @@ void WebGLRenderingContext::enableVertexAttribArray(GLuint index)
|
| m_context->enableVertexAttribArray(index);
|
| }
|
|
|
| -void WebGLRenderingContext::finish()
|
| +void WebGLRenderingContextBase::finish()
|
| {
|
| if (isContextLost())
|
| return;
|
| m_context->flush(); // Intentionally a flush, not a finish.
|
| }
|
|
|
| -void WebGLRenderingContext::flush()
|
| +void WebGLRenderingContextBase::flush()
|
| {
|
| if (isContextLost())
|
| return;
|
| m_context->flush();
|
| }
|
|
|
| -void WebGLRenderingContext::framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer* buffer)
|
| +void WebGLRenderingContextBase::framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer* buffer)
|
| {
|
| if (isContextLost() || !validateFramebufferFuncParameters("framebufferRenderbuffer", target, attachment))
|
| return;
|
| @@ -1948,7 +1889,7 @@ void WebGLRenderingContext::framebufferRenderbuffer(GLenum target, GLenum attach
|
| applyStencilTest();
|
| }
|
|
|
| -void WebGLRenderingContext::framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture* texture, GLint level)
|
| +void WebGLRenderingContextBase::framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture* texture, GLint level)
|
| {
|
| if (isContextLost() || !validateFramebufferFuncParameters("framebufferTexture2D", target, attachment))
|
| return;
|
| @@ -1986,7 +1927,7 @@ void WebGLRenderingContext::framebufferTexture2D(GLenum target, GLenum attachmen
|
| applyStencilTest();
|
| }
|
|
|
| -void WebGLRenderingContext::frontFace(GLenum mode)
|
| +void WebGLRenderingContextBase::frontFace(GLenum mode)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -2001,7 +1942,7 @@ void WebGLRenderingContext::frontFace(GLenum mode)
|
| m_context->frontFace(mode);
|
| }
|
|
|
| -void WebGLRenderingContext::generateMipmap(GLenum target)
|
| +void WebGLRenderingContextBase::generateMipmap(GLenum target)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -2032,7 +1973,7 @@ void WebGLRenderingContext::generateMipmap(GLenum target)
|
| tex->generateMipmapLevelInfo();
|
| }
|
|
|
| -PassRefPtr<WebGLActiveInfo> WebGLRenderingContext::getActiveAttrib(WebGLProgram* program, GLuint index)
|
| +PassRefPtr<WebGLActiveInfo> WebGLRenderingContextBase::getActiveAttrib(WebGLProgram* program, GLuint index)
|
| {
|
| if (isContextLost() || !validateWebGLObject("getActiveAttrib", program))
|
| return nullptr;
|
| @@ -2042,7 +1983,7 @@ PassRefPtr<WebGLActiveInfo> WebGLRenderingContext::getActiveAttrib(WebGLProgram*
|
| return WebGLActiveInfo::create(info.name, info.type, info.size);
|
| }
|
|
|
| -PassRefPtr<WebGLActiveInfo> WebGLRenderingContext::getActiveUniform(WebGLProgram* program, GLuint index)
|
| +PassRefPtr<WebGLActiveInfo> WebGLRenderingContextBase::getActiveUniform(WebGLProgram* program, GLuint index)
|
| {
|
| if (isContextLost() || !validateWebGLObject("getActiveUniform", program))
|
| return nullptr;
|
| @@ -2052,7 +1993,7 @@ PassRefPtr<WebGLActiveInfo> WebGLRenderingContext::getActiveUniform(WebGLProgram
|
| return WebGLActiveInfo::create(info.name, info.type, info.size);
|
| }
|
|
|
| -bool WebGLRenderingContext::getAttachedShaders(WebGLProgram* program, Vector<RefPtr<WebGLShader> >& shaderObjects)
|
| +bool WebGLRenderingContextBase::getAttachedShaders(WebGLProgram* program, Vector<RefPtr<WebGLShader> >& shaderObjects)
|
| {
|
| shaderObjects.clear();
|
| if (isContextLost() || !validateWebGLObject("getAttachedShaders", program))
|
| @@ -2070,7 +2011,7 @@ bool WebGLRenderingContext::getAttachedShaders(WebGLProgram* program, Vector<Ref
|
| return true;
|
| }
|
|
|
| -GLint WebGLRenderingContext::getAttribLocation(WebGLProgram* program, const String& name)
|
| +GLint WebGLRenderingContextBase::getAttribLocation(WebGLProgram* program, const String& name)
|
| {
|
| if (isContextLost() || !validateWebGLObject("getAttribLocation", program))
|
| return -1;
|
| @@ -2087,7 +2028,7 @@ GLint WebGLRenderingContext::getAttribLocation(WebGLProgram* program, const Stri
|
| return m_context->getAttribLocation(objectOrZero(program), name.utf8().data());
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getBufferParameter(GLenum target, GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getBufferParameter(GLenum target, GLenum pname)
|
| {
|
| if (isContextLost())
|
| return WebGLGetInfo();
|
| @@ -2108,7 +2049,7 @@ WebGLGetInfo WebGLRenderingContext::getBufferParameter(GLenum target, GLenum pna
|
| return WebGLGetInfo(static_cast<unsigned>(value));
|
| }
|
|
|
| -PassRefPtr<WebGLContextAttributes> WebGLRenderingContext::getContextAttributes()
|
| +PassRefPtr<WebGLContextAttributes> WebGLRenderingContextBase::getContextAttributes()
|
| {
|
| if (isContextLost())
|
| return nullptr;
|
| @@ -2126,7 +2067,7 @@ PassRefPtr<WebGLContextAttributes> WebGLRenderingContext::getContextAttributes()
|
| return attributes.release();
|
| }
|
|
|
| -GLenum WebGLRenderingContext::getError()
|
| +GLenum WebGLRenderingContextBase::getError()
|
| {
|
| if (m_lostContextErrors.size()) {
|
| GLenum err = m_lostContextErrors.first();
|
| @@ -2140,7 +2081,7 @@ GLenum WebGLRenderingContext::getError()
|
| return m_context->getError();
|
| }
|
|
|
| -bool WebGLRenderingContext::ExtensionTracker::matchesNameWithPrefixes(const String& name) const
|
| +bool WebGLRenderingContextBase::ExtensionTracker::matchesNameWithPrefixes(const String& name) const
|
| {
|
| static const char* const unprefixed[] = { "", 0, };
|
|
|
| @@ -2154,7 +2095,7 @@ bool WebGLRenderingContext::ExtensionTracker::matchesNameWithPrefixes(const Stri
|
| return false;
|
| }
|
|
|
| -PassRefPtr<WebGLExtension> WebGLRenderingContext::getExtension(const String& name)
|
| +PassRefPtr<WebGLExtension> WebGLRenderingContextBase::getExtension(const String& name)
|
| {
|
| if (isContextLost())
|
| return nullptr;
|
| @@ -2170,14 +2111,18 @@ PassRefPtr<WebGLExtension> WebGLRenderingContext::getExtension(const String& nam
|
| return nullptr;
|
| if (!tracker->supported(this))
|
| return nullptr;
|
| - return tracker->getExtension(this);
|
| +
|
| + RefPtr<WebGLExtension> extension = tracker->getExtension(this);
|
| + if (extension)
|
| + m_extensionEnabled[extension->name()] = true;
|
| + return extension.release();
|
| }
|
| }
|
|
|
| return nullptr;
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname)
|
| {
|
| if (isContextLost() || !validateFramebufferFuncParameters("getFramebufferAttachmentParameter", target, attachment))
|
| return WebGLGetInfo();
|
| @@ -2228,7 +2173,7 @@ WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(GLenum tar
|
| }
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getParameter(GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getParameter(GLenum pname)
|
| {
|
| if (isContextLost())
|
| return WebGLGetInfo();
|
| @@ -2412,22 +2357,22 @@ WebGLGetInfo WebGLRenderingContext::getParameter(GLenum pname)
|
| case GL_VIEWPORT:
|
| return getWebGLIntArrayParameter(pname);
|
| case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: // OES_standard_derivatives
|
| - if (m_oesStandardDerivatives)
|
| + if (extensionEnabled(OESStandardDerivativesName))
|
| return getUnsignedIntParameter(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES);
|
| synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, OES_standard_derivatives not enabled");
|
| return WebGLGetInfo();
|
| case WebGLDebugRendererInfo::UNMASKED_RENDERER_WEBGL:
|
| - if (m_webglDebugRendererInfo)
|
| + if (extensionEnabled(WebGLDebugRendererInfoName))
|
| return WebGLGetInfo(m_context->getString(GL_RENDERER));
|
| synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
|
| return WebGLGetInfo();
|
| case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL:
|
| - if (m_webglDebugRendererInfo)
|
| + if (extensionEnabled(WebGLDebugRendererInfoName))
|
| return WebGLGetInfo(m_context->getString(GL_VENDOR));
|
| synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
|
| return WebGLGetInfo();
|
| case GL_VERTEX_ARRAY_BINDING_OES: // OES_vertex_array_object
|
| - if (m_oesVertexArrayObject) {
|
| + if (extensionEnabled(OESVertexArrayObjectName)) {
|
| if (!m_boundVertexArrayObject->isDefaultObject())
|
| return WebGLGetInfo(PassRefPtr<WebGLVertexArrayObjectOES>(m_boundVertexArrayObject));
|
| return WebGLGetInfo();
|
| @@ -2435,22 +2380,22 @@ WebGLGetInfo WebGLRenderingContext::getParameter(GLenum pname)
|
| synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, OES_vertex_array_object not enabled");
|
| return WebGLGetInfo();
|
| case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic
|
| - if (m_extTextureFilterAnisotropic)
|
| + if (extensionEnabled(EXTTextureFilterAnisotropicName))
|
| return getUnsignedIntParameter(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT);
|
| synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, EXT_texture_filter_anisotropic not enabled");
|
| return WebGLGetInfo();
|
| case GL_MAX_COLOR_ATTACHMENTS_EXT: // EXT_draw_buffers BEGIN
|
| - if (m_webglDrawBuffers)
|
| + if (extensionEnabled(WebGLDrawBuffersName))
|
| return WebGLGetInfo(maxColorAttachments());
|
| synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_draw_buffers not enabled");
|
| return WebGLGetInfo();
|
| case GL_MAX_DRAW_BUFFERS_EXT:
|
| - if (m_webglDrawBuffers)
|
| + if (extensionEnabled(WebGLDrawBuffersName))
|
| return WebGLGetInfo(maxDrawBuffers());
|
| synthesizeGLError(GL_INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_draw_buffers not enabled");
|
| return WebGLGetInfo();
|
| default:
|
| - if (m_webglDrawBuffers
|
| + if (extensionEnabled(WebGLDrawBuffersName)
|
| && pname >= GL_DRAW_BUFFER0_EXT
|
| && pname < static_cast<GLenum>(GL_DRAW_BUFFER0_EXT + maxDrawBuffers())) {
|
| GLint value = GL_NONE;
|
| @@ -2465,7 +2410,7 @@ WebGLGetInfo WebGLRenderingContext::getParameter(GLenum pname)
|
| }
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getProgramParameter(WebGLProgram* program, GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getProgramParameter(WebGLProgram* program, GLenum pname)
|
| {
|
| if (isContextLost() || !validateWebGLObject("getProgramParameter", program))
|
| return WebGLGetInfo();
|
| @@ -2490,7 +2435,7 @@ WebGLGetInfo WebGLRenderingContext::getProgramParameter(WebGLProgram* program, G
|
| }
|
| }
|
|
|
| -String WebGLRenderingContext::getProgramInfoLog(WebGLProgram* program)
|
| +String WebGLRenderingContextBase::getProgramInfoLog(WebGLProgram* program)
|
| {
|
| if (isContextLost())
|
| return String();
|
| @@ -2499,7 +2444,7 @@ String WebGLRenderingContext::getProgramInfoLog(WebGLProgram* program)
|
| return ensureNotNull(m_context->getProgramInfoLog(objectOrZero(program)));
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getRenderbufferParameter(GLenum target, GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getRenderbufferParameter(GLenum target, GLenum pname)
|
| {
|
| if (isContextLost())
|
| return WebGLGetInfo();
|
| @@ -2540,7 +2485,7 @@ WebGLGetInfo WebGLRenderingContext::getRenderbufferParameter(GLenum target, GLen
|
| }
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getShaderParameter(WebGLShader* shader, GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getShaderParameter(WebGLShader* shader, GLenum pname)
|
| {
|
| if (isContextLost() || !validateWebGLObject("getShaderParameter", shader))
|
| return WebGLGetInfo();
|
| @@ -2560,7 +2505,7 @@ WebGLGetInfo WebGLRenderingContext::getShaderParameter(WebGLShader* shader, GLen
|
| }
|
| }
|
|
|
| -String WebGLRenderingContext::getShaderInfoLog(WebGLShader* shader)
|
| +String WebGLRenderingContextBase::getShaderInfoLog(WebGLShader* shader)
|
| {
|
| if (isContextLost())
|
| return String();
|
| @@ -2569,7 +2514,7 @@ String WebGLRenderingContext::getShaderInfoLog(WebGLShader* shader)
|
| return ensureNotNull(m_context->getShaderInfoLog(objectOrZero(shader)));
|
| }
|
|
|
| -PassRefPtr<WebGLShaderPrecisionFormat> WebGLRenderingContext::getShaderPrecisionFormat(GLenum shaderType, GLenum precisionType)
|
| +PassRefPtr<WebGLShaderPrecisionFormat> WebGLRenderingContextBase::getShaderPrecisionFormat(GLenum shaderType, GLenum precisionType)
|
| {
|
| if (isContextLost())
|
| return nullptr;
|
| @@ -2600,7 +2545,7 @@ PassRefPtr<WebGLShaderPrecisionFormat> WebGLRenderingContext::getShaderPrecision
|
| return WebGLShaderPrecisionFormat::create(range[0], range[1], precision);
|
| }
|
|
|
| -String WebGLRenderingContext::getShaderSource(WebGLShader* shader)
|
| +String WebGLRenderingContextBase::getShaderSource(WebGLShader* shader)
|
| {
|
| if (isContextLost())
|
| return String();
|
| @@ -2609,7 +2554,7 @@ String WebGLRenderingContext::getShaderSource(WebGLShader* shader)
|
| return ensureNotNull(shader->source());
|
| }
|
|
|
| -Vector<String> WebGLRenderingContext::getSupportedExtensions()
|
| +Vector<String> WebGLRenderingContextBase::getSupportedExtensions()
|
| {
|
| Vector<String> result;
|
| if (isContextLost())
|
| @@ -2630,7 +2575,7 @@ Vector<String> WebGLRenderingContext::getSupportedExtensions()
|
| return result;
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getTexParameter(GLenum target, GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getTexParameter(GLenum target, GLenum pname)
|
| {
|
| if (isContextLost())
|
| return WebGLGetInfo();
|
| @@ -2646,7 +2591,7 @@ WebGLGetInfo WebGLRenderingContext::getTexParameter(GLenum target, GLenum pname)
|
| m_context->getTexParameteriv(target, pname, &value);
|
| return WebGLGetInfo(static_cast<unsigned>(value));
|
| case GL_TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic
|
| - if (m_extTextureFilterAnisotropic) {
|
| + if (extensionEnabled(EXTTextureFilterAnisotropicName)) {
|
| m_context->getTexParameteriv(target, pname, &value);
|
| return WebGLGetInfo(static_cast<unsigned>(value));
|
| }
|
| @@ -2658,7 +2603,7 @@ WebGLGetInfo WebGLRenderingContext::getTexParameter(GLenum target, GLenum pname)
|
| }
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getUniform(WebGLProgram* program, const WebGLUniformLocation* uniformLocation)
|
| +WebGLGetInfo WebGLRenderingContextBase::getUniform(WebGLProgram* program, const WebGLUniformLocation* uniformLocation)
|
| {
|
| if (isContextLost() || !validateWebGLObject("getUniform", program))
|
| return WebGLGetInfo();
|
| @@ -2803,7 +2748,7 @@ WebGLGetInfo WebGLRenderingContext::getUniform(WebGLProgram* program, const WebG
|
| return WebGLGetInfo();
|
| }
|
|
|
| -PassRefPtr<WebGLUniformLocation> WebGLRenderingContext::getUniformLocation(WebGLProgram* program, const String& name)
|
| +PassRefPtr<WebGLUniformLocation> WebGLRenderingContextBase::getUniformLocation(WebGLProgram* program, const String& name)
|
| {
|
| if (isContextLost() || !validateWebGLObject("getUniformLocation", program))
|
| return nullptr;
|
| @@ -2823,7 +2768,7 @@ PassRefPtr<WebGLUniformLocation> WebGLRenderingContext::getUniformLocation(WebGL
|
| return WebGLUniformLocation::create(program, uniformLocation);
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getVertexAttrib(GLuint index, GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getVertexAttrib(GLuint index, GLenum pname)
|
| {
|
| if (isContextLost())
|
| return WebGLGetInfo();
|
| @@ -2833,7 +2778,7 @@ WebGLGetInfo WebGLRenderingContext::getVertexAttrib(GLuint index, GLenum pname)
|
| }
|
| const WebGLVertexArrayObjectOES::VertexAttribState& state = m_boundVertexArrayObject->getVertexAttribState(index);
|
|
|
| - if (m_angleInstancedArrays && pname == GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)
|
| + if (extensionEnabled(ANGLEInstancedArraysName) && pname == GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)
|
| return WebGLGetInfo(state.divisor);
|
|
|
| switch (pname) {
|
| @@ -2859,7 +2804,7 @@ WebGLGetInfo WebGLRenderingContext::getVertexAttrib(GLuint index, GLenum pname)
|
| }
|
| }
|
|
|
| -long long WebGLRenderingContext::getVertexAttribOffset(GLuint index, GLenum pname)
|
| +long long WebGLRenderingContextBase::getVertexAttribOffset(GLuint index, GLenum pname)
|
| {
|
| if (isContextLost())
|
| return 0;
|
| @@ -2871,7 +2816,7 @@ long long WebGLRenderingContext::getVertexAttribOffset(GLuint index, GLenum pnam
|
| return static_cast<long long>(result);
|
| }
|
|
|
| -void WebGLRenderingContext::hint(GLenum target, GLenum mode)
|
| +void WebGLRenderingContextBase::hint(GLenum target, GLenum mode)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -2881,7 +2826,7 @@ void WebGLRenderingContext::hint(GLenum target, GLenum mode)
|
| isValid = true;
|
| break;
|
| case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: // OES_standard_derivatives
|
| - if (m_oesStandardDerivatives)
|
| + if (extensionEnabled(OESStandardDerivativesName))
|
| isValid = true;
|
| break;
|
| }
|
| @@ -2892,7 +2837,7 @@ void WebGLRenderingContext::hint(GLenum target, GLenum mode)
|
| m_context->hint(target, mode);
|
| }
|
|
|
| -GLboolean WebGLRenderingContext::isBuffer(WebGLBuffer* buffer)
|
| +GLboolean WebGLRenderingContextBase::isBuffer(WebGLBuffer* buffer)
|
| {
|
| if (!buffer || isContextLost())
|
| return 0;
|
| @@ -2903,12 +2848,12 @@ GLboolean WebGLRenderingContext::isBuffer(WebGLBuffer* buffer)
|
| return m_context->isBuffer(buffer->object());
|
| }
|
|
|
| -bool WebGLRenderingContext::isContextLost()
|
| +bool WebGLRenderingContextBase::isContextLost()
|
| {
|
| return m_contextLost;
|
| }
|
|
|
| -GLboolean WebGLRenderingContext::isEnabled(GLenum cap)
|
| +GLboolean WebGLRenderingContextBase::isEnabled(GLenum cap)
|
| {
|
| if (isContextLost() || !validateCapability("isEnabled", cap))
|
| return 0;
|
| @@ -2917,7 +2862,7 @@ GLboolean WebGLRenderingContext::isEnabled(GLenum cap)
|
| return m_context->isEnabled(cap);
|
| }
|
|
|
| -GLboolean WebGLRenderingContext::isFramebuffer(WebGLFramebuffer* framebuffer)
|
| +GLboolean WebGLRenderingContextBase::isFramebuffer(WebGLFramebuffer* framebuffer)
|
| {
|
| if (!framebuffer || isContextLost())
|
| return 0;
|
| @@ -2928,7 +2873,7 @@ GLboolean WebGLRenderingContext::isFramebuffer(WebGLFramebuffer* framebuffer)
|
| return m_context->isFramebuffer(framebuffer->object());
|
| }
|
|
|
| -GLboolean WebGLRenderingContext::isProgram(WebGLProgram* program)
|
| +GLboolean WebGLRenderingContextBase::isProgram(WebGLProgram* program)
|
| {
|
| if (!program || isContextLost())
|
| return 0;
|
| @@ -2936,7 +2881,7 @@ GLboolean WebGLRenderingContext::isProgram(WebGLProgram* program)
|
| return m_context->isProgram(program->object());
|
| }
|
|
|
| -GLboolean WebGLRenderingContext::isRenderbuffer(WebGLRenderbuffer* renderbuffer)
|
| +GLboolean WebGLRenderingContextBase::isRenderbuffer(WebGLRenderbuffer* renderbuffer)
|
| {
|
| if (!renderbuffer || isContextLost())
|
| return 0;
|
| @@ -2947,7 +2892,7 @@ GLboolean WebGLRenderingContext::isRenderbuffer(WebGLRenderbuffer* renderbuffer)
|
| return m_context->isRenderbuffer(renderbuffer->object());
|
| }
|
|
|
| -GLboolean WebGLRenderingContext::isShader(WebGLShader* shader)
|
| +GLboolean WebGLRenderingContextBase::isShader(WebGLShader* shader)
|
| {
|
| if (!shader || isContextLost())
|
| return 0;
|
| @@ -2955,7 +2900,7 @@ GLboolean WebGLRenderingContext::isShader(WebGLShader* shader)
|
| return m_context->isShader(shader->object());
|
| }
|
|
|
| -GLboolean WebGLRenderingContext::isTexture(WebGLTexture* texture)
|
| +GLboolean WebGLRenderingContextBase::isTexture(WebGLTexture* texture)
|
| {
|
| if (!texture || isContextLost())
|
| return 0;
|
| @@ -2966,14 +2911,14 @@ GLboolean WebGLRenderingContext::isTexture(WebGLTexture* texture)
|
| return m_context->isTexture(texture->object());
|
| }
|
|
|
| -void WebGLRenderingContext::lineWidth(GLfloat width)
|
| +void WebGLRenderingContextBase::lineWidth(GLfloat width)
|
| {
|
| if (isContextLost())
|
| return;
|
| m_context->lineWidth(width);
|
| }
|
|
|
| -void WebGLRenderingContext::linkProgram(WebGLProgram* program)
|
| +void WebGLRenderingContextBase::linkProgram(WebGLProgram* program)
|
| {
|
| if (isContextLost() || !validateWebGLObject("linkProgram", program))
|
| return;
|
| @@ -2982,7 +2927,7 @@ void WebGLRenderingContext::linkProgram(WebGLProgram* program)
|
| program->increaseLinkCount();
|
| }
|
|
|
| -void WebGLRenderingContext::pixelStorei(GLenum pname, GLint param)
|
| +void WebGLRenderingContextBase::pixelStorei(GLenum pname, GLint param)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -3022,14 +2967,14 @@ void WebGLRenderingContext::pixelStorei(GLenum pname, GLint param)
|
| }
|
| }
|
|
|
| -void WebGLRenderingContext::polygonOffset(GLfloat factor, GLfloat units)
|
| +void WebGLRenderingContextBase::polygonOffset(GLfloat factor, GLfloat units)
|
| {
|
| if (isContextLost())
|
| return;
|
| m_context->polygonOffset(factor, units);
|
| }
|
|
|
| -void WebGLRenderingContext::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView* pixels)
|
| +void WebGLRenderingContextBase::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView* pixels)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -3111,7 +3056,7 @@ void WebGLRenderingContext::readPixels(GLint x, GLint y, GLsizei width, GLsizei
|
| #endif
|
| }
|
|
|
| -void WebGLRenderingContext::renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
|
| +void WebGLRenderingContextBase::renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -3162,14 +3107,14 @@ void WebGLRenderingContext::renderbufferStorage(GLenum target, GLenum internalfo
|
| applyStencilTest();
|
| }
|
|
|
| -void WebGLRenderingContext::sampleCoverage(GLfloat value, GLboolean invert)
|
| +void WebGLRenderingContextBase::sampleCoverage(GLfloat value, GLboolean invert)
|
| {
|
| if (isContextLost())
|
| return;
|
| m_context->sampleCoverage(value, invert);
|
| }
|
|
|
| -void WebGLRenderingContext::scissor(GLint x, GLint y, GLsizei width, GLsizei height)
|
| +void WebGLRenderingContextBase::scissor(GLint x, GLint y, GLsizei width, GLsizei height)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -3178,7 +3123,7 @@ void WebGLRenderingContext::scissor(GLint x, GLint y, GLsizei width, GLsizei hei
|
| m_context->scissor(x, y, width, height);
|
| }
|
|
|
| -void WebGLRenderingContext::shaderSource(WebGLShader* shader, const String& string)
|
| +void WebGLRenderingContextBase::shaderSource(WebGLShader* shader, const String& string)
|
| {
|
| if (isContextLost() || !validateWebGLObject("shaderSource", shader))
|
| return;
|
| @@ -3189,7 +3134,7 @@ void WebGLRenderingContext::shaderSource(WebGLShader* shader, const String& stri
|
| m_context->shaderSource(objectOrZero(shader), stringWithoutComments.utf8().data());
|
| }
|
|
|
| -void WebGLRenderingContext::stencilFunc(GLenum func, GLint ref, GLuint mask)
|
| +void WebGLRenderingContextBase::stencilFunc(GLenum func, GLint ref, GLuint mask)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -3202,7 +3147,7 @@ void WebGLRenderingContext::stencilFunc(GLenum func, GLint ref, GLuint mask)
|
| m_context->stencilFunc(func, ref, mask);
|
| }
|
|
|
| -void WebGLRenderingContext::stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
|
| +void WebGLRenderingContextBase::stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -3230,7 +3175,7 @@ void WebGLRenderingContext::stencilFuncSeparate(GLenum face, GLenum func, GLint
|
| m_context->stencilFuncSeparate(face, func, ref, mask);
|
| }
|
|
|
| -void WebGLRenderingContext::stencilMask(GLuint mask)
|
| +void WebGLRenderingContextBase::stencilMask(GLuint mask)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -3239,7 +3184,7 @@ void WebGLRenderingContext::stencilMask(GLuint mask)
|
| m_context->stencilMask(mask);
|
| }
|
|
|
| -void WebGLRenderingContext::stencilMaskSeparate(GLenum face, GLuint mask)
|
| +void WebGLRenderingContextBase::stencilMaskSeparate(GLenum face, GLuint mask)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -3261,21 +3206,21 @@ void WebGLRenderingContext::stencilMaskSeparate(GLenum face, GLuint mask)
|
| m_context->stencilMaskSeparate(face, mask);
|
| }
|
|
|
| -void WebGLRenderingContext::stencilOp(GLenum fail, GLenum zfail, GLenum zpass)
|
| +void WebGLRenderingContextBase::stencilOp(GLenum fail, GLenum zfail, GLenum zpass)
|
| {
|
| if (isContextLost())
|
| return;
|
| m_context->stencilOp(fail, zfail, zpass);
|
| }
|
|
|
| -void WebGLRenderingContext::stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
|
| +void WebGLRenderingContextBase::stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
|
| {
|
| if (isContextLost())
|
| return;
|
| m_context->stencilOpSeparate(face, fail, zfail, zpass);
|
| }
|
|
|
| -GLenum WebGLRenderingContext::convertTexInternalFormat(GLenum internalformat, GLenum type)
|
| +GLenum WebGLRenderingContextBase::convertTexInternalFormat(GLenum internalformat, GLenum type)
|
| {
|
| // Convert to sized internal formats that are renderable with GL_CHROMIUM_color_buffer_float_rgb(a).
|
| if (type == GL_FLOAT && internalformat == GL_RGBA
|
| @@ -3287,7 +3232,7 @@ GLenum WebGLRenderingContext::convertTexInternalFormat(GLenum internalformat, GL
|
| return internalformat;
|
| }
|
|
|
| -void WebGLRenderingContext::texImage2DBase(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels, ExceptionState& exceptionState)
|
| +void WebGLRenderingContextBase::texImage2DBase(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels, ExceptionState& exceptionState)
|
| {
|
| // All calling functions check isContextLost, so a duplicate check is not needed here.
|
| // FIXME: Handle errors.
|
| @@ -3300,7 +3245,7 @@ void WebGLRenderingContext::texImage2DBase(GLenum target, GLint level, GLenum in
|
| tex->setLevelInfo(target, level, internalformat, width, height, type);
|
| }
|
|
|
| -void WebGLRenderingContext::texImage2DImpl(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, Image* image, WebGLImageConversion::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha, ExceptionState& exceptionState)
|
| +void WebGLRenderingContextBase::texImage2DImpl(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, Image* image, WebGLImageConversion::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha, ExceptionState& exceptionState)
|
| {
|
| // All calling functions check isContextLost, so a duplicate check is not needed here.
|
| Vector<uint8_t> data;
|
| @@ -3330,7 +3275,7 @@ void WebGLRenderingContext::texImage2DImpl(GLenum target, GLint level, GLenum in
|
| m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
|
| }
|
|
|
| -bool WebGLRenderingContext::validateTexFunc(const char* functionName, TexFuncValidationFunctionType functionType, TexFuncValidationSourceType sourceType, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLint xoffset, GLint yoffset)
|
| +bool WebGLRenderingContextBase::validateTexFunc(const char* functionName, TexFuncValidationFunctionType functionType, TexFuncValidationSourceType sourceType, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLint xoffset, GLint yoffset)
|
| {
|
| if (!validateTexFuncParameters(functionName, functionType, target, level, internalformat, width, height, border, format, type))
|
| return false;
|
| @@ -3373,7 +3318,7 @@ bool WebGLRenderingContext::validateTexFunc(const char* functionName, TexFuncVal
|
| return true;
|
| }
|
|
|
| -PassRefPtr<Image> WebGLRenderingContext::drawImageIntoBuffer(Image* image, int width, int height)
|
| +PassRefPtr<Image> WebGLRenderingContextBase::drawImageIntoBuffer(Image* image, int width, int height)
|
| {
|
| IntSize size(width, height);
|
| ImageBuffer* buf = m_generatedImageCache.imageBuffer(size);
|
| @@ -3388,7 +3333,7 @@ PassRefPtr<Image> WebGLRenderingContext::drawImageIntoBuffer(Image* image, int w
|
| return buf->copyImage(ImageBuffer::fastCopyImageMode());
|
| }
|
|
|
| -void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum internalformat,
|
| +void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum internalformat,
|
| GLsizei width, GLsizei height, GLint border,
|
| GLenum format, GLenum type, ArrayBufferView* pixels, ExceptionState& exceptionState)
|
| {
|
| @@ -3411,7 +3356,7 @@ void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum intern
|
| m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
|
| }
|
|
|
| -void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum internalformat,
|
| +void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum internalformat,
|
| GLenum format, GLenum type, ImageData* pixels, ExceptionState& exceptionState)
|
| {
|
| if (isContextLost() || !pixels || !validateTexFunc("texImage2D", NotTexSubImage2D, SourceImageData, target, level, internalformat, pixels->width(), pixels->height(), 0, format, type, 0, 0))
|
| @@ -3435,7 +3380,7 @@ void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum intern
|
| m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
|
| }
|
|
|
| -void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum internalformat,
|
| +void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum internalformat,
|
| GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& exceptionState)
|
| {
|
| if (isContextLost() || !validateHTMLImageElement("texImage2D", image, exceptionState))
|
| @@ -3451,7 +3396,7 @@ void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum intern
|
| texImage2DImpl(target, level, internalformat, format, type, imageForRender.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlpha, exceptionState);
|
| }
|
|
|
| -void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum internalformat,
|
| +void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum internalformat,
|
| GLenum format, GLenum type, HTMLCanvasElement* canvas, ExceptionState& exceptionState)
|
| {
|
| if (isContextLost() || !validateHTMLCanvasElement("texImage2D", canvas, exceptionState) || !validateTexFunc("texImage2D", NotTexSubImage2D, SourceHTMLCanvasElement, target, level, internalformat, canvas->width(), canvas->height(), 0, format, type, 0, 0))
|
| @@ -3469,7 +3414,7 @@ void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum intern
|
| return;
|
| }
|
| } else {
|
| - WebGLRenderingContext* gl = toWebGLRenderingContext(canvas->renderingContext());
|
| + WebGLRenderingContextBase* gl = toWebGLRenderingContextBase(canvas->renderingContext());
|
| if (gl && gl->m_drawingBuffer->copyToPlatformTexture(m_context.get(), texture->object(), internalformat, type,
|
| level, m_unpackPremultiplyAlpha, m_unpackFlipY)) {
|
| texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas->height(), type);
|
| @@ -3485,7 +3430,7 @@ void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum intern
|
| texImage2DImpl(target, level, internalformat, format, type, canvas->copiedImage(), WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha, exceptionState);
|
| }
|
|
|
| -PassRefPtr<Image> WebGLRenderingContext::videoFrameToImage(HTMLVideoElement* video, BackingStoreCopy backingStoreCopy)
|
| +PassRefPtr<Image> WebGLRenderingContextBase::videoFrameToImage(HTMLVideoElement* video, BackingStoreCopy backingStoreCopy)
|
| {
|
| IntSize size(video->videoWidth(), video->videoHeight());
|
| ImageBuffer* buf = m_generatedImageCache.imageBuffer(size);
|
| @@ -3499,7 +3444,7 @@ PassRefPtr<Image> WebGLRenderingContext::videoFrameToImage(HTMLVideoElement* vid
|
| return buf->copyImage(backingStoreCopy);
|
| }
|
|
|
| -void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum internalformat,
|
| +void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum internalformat,
|
| GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& exceptionState)
|
| {
|
| if (isContextLost() || !validateHTMLVideoElement("texImage2D", video, exceptionState)
|
| @@ -3523,7 +3468,7 @@ void WebGLRenderingContext::texImage2D(GLenum target, GLint level, GLenum intern
|
| texImage2DImpl(target, level, internalformat, format, type, image.get(), WebGLImageConversion::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha, exceptionState);
|
| }
|
|
|
| -void WebGLRenderingContext::texParameter(GLenum target, GLenum pname, GLfloat paramf, GLint parami, bool isFloat)
|
| +void WebGLRenderingContextBase::texParameter(GLenum target, GLenum pname, GLfloat paramf, GLint parami, bool isFloat)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -3543,7 +3488,7 @@ void WebGLRenderingContext::texParameter(GLenum target, GLenum pname, GLfloat pa
|
| }
|
| break;
|
| case GL_TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic
|
| - if (!m_extTextureFilterAnisotropic) {
|
| + if (!extensionEnabled(EXTTextureFilterAnisotropicName)) {
|
| synthesizeGLError(GL_INVALID_ENUM, "texParameter", "invalid parameter, EXT_texture_filter_anisotropic not enabled");
|
| return;
|
| }
|
| @@ -3561,17 +3506,17 @@ void WebGLRenderingContext::texParameter(GLenum target, GLenum pname, GLfloat pa
|
| }
|
| }
|
|
|
| -void WebGLRenderingContext::texParameterf(GLenum target, GLenum pname, GLfloat param)
|
| +void WebGLRenderingContextBase::texParameterf(GLenum target, GLenum pname, GLfloat param)
|
| {
|
| texParameter(target, pname, param, 0, true);
|
| }
|
|
|
| -void WebGLRenderingContext::texParameteri(GLenum target, GLenum pname, GLint param)
|
| +void WebGLRenderingContextBase::texParameteri(GLenum target, GLenum pname, GLint param)
|
| {
|
| texParameter(target, pname, 0, param, false);
|
| }
|
|
|
| -void WebGLRenderingContext::texSubImage2DBase(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels, ExceptionState& exceptionState)
|
| +void WebGLRenderingContextBase::texSubImage2DBase(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels, ExceptionState& exceptionState)
|
| {
|
| // FIXME: Handle errors.
|
| ASSERT(!isContextLost());
|
| @@ -3592,7 +3537,7 @@ void WebGLRenderingContext::texSubImage2DBase(GLenum target, GLint level, GLint
|
| m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
|
| }
|
|
|
| -void WebGLRenderingContext::texSubImage2DImpl(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, Image* image, WebGLImageConversion::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha, ExceptionState& exceptionState)
|
| +void WebGLRenderingContextBase::texSubImage2DImpl(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, Image* image, WebGLImageConversion::ImageHtmlDomSource domSource, bool flipY, bool premultiplyAlpha, ExceptionState& exceptionState)
|
| {
|
| // All calling functions check isContextLost, so a duplicate check is not needed here.
|
| Vector<uint8_t> data;
|
| @@ -3622,7 +3567,7 @@ void WebGLRenderingContext::texSubImage2DImpl(GLenum target, GLint level, GLint
|
| m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
|
| }
|
|
|
| -void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| +void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| GLsizei width, GLsizei height,
|
| GLenum format, GLenum type, ArrayBufferView* pixels, ExceptionState& exceptionState)
|
| {
|
| @@ -3649,7 +3594,7 @@ void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoff
|
| m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
|
| }
|
|
|
| -void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| +void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| GLenum format, GLenum type, ImageData* pixels, ExceptionState& exceptionState)
|
| {
|
| if (isContextLost() || !pixels || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceImageData, target, level, format, pixels->width(), pixels->height(), 0, format, type, xoffset, yoffset))
|
| @@ -3674,7 +3619,7 @@ void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoff
|
| m_context->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
|
| }
|
|
|
| -void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| +void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& exceptionState)
|
| {
|
| if (isContextLost() || !validateHTMLImageElement("texSubImage2D", image, exceptionState))
|
| @@ -3690,7 +3635,7 @@ void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoff
|
| texSubImage2DImpl(target, level, xoffset, yoffset, format, type, imageForRender.get(), WebGLImageConversion::HtmlDomImage, m_unpackFlipY, m_unpackPremultiplyAlpha, exceptionState);
|
| }
|
|
|
| -void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| +void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| GLenum format, GLenum type, HTMLCanvasElement* canvas, ExceptionState& exceptionState)
|
| {
|
| if (isContextLost() || !validateHTMLCanvasElement("texSubImage2D", canvas, exceptionState)
|
| @@ -3704,7 +3649,7 @@ void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoff
|
| texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas->copiedImage(), WebGLImageConversion::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha, exceptionState);
|
| }
|
|
|
| -void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| +void WebGLRenderingContextBase::texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
| GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& exceptionState)
|
| {
|
| if (isContextLost() || !validateHTMLVideoElement("texSubImage2D", video, exceptionState)
|
| @@ -3717,7 +3662,7 @@ void WebGLRenderingContext::texSubImage2D(GLenum target, GLint level, GLint xoff
|
| texSubImage2DImpl(target, level, xoffset, yoffset, format, type, image.get(), WebGLImageConversion::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha, exceptionState);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform1f(const WebGLUniformLocation* location, GLfloat x)
|
| +void WebGLRenderingContextBase::uniform1f(const WebGLUniformLocation* location, GLfloat x)
|
| {
|
| if (isContextLost() || !location)
|
| return;
|
| @@ -3730,7 +3675,7 @@ void WebGLRenderingContext::uniform1f(const WebGLUniformLocation* location, GLfl
|
| m_context->uniform1f(location->location(), x);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform1fv(const WebGLUniformLocation* location, Float32Array* v)
|
| +void WebGLRenderingContextBase::uniform1fv(const WebGLUniformLocation* location, Float32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform1fv", location, v, 1))
|
| return;
|
| @@ -3738,7 +3683,7 @@ void WebGLRenderingContext::uniform1fv(const WebGLUniformLocation* location, Flo
|
| m_context->uniform1fv(location->location(), v->length(), v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniform1fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniform1fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform1fv", location, v, size, 1))
|
| return;
|
| @@ -3746,7 +3691,7 @@ void WebGLRenderingContext::uniform1fv(const WebGLUniformLocation* location, GLf
|
| m_context->uniform1fv(location->location(), size, v);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform1i(const WebGLUniformLocation* location, GLint x)
|
| +void WebGLRenderingContextBase::uniform1i(const WebGLUniformLocation* location, GLint x)
|
| {
|
| if (isContextLost() || !location)
|
| return;
|
| @@ -3759,7 +3704,7 @@ void WebGLRenderingContext::uniform1i(const WebGLUniformLocation* location, GLin
|
| m_context->uniform1i(location->location(), x);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform1iv(const WebGLUniformLocation* location, Int32Array* v)
|
| +void WebGLRenderingContextBase::uniform1iv(const WebGLUniformLocation* location, Int32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform1iv", location, v, 1))
|
| return;
|
| @@ -3767,7 +3712,7 @@ void WebGLRenderingContext::uniform1iv(const WebGLUniformLocation* location, Int
|
| m_context->uniform1iv(location->location(), v->length(), v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniform1iv(const WebGLUniformLocation* location, GLint* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniform1iv(const WebGLUniformLocation* location, GLint* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform1iv", location, v, size, 1))
|
| return;
|
| @@ -3775,7 +3720,7 @@ void WebGLRenderingContext::uniform1iv(const WebGLUniformLocation* location, GLi
|
| m_context->uniform1iv(location->location(), size, v);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform2f(const WebGLUniformLocation* location, GLfloat x, GLfloat y)
|
| +void WebGLRenderingContextBase::uniform2f(const WebGLUniformLocation* location, GLfloat x, GLfloat y)
|
| {
|
| if (isContextLost() || !location)
|
| return;
|
| @@ -3788,7 +3733,7 @@ void WebGLRenderingContext::uniform2f(const WebGLUniformLocation* location, GLfl
|
| m_context->uniform2f(location->location(), x, y);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform2fv(const WebGLUniformLocation* location, Float32Array* v)
|
| +void WebGLRenderingContextBase::uniform2fv(const WebGLUniformLocation* location, Float32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform2fv", location, v, 2))
|
| return;
|
| @@ -3796,7 +3741,7 @@ void WebGLRenderingContext::uniform2fv(const WebGLUniformLocation* location, Flo
|
| m_context->uniform2fv(location->location(), v->length() / 2, v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniform2fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniform2fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform2fv", location, v, size, 2))
|
| return;
|
| @@ -3804,7 +3749,7 @@ void WebGLRenderingContext::uniform2fv(const WebGLUniformLocation* location, GLf
|
| m_context->uniform2fv(location->location(), size / 2, v);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform2i(const WebGLUniformLocation* location, GLint x, GLint y)
|
| +void WebGLRenderingContextBase::uniform2i(const WebGLUniformLocation* location, GLint x, GLint y)
|
| {
|
| if (isContextLost() || !location)
|
| return;
|
| @@ -3817,7 +3762,7 @@ void WebGLRenderingContext::uniform2i(const WebGLUniformLocation* location, GLin
|
| m_context->uniform2i(location->location(), x, y);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform2iv(const WebGLUniformLocation* location, Int32Array* v)
|
| +void WebGLRenderingContextBase::uniform2iv(const WebGLUniformLocation* location, Int32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform2iv", location, v, 2))
|
| return;
|
| @@ -3825,7 +3770,7 @@ void WebGLRenderingContext::uniform2iv(const WebGLUniformLocation* location, Int
|
| m_context->uniform2iv(location->location(), v->length() / 2, v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniform2iv(const WebGLUniformLocation* location, GLint* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniform2iv(const WebGLUniformLocation* location, GLint* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform2iv", location, v, size, 2))
|
| return;
|
| @@ -3833,7 +3778,7 @@ void WebGLRenderingContext::uniform2iv(const WebGLUniformLocation* location, GLi
|
| m_context->uniform2iv(location->location(), size / 2, v);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform3f(const WebGLUniformLocation* location, GLfloat x, GLfloat y, GLfloat z)
|
| +void WebGLRenderingContextBase::uniform3f(const WebGLUniformLocation* location, GLfloat x, GLfloat y, GLfloat z)
|
| {
|
| if (isContextLost() || !location)
|
| return;
|
| @@ -3846,7 +3791,7 @@ void WebGLRenderingContext::uniform3f(const WebGLUniformLocation* location, GLfl
|
| m_context->uniform3f(location->location(), x, y, z);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform3fv(const WebGLUniformLocation* location, Float32Array* v)
|
| +void WebGLRenderingContextBase::uniform3fv(const WebGLUniformLocation* location, Float32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform3fv", location, v, 3))
|
| return;
|
| @@ -3854,7 +3799,7 @@ void WebGLRenderingContext::uniform3fv(const WebGLUniformLocation* location, Flo
|
| m_context->uniform3fv(location->location(), v->length() / 3, v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniform3fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniform3fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform3fv", location, v, size, 3))
|
| return;
|
| @@ -3862,7 +3807,7 @@ void WebGLRenderingContext::uniform3fv(const WebGLUniformLocation* location, GLf
|
| m_context->uniform3fv(location->location(), size / 3, v);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform3i(const WebGLUniformLocation* location, GLint x, GLint y, GLint z)
|
| +void WebGLRenderingContextBase::uniform3i(const WebGLUniformLocation* location, GLint x, GLint y, GLint z)
|
| {
|
| if (isContextLost() || !location)
|
| return;
|
| @@ -3875,7 +3820,7 @@ void WebGLRenderingContext::uniform3i(const WebGLUniformLocation* location, GLin
|
| m_context->uniform3i(location->location(), x, y, z);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform3iv(const WebGLUniformLocation* location, Int32Array* v)
|
| +void WebGLRenderingContextBase::uniform3iv(const WebGLUniformLocation* location, Int32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform3iv", location, v, 3))
|
| return;
|
| @@ -3883,7 +3828,7 @@ void WebGLRenderingContext::uniform3iv(const WebGLUniformLocation* location, Int
|
| m_context->uniform3iv(location->location(), v->length() / 3, v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniform3iv(const WebGLUniformLocation* location, GLint* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniform3iv(const WebGLUniformLocation* location, GLint* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform3iv", location, v, size, 3))
|
| return;
|
| @@ -3891,7 +3836,7 @@ void WebGLRenderingContext::uniform3iv(const WebGLUniformLocation* location, GLi
|
| m_context->uniform3iv(location->location(), size / 3, v);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform4f(const WebGLUniformLocation* location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
|
| +void WebGLRenderingContextBase::uniform4f(const WebGLUniformLocation* location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
|
| {
|
| if (isContextLost() || !location)
|
| return;
|
| @@ -3904,7 +3849,7 @@ void WebGLRenderingContext::uniform4f(const WebGLUniformLocation* location, GLfl
|
| m_context->uniform4f(location->location(), x, y, z, w);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform4fv(const WebGLUniformLocation* location, Float32Array* v)
|
| +void WebGLRenderingContextBase::uniform4fv(const WebGLUniformLocation* location, Float32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform4fv", location, v, 4))
|
| return;
|
| @@ -3912,7 +3857,7 @@ void WebGLRenderingContext::uniform4fv(const WebGLUniformLocation* location, Flo
|
| m_context->uniform4fv(location->location(), v->length() / 4, v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniform4fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniform4fv(const WebGLUniformLocation* location, GLfloat* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform4fv", location, v, size, 4))
|
| return;
|
| @@ -3920,7 +3865,7 @@ void WebGLRenderingContext::uniform4fv(const WebGLUniformLocation* location, GLf
|
| m_context->uniform4fv(location->location(), size / 4, v);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform4i(const WebGLUniformLocation* location, GLint x, GLint y, GLint z, GLint w)
|
| +void WebGLRenderingContextBase::uniform4i(const WebGLUniformLocation* location, GLint x, GLint y, GLint z, GLint w)
|
| {
|
| if (isContextLost() || !location)
|
| return;
|
| @@ -3933,7 +3878,7 @@ void WebGLRenderingContext::uniform4i(const WebGLUniformLocation* location, GLin
|
| m_context->uniform4i(location->location(), x, y, z, w);
|
| }
|
|
|
| -void WebGLRenderingContext::uniform4iv(const WebGLUniformLocation* location, Int32Array* v)
|
| +void WebGLRenderingContextBase::uniform4iv(const WebGLUniformLocation* location, Int32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform4iv", location, v, 4))
|
| return;
|
| @@ -3941,7 +3886,7 @@ void WebGLRenderingContext::uniform4iv(const WebGLUniformLocation* location, Int
|
| m_context->uniform4iv(location->location(), v->length() / 4, v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniform4iv(const WebGLUniformLocation* location, GLint* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniform4iv(const WebGLUniformLocation* location, GLint* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformParameters("uniform4iv", location, v, size, 4))
|
| return;
|
| @@ -3949,49 +3894,49 @@ void WebGLRenderingContext::uniform4iv(const WebGLUniformLocation* location, GLi
|
| m_context->uniform4iv(location->location(), size / 4, v);
|
| }
|
|
|
| -void WebGLRenderingContext::uniformMatrix2fv(const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v)
|
| +void WebGLRenderingContextBase::uniformMatrix2fv(const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, v, 4))
|
| return;
|
| m_context->uniformMatrix2fv(location->location(), v->length() / 4, transpose, v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniformMatrix2fv(const WebGLUniformLocation* location, GLboolean transpose, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniformMatrix2fv(const WebGLUniformLocation* location, GLboolean transpose, GLfloat* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, v, size, 4))
|
| return;
|
| m_context->uniformMatrix2fv(location->location(), size / 4, transpose, v);
|
| }
|
|
|
| -void WebGLRenderingContext::uniformMatrix3fv(const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v)
|
| +void WebGLRenderingContextBase::uniformMatrix3fv(const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, v, 9))
|
| return;
|
| m_context->uniformMatrix3fv(location->location(), v->length() / 9, transpose, v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniformMatrix3fv(const WebGLUniformLocation* location, GLboolean transpose, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniformMatrix3fv(const WebGLUniformLocation* location, GLboolean transpose, GLfloat* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, v, size, 9))
|
| return;
|
| m_context->uniformMatrix3fv(location->location(), size / 9, transpose, v);
|
| }
|
|
|
| -void WebGLRenderingContext::uniformMatrix4fv(const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v)
|
| +void WebGLRenderingContextBase::uniformMatrix4fv(const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v)
|
| {
|
| if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, v, 16))
|
| return;
|
| m_context->uniformMatrix4fv(location->location(), v->length() / 16, transpose, v->data());
|
| }
|
|
|
| -void WebGLRenderingContext::uniformMatrix4fv(const WebGLUniformLocation* location, GLboolean transpose, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::uniformMatrix4fv(const WebGLUniformLocation* location, GLboolean transpose, GLfloat* v, GLsizei size)
|
| {
|
| if (isContextLost() || !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, v, size, 16))
|
| return;
|
| m_context->uniformMatrix4fv(location->location(), size / 16, transpose, v);
|
| }
|
|
|
| -void WebGLRenderingContext::useProgram(WebGLProgram* program)
|
| +void WebGLRenderingContextBase::useProgram(WebGLProgram* program)
|
| {
|
| bool deleted;
|
| if (!checkObjectToBeBound("useProgram", program, deleted))
|
| @@ -4012,74 +3957,74 @@ void WebGLRenderingContext::useProgram(WebGLProgram* program)
|
| }
|
| }
|
|
|
| -void WebGLRenderingContext::validateProgram(WebGLProgram* program)
|
| +void WebGLRenderingContextBase::validateProgram(WebGLProgram* program)
|
| {
|
| if (isContextLost() || !validateWebGLObject("validateProgram", program))
|
| return;
|
| m_context->validateProgram(objectOrZero(program));
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib1f(GLuint index, GLfloat v0)
|
| +void WebGLRenderingContextBase::vertexAttrib1f(GLuint index, GLfloat v0)
|
| {
|
| vertexAttribfImpl("vertexAttrib1f", index, 1, v0, 0.0f, 0.0f, 1.0f);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib1fv(GLuint index, Float32Array* v)
|
| +void WebGLRenderingContextBase::vertexAttrib1fv(GLuint index, Float32Array* v)
|
| {
|
| vertexAttribfvImpl("vertexAttrib1fv", index, v, 1);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib1fv(GLuint index, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::vertexAttrib1fv(GLuint index, GLfloat* v, GLsizei size)
|
| {
|
| vertexAttribfvImpl("vertexAttrib1fv", index, v, size, 1);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib2f(GLuint index, GLfloat v0, GLfloat v1)
|
| +void WebGLRenderingContextBase::vertexAttrib2f(GLuint index, GLfloat v0, GLfloat v1)
|
| {
|
| vertexAttribfImpl("vertexAttrib2f", index, 2, v0, v1, 0.0f, 1.0f);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib2fv(GLuint index, Float32Array* v)
|
| +void WebGLRenderingContextBase::vertexAttrib2fv(GLuint index, Float32Array* v)
|
| {
|
| vertexAttribfvImpl("vertexAttrib2fv", index, v, 2);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib2fv(GLuint index, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::vertexAttrib2fv(GLuint index, GLfloat* v, GLsizei size)
|
| {
|
| vertexAttribfvImpl("vertexAttrib2fv", index, v, size, 2);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib3f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2)
|
| +void WebGLRenderingContextBase::vertexAttrib3f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2)
|
| {
|
| vertexAttribfImpl("vertexAttrib3f", index, 3, v0, v1, v2, 1.0f);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib3fv(GLuint index, Float32Array* v)
|
| +void WebGLRenderingContextBase::vertexAttrib3fv(GLuint index, Float32Array* v)
|
| {
|
| vertexAttribfvImpl("vertexAttrib3fv", index, v, 3);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib3fv(GLuint index, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::vertexAttrib3fv(GLuint index, GLfloat* v, GLsizei size)
|
| {
|
| vertexAttribfvImpl("vertexAttrib3fv", index, v, size, 3);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib4f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
|
| +void WebGLRenderingContextBase::vertexAttrib4f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
|
| {
|
| vertexAttribfImpl("vertexAttrib4f", index, 4, v0, v1, v2, v3);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib4fv(GLuint index, Float32Array* v)
|
| +void WebGLRenderingContextBase::vertexAttrib4fv(GLuint index, Float32Array* v)
|
| {
|
| vertexAttribfvImpl("vertexAttrib4fv", index, v, 4);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttrib4fv(GLuint index, GLfloat* v, GLsizei size)
|
| +void WebGLRenderingContextBase::vertexAttrib4fv(GLuint index, GLfloat* v, GLsizei size)
|
| {
|
| vertexAttribfvImpl("vertexAttrib4fv", index, v, size, 4);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, long long offset)
|
| +void WebGLRenderingContextBase::vertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, long long offset)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -4122,7 +4067,7 @@ void WebGLRenderingContext::vertexAttribPointer(GLuint index, GLint size, GLenum
|
| m_context->vertexAttribPointer(index, size, type, normalized, stride, static_cast<GLintptr>(offset));
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttribDivisorANGLE(GLuint index, GLuint divisor)
|
| +void WebGLRenderingContextBase::vertexAttribDivisorANGLE(GLuint index, GLuint divisor)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -4136,7 +4081,7 @@ void WebGLRenderingContext::vertexAttribDivisorANGLE(GLuint index, GLuint diviso
|
| m_context->vertexAttribDivisorANGLE(index, divisor);
|
| }
|
|
|
| -void WebGLRenderingContext::viewport(GLint x, GLint y, GLsizei width, GLsizei height)
|
| +void WebGLRenderingContextBase::viewport(GLint x, GLint y, GLsizei width, GLsizei height)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -4145,7 +4090,7 @@ void WebGLRenderingContext::viewport(GLint x, GLint y, GLsizei width, GLsizei he
|
| m_context->viewport(x, y, width, height);
|
| }
|
|
|
| -void WebGLRenderingContext::forceLostContext(WebGLRenderingContext::LostContextMode mode)
|
| +void WebGLRenderingContextBase::forceLostContext(WebGLRenderingContextBase::LostContextMode mode)
|
| {
|
| if (isContextLost()) {
|
| synthesizeGLError(GL_INVALID_OPERATION, "loseContext", "context already lost");
|
| @@ -4155,7 +4100,7 @@ void WebGLRenderingContext::forceLostContext(WebGLRenderingContext::LostContextM
|
| m_contextGroup->loseContextGroup(mode);
|
| }
|
|
|
| -void WebGLRenderingContext::loseContextImpl(WebGLRenderingContext::LostContextMode mode)
|
| +void WebGLRenderingContextBase::loseContextImpl(WebGLRenderingContextBase::LostContextMode mode)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -4182,6 +4127,9 @@ void WebGLRenderingContext::loseContextImpl(WebGLRenderingContext::LostContextMo
|
| tracker->loseExtension();
|
| }
|
|
|
| + for (size_t i = 0; i < WebGLExtensionNameCount; ++i)
|
| + m_extensionEnabled[i] = false;
|
| +
|
| removeAllCompressedTextureFormats();
|
|
|
| if (mode != RealLostContext)
|
| @@ -4199,7 +4147,7 @@ void WebGLRenderingContext::loseContextImpl(WebGLRenderingContext::LostContextMo
|
| m_dispatchContextLostEventTimer.startOneShot(0);
|
| }
|
|
|
| -void WebGLRenderingContext::forceRestoreContext()
|
| +void WebGLRenderingContextBase::forceRestoreContext()
|
| {
|
| if (!isContextLost()) {
|
| synthesizeGLError(GL_INVALID_OPERATION, "restoreContext", "context not lost");
|
| @@ -4216,41 +4164,41 @@ void WebGLRenderingContext::forceRestoreContext()
|
| m_restoreTimer.startOneShot(0);
|
| }
|
|
|
| -blink::WebLayer* WebGLRenderingContext::platformLayer() const
|
| +blink::WebLayer* WebGLRenderingContextBase::platformLayer() const
|
| {
|
| return m_drawingBuffer->platformLayer();
|
| }
|
|
|
| -Extensions3DUtil* WebGLRenderingContext::extensionsUtil()
|
| +Extensions3DUtil* WebGLRenderingContextBase::extensionsUtil()
|
| {
|
| if (!m_extensionsUtil)
|
| m_extensionsUtil = adoptPtr(new Extensions3DUtil(m_context.get()));
|
| return m_extensionsUtil.get();
|
| }
|
|
|
| -void WebGLRenderingContext::removeSharedObject(WebGLSharedObject* object)
|
| +void WebGLRenderingContextBase::removeSharedObject(WebGLSharedObject* object)
|
| {
|
| m_contextGroup->removeObject(object);
|
| }
|
|
|
| -void WebGLRenderingContext::addSharedObject(WebGLSharedObject* object)
|
| +void WebGLRenderingContextBase::addSharedObject(WebGLSharedObject* object)
|
| {
|
| ASSERT(!isContextLost());
|
| m_contextGroup->addObject(object);
|
| }
|
|
|
| -void WebGLRenderingContext::removeContextObject(WebGLContextObject* object)
|
| +void WebGLRenderingContextBase::removeContextObject(WebGLContextObject* object)
|
| {
|
| m_contextObjects.remove(object);
|
| }
|
|
|
| -void WebGLRenderingContext::addContextObject(WebGLContextObject* object)
|
| +void WebGLRenderingContextBase::addContextObject(WebGLContextObject* object)
|
| {
|
| ASSERT(!isContextLost());
|
| m_contextObjects.add(object);
|
| }
|
|
|
| -void WebGLRenderingContext::detachAndRemoveAllObjects()
|
| +void WebGLRenderingContextBase::detachAndRemoveAllObjects()
|
| {
|
| while (m_contextObjects.size() > 0) {
|
| HashSet<WebGLContextObject*>::iterator it = m_contextObjects.begin();
|
| @@ -4258,12 +4206,12 @@ void WebGLRenderingContext::detachAndRemoveAllObjects()
|
| }
|
| }
|
|
|
| -bool WebGLRenderingContext::hasPendingActivity() const
|
| +bool WebGLRenderingContextBase::hasPendingActivity() const
|
| {
|
| return false;
|
| }
|
|
|
| -void WebGLRenderingContext::stop()
|
| +void WebGLRenderingContextBase::stop()
|
| {
|
| if (!isContextLost()) {
|
| forceLostContext(SyntheticLostContext);
|
| @@ -4271,7 +4219,7 @@ void WebGLRenderingContext::stop()
|
| }
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getBooleanParameter(GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getBooleanParameter(GLenum pname)
|
| {
|
| GLboolean value = 0;
|
| if (!isContextLost())
|
| @@ -4279,7 +4227,7 @@ WebGLGetInfo WebGLRenderingContext::getBooleanParameter(GLenum pname)
|
| return WebGLGetInfo(static_cast<bool>(value));
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getBooleanArrayParameter(GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getBooleanArrayParameter(GLenum pname)
|
| {
|
| if (pname != GL_COLOR_WRITEMASK) {
|
| notImplemented();
|
| @@ -4294,7 +4242,7 @@ WebGLGetInfo WebGLRenderingContext::getBooleanArrayParameter(GLenum pname)
|
| return WebGLGetInfo(boolValue, 4);
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getFloatParameter(GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getFloatParameter(GLenum pname)
|
| {
|
| GLfloat value = 0;
|
| if (!isContextLost())
|
| @@ -4302,7 +4250,7 @@ WebGLGetInfo WebGLRenderingContext::getFloatParameter(GLenum pname)
|
| return WebGLGetInfo(value);
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getIntParameter(GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getIntParameter(GLenum pname)
|
| {
|
| GLint value = 0;
|
| if (!isContextLost())
|
| @@ -4310,7 +4258,7 @@ WebGLGetInfo WebGLRenderingContext::getIntParameter(GLenum pname)
|
| return WebGLGetInfo(value);
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getUnsignedIntParameter(GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getUnsignedIntParameter(GLenum pname)
|
| {
|
| GLint value = 0;
|
| if (!isContextLost())
|
| @@ -4318,7 +4266,7 @@ WebGLGetInfo WebGLRenderingContext::getUnsignedIntParameter(GLenum pname)
|
| return WebGLGetInfo(static_cast<unsigned>(value));
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getWebGLFloatArrayParameter(GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getWebGLFloatArrayParameter(GLenum pname)
|
| {
|
| GLfloat value[4] = {0};
|
| if (!isContextLost())
|
| @@ -4340,7 +4288,7 @@ WebGLGetInfo WebGLRenderingContext::getWebGLFloatArrayParameter(GLenum pname)
|
| return WebGLGetInfo(Float32Array::create(value, length));
|
| }
|
|
|
| -WebGLGetInfo WebGLRenderingContext::getWebGLIntArrayParameter(GLenum pname)
|
| +WebGLGetInfo WebGLRenderingContextBase::getWebGLIntArrayParameter(GLenum pname)
|
| {
|
| GLint value[4] = {0};
|
| if (!isContextLost())
|
| @@ -4360,12 +4308,12 @@ WebGLGetInfo WebGLRenderingContext::getWebGLIntArrayParameter(GLenum pname)
|
| return WebGLGetInfo(Int32Array::create(value, length));
|
| }
|
|
|
| -void WebGLRenderingContext::handleTextureCompleteness(const char* functionName, bool prepareToDraw)
|
| +void WebGLRenderingContextBase::handleTextureCompleteness(const char* functionName, bool prepareToDraw)
|
| {
|
| // All calling functions check isContextLost, so a duplicate check is not needed here.
|
| bool resetActiveUnit = false;
|
| - WebGLTexture::TextureExtensionFlag flag = static_cast<WebGLTexture::TextureExtensionFlag>((m_oesTextureFloatLinear ? WebGLTexture::TextureFloatLinearExtensionEnabled : 0)
|
| - | (m_oesTextureHalfFloatLinear ? WebGLTexture::TextureHalfFloatLinearExtensionEnabled : 0));
|
| + WebGLTexture::TextureExtensionFlag flag = static_cast<WebGLTexture::TextureExtensionFlag>((extensionEnabled(OESTextureFloatLinearName) ? WebGLTexture::TextureFloatLinearExtensionEnabled : 0)
|
| + | (extensionEnabled(OESTextureHalfFloatLinearName) ? WebGLTexture::TextureHalfFloatLinearExtensionEnabled : 0));
|
| for (unsigned ii = 0; ii < m_onePlusMaxNonDefaultTextureUnit; ++ii) {
|
| if ((m_textureUnits[ii].m_texture2DBinding.get() && m_textureUnits[ii].m_texture2DBinding->needToUseBlackTexture(flag))
|
| || (m_textureUnits[ii].m_textureCubeMapBinding.get() && m_textureUnits[ii].m_textureCubeMapBinding->needToUseBlackTexture(flag))) {
|
| @@ -4399,7 +4347,7 @@ void WebGLRenderingContext::handleTextureCompleteness(const char* functionName,
|
| m_context->activeTexture(m_activeTextureUnit);
|
| }
|
|
|
| -void WebGLRenderingContext::createFallbackBlackTextures1x1()
|
| +void WebGLRenderingContextBase::createFallbackBlackTextures1x1()
|
| {
|
| // All calling functions check isContextLost, so a duplicate check is not needed here.
|
| unsigned char black[] = {0, 0, 0, 255};
|
| @@ -4425,14 +4373,14 @@ void WebGLRenderingContext::createFallbackBlackTextures1x1()
|
| m_context->bindTexture(GL_TEXTURE_CUBE_MAP, 0);
|
| }
|
|
|
| -bool WebGLRenderingContext::isTexInternalFormatColorBufferCombinationValid(GLenum texInternalFormat, GLenum colorBufferFormat)
|
| +bool WebGLRenderingContextBase::isTexInternalFormatColorBufferCombinationValid(GLenum texInternalFormat, GLenum colorBufferFormat)
|
| {
|
| unsigned need = WebGLImageConversion::getChannelBitsByFormat(texInternalFormat);
|
| unsigned have = WebGLImageConversion::getChannelBitsByFormat(colorBufferFormat);
|
| return (need & have) == need;
|
| }
|
|
|
| -GLenum WebGLRenderingContext::boundFramebufferColorFormat()
|
| +GLenum WebGLRenderingContextBase::boundFramebufferColorFormat()
|
| {
|
| if (m_framebufferBinding && m_framebufferBinding->object())
|
| return m_framebufferBinding->colorBufferFormat();
|
| @@ -4441,7 +4389,7 @@ GLenum WebGLRenderingContext::boundFramebufferColorFormat()
|
| return GL_RGB;
|
| }
|
|
|
| -WebGLTexture* WebGLRenderingContext::validateTextureBinding(const char* functionName, GLenum target, bool useSixEnumsForCubeMap)
|
| +WebGLTexture* WebGLRenderingContextBase::validateTextureBinding(const char* functionName, GLenum target, bool useSixEnumsForCubeMap)
|
| {
|
| WebGLTexture* tex = 0;
|
| switch (target) {
|
| @@ -4476,7 +4424,7 @@ WebGLTexture* WebGLRenderingContext::validateTextureBinding(const char* function
|
| return tex;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateLocationLength(const char* functionName, const String& string)
|
| +bool WebGLRenderingContextBase::validateLocationLength(const char* functionName, const String& string)
|
| {
|
| const unsigned maxWebGLLocationLength = 256;
|
| if (string.length() > maxWebGLLocationLength) {
|
| @@ -4486,7 +4434,7 @@ bool WebGLRenderingContext::validateLocationLength(const char* functionName, con
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateSize(const char* functionName, GLint x, GLint y)
|
| +bool WebGLRenderingContextBase::validateSize(const char* functionName, GLint x, GLint y)
|
| {
|
| if (x < 0 || y < 0) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "size < 0");
|
| @@ -4495,7 +4443,7 @@ bool WebGLRenderingContext::validateSize(const char* functionName, GLint x, GLin
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateString(const char* functionName, const String& string)
|
| +bool WebGLRenderingContextBase::validateString(const char* functionName, const String& string)
|
| {
|
| for (size_t i = 0; i < string.length(); ++i) {
|
| if (!validateCharacter(string[i])) {
|
| @@ -4506,7 +4454,7 @@ bool WebGLRenderingContext::validateString(const char* functionName, const Strin
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateTexFuncFormatAndType(const char* functionName, GLenum format, GLenum type, GLint level)
|
| +bool WebGLRenderingContextBase::validateTexFuncFormatAndType(const char* functionName, GLenum format, GLenum type, GLint level)
|
| {
|
| switch (format) {
|
| case GL_ALPHA:
|
| @@ -4517,7 +4465,7 @@ bool WebGLRenderingContext::validateTexFuncFormatAndType(const char* functionNam
|
| break;
|
| case GL_DEPTH_STENCIL_OES:
|
| case GL_DEPTH_COMPONENT:
|
| - if (m_webglDepthTexture)
|
| + if (extensionEnabled(WebGLDepthTextureName))
|
| break;
|
| synthesizeGLError(GL_INVALID_ENUM, functionName, "depth texture formats not enabled");
|
| return false;
|
| @@ -4533,19 +4481,19 @@ bool WebGLRenderingContext::validateTexFuncFormatAndType(const char* functionNam
|
| case GL_UNSIGNED_SHORT_5_5_5_1:
|
| break;
|
| case GL_FLOAT:
|
| - if (m_oesTextureFloat)
|
| + if (extensionEnabled(OESTextureFloatName))
|
| break;
|
| synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid texture type");
|
| return false;
|
| case GL_HALF_FLOAT_OES:
|
| - if (m_oesTextureHalfFloat)
|
| + if (extensionEnabled(OESTextureHalfFloatName))
|
| break;
|
| synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid texture type");
|
| return false;
|
| case GL_UNSIGNED_INT:
|
| case GL_UNSIGNED_INT_24_8_OES:
|
| case GL_UNSIGNED_SHORT:
|
| - if (m_webglDepthTexture)
|
| + if (extensionEnabled(WebGLDepthTextureName))
|
| break;
|
| synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid texture type");
|
| return false;
|
| @@ -4586,7 +4534,7 @@ bool WebGLRenderingContext::validateTexFuncFormatAndType(const char* functionNam
|
| }
|
| break;
|
| case GL_DEPTH_COMPONENT:
|
| - if (!m_webglDepthTexture) {
|
| + if (!extensionEnabled(WebGLDepthTextureName)) {
|
| synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid format. DEPTH_COMPONENT not enabled");
|
| return false;
|
| }
|
| @@ -4601,7 +4549,7 @@ bool WebGLRenderingContext::validateTexFuncFormatAndType(const char* functionNam
|
| }
|
| break;
|
| case GL_DEPTH_STENCIL_OES:
|
| - if (!m_webglDepthTexture) {
|
| + if (!extensionEnabled(WebGLDepthTextureName)) {
|
| synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid format. DEPTH_STENCIL not enabled");
|
| return false;
|
| }
|
| @@ -4621,7 +4569,7 @@ bool WebGLRenderingContext::validateTexFuncFormatAndType(const char* functionNam
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateTexFuncLevel(const char* functionName, GLenum target, GLint level)
|
| +bool WebGLRenderingContextBase::validateTexFuncLevel(const char* functionName, GLenum target, GLint level)
|
| {
|
| if (level < 0) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "level < 0");
|
| @@ -4651,7 +4599,7 @@ bool WebGLRenderingContext::validateTexFuncLevel(const char* functionName, GLenu
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateTexFuncDimensions(const char* functionName, TexFuncValidationFunctionType functionType,
|
| +bool WebGLRenderingContextBase::validateTexFuncDimensions(const char* functionName, TexFuncValidationFunctionType functionType,
|
| GLenum target, GLint level, GLsizei width, GLsizei height)
|
| {
|
| if (width < 0 || height < 0) {
|
| @@ -4690,7 +4638,7 @@ bool WebGLRenderingContext::validateTexFuncDimensions(const char* functionName,
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateTexFuncParameters(const char* functionName, TexFuncValidationFunctionType functionType, GLenum target,
|
| +bool WebGLRenderingContextBase::validateTexFuncParameters(const char* functionName, TexFuncValidationFunctionType functionType, GLenum target,
|
| GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type)
|
| {
|
| // We absolutely have to validate the format and type combination.
|
| @@ -4715,7 +4663,7 @@ bool WebGLRenderingContext::validateTexFuncParameters(const char* functionName,
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateTexFuncData(const char* functionName, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView* pixels, NullDisposition disposition)
|
| +bool WebGLRenderingContextBase::validateTexFuncData(const char* functionName, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView* pixels, NullDisposition disposition)
|
| {
|
| // All calling functions check isContextLost, so a duplicate check is not needed here.
|
| if (!pixels) {
|
| @@ -4783,12 +4731,12 @@ bool WebGLRenderingContext::validateTexFuncData(const char* functionName, GLint
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateCompressedTexFormat(GLenum format)
|
| +bool WebGLRenderingContextBase::validateCompressedTexFormat(GLenum format)
|
| {
|
| return m_compressedTextureFormats.contains(format);
|
| }
|
|
|
| -bool WebGLRenderingContext::validateCompressedTexFuncData(const char* functionName, GLsizei width, GLsizei height, GLenum format, ArrayBufferView* pixels)
|
| +bool WebGLRenderingContextBase::validateCompressedTexFuncData(const char* functionName, GLsizei width, GLsizei height, GLenum format, ArrayBufferView* pixels)
|
| {
|
| if (!pixels) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "no pixels");
|
| @@ -4862,7 +4810,7 @@ bool WebGLRenderingContext::validateCompressedTexFuncData(const char* functionNa
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateCompressedTexDimensions(const char* functionName, TexFuncValidationFunctionType functionType, GLenum target, GLint level, GLsizei width, GLsizei height, GLenum format)
|
| +bool WebGLRenderingContextBase::validateCompressedTexDimensions(const char* functionName, TexFuncValidationFunctionType functionType, GLenum target, GLint level, GLsizei width, GLsizei height, GLenum format)
|
| {
|
| if (!validateTexFuncDimensions(functionName, functionType, target, level, width, height))
|
| return false;
|
| @@ -4887,7 +4835,7 @@ bool WebGLRenderingContext::validateCompressedTexDimensions(const char* function
|
| }
|
| }
|
|
|
| -bool WebGLRenderingContext::validateCompressedTexSubDimensions(const char* functionName, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, WebGLTexture* tex)
|
| +bool WebGLRenderingContextBase::validateCompressedTexSubDimensions(const char* functionName, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, WebGLTexture* tex)
|
| {
|
| if (xoffset < 0 || yoffset < 0) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "xoffset or yoffset < 0");
|
| @@ -4917,7 +4865,7 @@ bool WebGLRenderingContext::validateCompressedTexSubDimensions(const char* funct
|
| }
|
| }
|
|
|
| -bool WebGLRenderingContext::validateDrawMode(const char* functionName, GLenum mode)
|
| +bool WebGLRenderingContextBase::validateDrawMode(const char* functionName, GLenum mode)
|
| {
|
| switch (mode) {
|
| case GL_POINTS:
|
| @@ -4934,7 +4882,7 @@ bool WebGLRenderingContext::validateDrawMode(const char* functionName, GLenum mo
|
| }
|
| }
|
|
|
| -bool WebGLRenderingContext::validateStencilSettings(const char* functionName)
|
| +bool WebGLRenderingContextBase::validateStencilSettings(const char* functionName)
|
| {
|
| if (m_stencilMask != m_stencilMaskBack || m_stencilFuncRef != m_stencilFuncRefBack || m_stencilFuncMask != m_stencilFuncMaskBack) {
|
| synthesizeGLError(GL_INVALID_OPERATION, functionName, "front and back stencils settings do not match");
|
| @@ -4943,7 +4891,7 @@ bool WebGLRenderingContext::validateStencilSettings(const char* functionName)
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateStencilOrDepthFunc(const char* functionName, GLenum func)
|
| +bool WebGLRenderingContextBase::validateStencilOrDepthFunc(const char* functionName, GLenum func)
|
| {
|
| switch (func) {
|
| case GL_NEVER:
|
| @@ -4961,7 +4909,7 @@ bool WebGLRenderingContext::validateStencilOrDepthFunc(const char* functionName,
|
| }
|
| }
|
|
|
| -void WebGLRenderingContext::printGLErrorToConsole(const String& message)
|
| +void WebGLRenderingContextBase::printGLErrorToConsole(const String& message)
|
| {
|
| if (!m_numGLErrorsToConsoleAllowed)
|
| return;
|
| @@ -4975,14 +4923,14 @@ void WebGLRenderingContext::printGLErrorToConsole(const String& message)
|
| return;
|
| }
|
|
|
| -void WebGLRenderingContext::printWarningToConsole(const String& message)
|
| +void WebGLRenderingContextBase::printWarningToConsole(const String& message)
|
| {
|
| if (!canvas())
|
| return;
|
| canvas()->document().addConsoleMessage(RenderingMessageSource, WarningMessageLevel, message);
|
| }
|
|
|
| -bool WebGLRenderingContext::validateFramebufferFuncParameters(const char* functionName, GLenum target, GLenum attachment)
|
| +bool WebGLRenderingContextBase::validateFramebufferFuncParameters(const char* functionName, GLenum target, GLenum attachment)
|
| {
|
| if (target != GL_FRAMEBUFFER) {
|
| synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid target");
|
| @@ -4995,7 +4943,7 @@ bool WebGLRenderingContext::validateFramebufferFuncParameters(const char* functi
|
| case GC3D_DEPTH_STENCIL_ATTACHMENT_WEBGL:
|
| break;
|
| default:
|
| - if (m_webglDrawBuffers
|
| + if (extensionEnabled(WebGLDrawBuffersName)
|
| && attachment > GL_COLOR_ATTACHMENT0
|
| && attachment < static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + maxColorAttachments()))
|
| break;
|
| @@ -5005,7 +4953,7 @@ bool WebGLRenderingContext::validateFramebufferFuncParameters(const char* functi
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateBlendEquation(const char* functionName, GLenum mode)
|
| +bool WebGLRenderingContextBase::validateBlendEquation(const char* functionName, GLenum mode)
|
| {
|
| switch (mode) {
|
| case GL_FUNC_ADD:
|
| @@ -5018,7 +4966,7 @@ bool WebGLRenderingContext::validateBlendEquation(const char* functionName, GLen
|
| }
|
| }
|
|
|
| -bool WebGLRenderingContext::validateBlendFuncFactors(const char* functionName, GLenum src, GLenum dst)
|
| +bool WebGLRenderingContextBase::validateBlendFuncFactors(const char* functionName, GLenum src, GLenum dst)
|
| {
|
| if (((src == GL_CONSTANT_COLOR || src == GL_ONE_MINUS_CONSTANT_COLOR)
|
| && (dst == GL_CONSTANT_ALPHA || dst == GL_ONE_MINUS_CONSTANT_ALPHA))
|
| @@ -5030,7 +4978,7 @@ bool WebGLRenderingContext::validateBlendFuncFactors(const char* functionName, G
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateCapability(const char* functionName, GLenum cap)
|
| +bool WebGLRenderingContextBase::validateCapability(const char* functionName, GLenum cap)
|
| {
|
| switch (cap) {
|
| case GL_BLEND:
|
| @@ -5049,7 +4997,7 @@ bool WebGLRenderingContext::validateCapability(const char* functionName, GLenum
|
| }
|
| }
|
|
|
| -bool WebGLRenderingContext::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, Float32Array* v, GLsizei requiredMinSize)
|
| +bool WebGLRenderingContextBase::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, Float32Array* v, GLsizei requiredMinSize)
|
| {
|
| if (!v) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "no array");
|
| @@ -5058,7 +5006,7 @@ bool WebGLRenderingContext::validateUniformParameters(const char* functionName,
|
| return validateUniformMatrixParameters(functionName, location, false, v->data(), v->length(), requiredMinSize);
|
| }
|
|
|
| -bool WebGLRenderingContext::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, Int32Array* v, GLsizei requiredMinSize)
|
| +bool WebGLRenderingContextBase::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, Int32Array* v, GLsizei requiredMinSize)
|
| {
|
| if (!v) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "no array");
|
| @@ -5067,12 +5015,12 @@ bool WebGLRenderingContext::validateUniformParameters(const char* functionName,
|
| return validateUniformMatrixParameters(functionName, location, false, v->data(), v->length(), requiredMinSize);
|
| }
|
|
|
| -bool WebGLRenderingContext::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, void* v, GLsizei size, GLsizei requiredMinSize)
|
| +bool WebGLRenderingContextBase::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, void* v, GLsizei size, GLsizei requiredMinSize)
|
| {
|
| return validateUniformMatrixParameters(functionName, location, false, v, size, requiredMinSize);
|
| }
|
|
|
| -bool WebGLRenderingContext::validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v, GLsizei requiredMinSize)
|
| +bool WebGLRenderingContextBase::validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation* location, GLboolean transpose, Float32Array* v, GLsizei requiredMinSize)
|
| {
|
| if (!v) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "no array");
|
| @@ -5081,7 +5029,7 @@ bool WebGLRenderingContext::validateUniformMatrixParameters(const char* function
|
| return validateUniformMatrixParameters(functionName, location, transpose, v->data(), v->length(), requiredMinSize);
|
| }
|
|
|
| -bool WebGLRenderingContext::validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation* location, GLboolean transpose, void* v, GLsizei size, GLsizei requiredMinSize)
|
| +bool WebGLRenderingContextBase::validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation* location, GLboolean transpose, void* v, GLsizei size, GLsizei requiredMinSize)
|
| {
|
| if (!location)
|
| return false;
|
| @@ -5104,7 +5052,7 @@ bool WebGLRenderingContext::validateUniformMatrixParameters(const char* function
|
| return true;
|
| }
|
|
|
| -WebGLBuffer* WebGLRenderingContext::validateBufferDataParameters(const char* functionName, GLenum target, GLenum usage)
|
| +WebGLBuffer* WebGLRenderingContextBase::validateBufferDataParameters(const char* functionName, GLenum target, GLenum usage)
|
| {
|
| WebGLBuffer* buffer = 0;
|
| switch (target) {
|
| @@ -5132,7 +5080,7 @@ WebGLBuffer* WebGLRenderingContext::validateBufferDataParameters(const char* fun
|
| return 0;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateHTMLImageElement(const char* functionName, HTMLImageElement* image, ExceptionState& exceptionState)
|
| +bool WebGLRenderingContextBase::validateHTMLImageElement(const char* functionName, HTMLImageElement* image, ExceptionState& exceptionState)
|
| {
|
| if (!image || !image->cachedImage()) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "no image");
|
| @@ -5150,7 +5098,7 @@ bool WebGLRenderingContext::validateHTMLImageElement(const char* functionName, H
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateHTMLCanvasElement(const char* functionName, HTMLCanvasElement* canvas, ExceptionState& exceptionState)
|
| +bool WebGLRenderingContextBase::validateHTMLCanvasElement(const char* functionName, HTMLCanvasElement* canvas, ExceptionState& exceptionState)
|
| {
|
| if (!canvas || !canvas->buffer()) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "no canvas");
|
| @@ -5163,7 +5111,7 @@ bool WebGLRenderingContext::validateHTMLCanvasElement(const char* functionName,
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateHTMLVideoElement(const char* functionName, HTMLVideoElement* video, ExceptionState& exceptionState)
|
| +bool WebGLRenderingContextBase::validateHTMLVideoElement(const char* functionName, HTMLVideoElement* video, ExceptionState& exceptionState)
|
| {
|
| if (!video || !video->videoWidth() || !video->videoHeight()) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "no video");
|
| @@ -5176,7 +5124,7 @@ bool WebGLRenderingContext::validateHTMLVideoElement(const char* functionName, H
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateDrawArrays(const char* functionName, GLenum mode, GLint first, GLsizei count)
|
| +bool WebGLRenderingContextBase::validateDrawArrays(const char* functionName, GLenum mode, GLint first, GLsizei count)
|
| {
|
| if (isContextLost() || !validateDrawMode(functionName, mode))
|
| return false;
|
| @@ -5207,7 +5155,7 @@ bool WebGLRenderingContext::validateDrawArrays(const char* functionName, GLenum
|
| return true;
|
| }
|
|
|
| -bool WebGLRenderingContext::validateDrawElements(const char* functionName, GLenum mode, GLsizei count, GLenum type, long long offset)
|
| +bool WebGLRenderingContextBase::validateDrawElements(const char* functionName, GLenum mode, GLsizei count, GLenum type, long long offset)
|
| {
|
| if (isContextLost() || !validateDrawMode(functionName, mode))
|
| return false;
|
| @@ -5220,7 +5168,7 @@ bool WebGLRenderingContext::validateDrawElements(const char* functionName, GLenu
|
| case GL_UNSIGNED_SHORT:
|
| break;
|
| case GL_UNSIGNED_INT:
|
| - if (m_oesElementIndexUint)
|
| + if (extensionEnabled(OESElementIndexUintName))
|
| break;
|
| synthesizeGLError(GL_INVALID_ENUM, functionName, "invalid type");
|
| return false;
|
| @@ -5258,7 +5206,7 @@ bool WebGLRenderingContext::validateDrawElements(const char* functionName, GLenu
|
| }
|
|
|
| // Helper function to validate draw*Instanced calls
|
| -bool WebGLRenderingContext::validateDrawInstanced(const char* functionName, GLsizei primcount)
|
| +bool WebGLRenderingContextBase::validateDrawInstanced(const char* functionName, GLsizei primcount)
|
| {
|
| if (primcount < 0) {
|
| synthesizeGLError(GL_INVALID_VALUE, functionName, "primcount < 0");
|
| @@ -5276,7 +5224,7 @@ bool WebGLRenderingContext::validateDrawInstanced(const char* functionName, GLsi
|
| return false;
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttribfImpl(const char* functionName, GLuint index, GLsizei expectedSize, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
|
| +void WebGLRenderingContextBase::vertexAttribfImpl(const char* functionName, GLuint index, GLsizei expectedSize, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -5306,7 +5254,7 @@ void WebGLRenderingContext::vertexAttribfImpl(const char* functionName, GLuint i
|
| attribValue.value[3] = v3;
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttribfvImpl(const char* functionName, GLuint index, Float32Array* v, GLsizei expectedSize)
|
| +void WebGLRenderingContextBase::vertexAttribfvImpl(const char* functionName, GLuint index, Float32Array* v, GLsizei expectedSize)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -5317,7 +5265,7 @@ void WebGLRenderingContext::vertexAttribfvImpl(const char* functionName, GLuint
|
| vertexAttribfvImpl(functionName, index, v->data(), v->length(), expectedSize);
|
| }
|
|
|
| -void WebGLRenderingContext::vertexAttribfvImpl(const char* functionName, GLuint index, GLfloat* v, GLsizei size, GLsizei expectedSize)
|
| +void WebGLRenderingContextBase::vertexAttribfvImpl(const char* functionName, GLuint index, GLfloat* v, GLsizei size, GLsizei expectedSize)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -5354,7 +5302,7 @@ void WebGLRenderingContext::vertexAttribfvImpl(const char* functionName, GLuint
|
| attribValue.value[ii] = v[ii];
|
| }
|
|
|
| -void WebGLRenderingContext::dispatchContextLostEvent(Timer<WebGLRenderingContext>*)
|
| +void WebGLRenderingContextBase::dispatchContextLostEvent(Timer<WebGLRenderingContextBase>*)
|
| {
|
| RefPtr<WebGLContextEvent> event = WebGLContextEvent::create(EventTypeNames::webglcontextlost, false, true, "");
|
| canvas()->dispatchEvent(event);
|
| @@ -5364,7 +5312,7 @@ void WebGLRenderingContext::dispatchContextLostEvent(Timer<WebGLRenderingContext
|
| m_restoreTimer.startOneShot(0);
|
| }
|
|
|
| -void WebGLRenderingContext::maybeRestoreContext(Timer<WebGLRenderingContext>*)
|
| +void WebGLRenderingContextBase::maybeRestoreContext(Timer<WebGLRenderingContextBase>*)
|
| {
|
| ASSERT(isContextLost());
|
|
|
| @@ -5420,20 +5368,20 @@ void WebGLRenderingContext::maybeRestoreContext(Timer<WebGLRenderingContext>*)
|
| canvas()->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextrestored, false, true, ""));
|
| }
|
|
|
| -String WebGLRenderingContext::ensureNotNull(const String& text) const
|
| +String WebGLRenderingContextBase::ensureNotNull(const String& text) const
|
| {
|
| if (text.isNull())
|
| return WTF::emptyString();
|
| return text;
|
| }
|
|
|
| -WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache(int capacity)
|
| +WebGLRenderingContextBase::LRUImageBufferCache::LRUImageBufferCache(int capacity)
|
| : m_buffers(adoptArrayPtr(new OwnPtr<ImageBuffer>[capacity]))
|
| , m_capacity(capacity)
|
| {
|
| }
|
|
|
| -ImageBuffer* WebGLRenderingContext::LRUImageBufferCache::imageBuffer(const IntSize& size)
|
| +ImageBuffer* WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer(const IntSize& size)
|
| {
|
| int i;
|
| for (i = 0; i < m_capacity; ++i) {
|
| @@ -5457,7 +5405,7 @@ ImageBuffer* WebGLRenderingContext::LRUImageBufferCache::imageBuffer(const IntSi
|
| return buf;
|
| }
|
|
|
| -void WebGLRenderingContext::LRUImageBufferCache::bubbleToFront(int idx)
|
| +void WebGLRenderingContextBase::LRUImageBufferCache::bubbleToFront(int idx)
|
| {
|
| for (int i = idx; i > 0; --i)
|
| m_buffers[i].swap(m_buffers[i-1]);
|
| @@ -5487,7 +5435,7 @@ namespace {
|
|
|
| } // namespace anonymous
|
|
|
| -void WebGLRenderingContext::synthesizeGLError(GLenum error, const char* functionName, const char* description, ConsoleDisplayPreference display)
|
| +void WebGLRenderingContextBase::synthesizeGLError(GLenum error, const char* functionName, const char* description, ConsoleDisplayPreference display)
|
| {
|
| String errorType = GetErrorString(error);
|
| if (m_synthesizedErrorsToConsole && display == DisplayInConsole) {
|
| @@ -5503,7 +5451,7 @@ void WebGLRenderingContext::synthesizeGLError(GLenum error, const char* function
|
| InspectorInstrumentation::didFireWebGLError(canvas(), errorType);
|
| }
|
|
|
| -void WebGLRenderingContext::emitGLWarning(const char* functionName, const char* description)
|
| +void WebGLRenderingContextBase::emitGLWarning(const char* functionName, const char* description)
|
| {
|
| if (m_synthesizedErrorsToConsole) {
|
| String message = String("WebGL: ") + String(functionName) + ": " + String(description);
|
| @@ -5512,7 +5460,7 @@ void WebGLRenderingContext::emitGLWarning(const char* functionName, const char*
|
| InspectorInstrumentation::didFireWebGLWarning(canvas());
|
| }
|
|
|
| -void WebGLRenderingContext::applyStencilTest()
|
| +void WebGLRenderingContextBase::applyStencilTest()
|
| {
|
| bool haveStencilBuffer = false;
|
|
|
| @@ -5526,7 +5474,7 @@ void WebGLRenderingContext::applyStencilTest()
|
| m_stencilEnabled && haveStencilBuffer);
|
| }
|
|
|
| -void WebGLRenderingContext::enableOrDisable(GLenum capability, bool enable)
|
| +void WebGLRenderingContextBase::enableOrDisable(GLenum capability, bool enable)
|
| {
|
| if (isContextLost())
|
| return;
|
| @@ -5536,15 +5484,15 @@ void WebGLRenderingContext::enableOrDisable(GLenum capability, bool enable)
|
| m_context->disable(capability);
|
| }
|
|
|
| -IntSize WebGLRenderingContext::clampedCanvasSize()
|
| +IntSize WebGLRenderingContextBase::clampedCanvasSize()
|
| {
|
| return IntSize(clamp(canvas()->width(), 1, m_maxViewportDims[0]),
|
| clamp(canvas()->height(), 1, m_maxViewportDims[1]));
|
| }
|
|
|
| -GLint WebGLRenderingContext::maxDrawBuffers()
|
| +GLint WebGLRenderingContextBase::maxDrawBuffers()
|
| {
|
| - if (isContextLost() || !m_webglDrawBuffers)
|
| + if (isContextLost() || !extensionEnabled(WebGLDrawBuffersName))
|
| return 0;
|
| if (!m_maxDrawBuffers)
|
| m_context->getIntegerv(GL_MAX_DRAW_BUFFERS_EXT, &m_maxDrawBuffers);
|
| @@ -5554,39 +5502,39 @@ GLint WebGLRenderingContext::maxDrawBuffers()
|
| return std::min(m_maxDrawBuffers, m_maxColorAttachments);
|
| }
|
|
|
| -GLint WebGLRenderingContext::maxColorAttachments()
|
| +GLint WebGLRenderingContextBase::maxColorAttachments()
|
| {
|
| - if (isContextLost() || !m_webglDrawBuffers)
|
| + if (isContextLost() || !extensionEnabled(WebGLDrawBuffersName))
|
| return 0;
|
| if (!m_maxColorAttachments)
|
| m_context->getIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &m_maxColorAttachments);
|
| return m_maxColorAttachments;
|
| }
|
|
|
| -void WebGLRenderingContext::setBackDrawBuffer(GLenum buf)
|
| +void WebGLRenderingContextBase::setBackDrawBuffer(GLenum buf)
|
| {
|
| m_backDrawBuffer = buf;
|
| }
|
|
|
| -void WebGLRenderingContext::restoreCurrentFramebuffer()
|
| +void WebGLRenderingContextBase::restoreCurrentFramebuffer()
|
| {
|
| bindFramebuffer(GL_FRAMEBUFFER, m_framebufferBinding.get());
|
| }
|
|
|
| -void WebGLRenderingContext::restoreCurrentTexture2D()
|
| +void WebGLRenderingContextBase::restoreCurrentTexture2D()
|
| {
|
| bindTexture(GL_TEXTURE_2D, m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get());
|
| }
|
|
|
| -void WebGLRenderingContext::multisamplingChanged(bool enabled)
|
| +void WebGLRenderingContextBase::multisamplingChanged(bool enabled)
|
| {
|
| if (m_multisamplingAllowed != enabled) {
|
| m_multisamplingAllowed = enabled;
|
| - forceLostContext(WebGLRenderingContext::AutoRecoverSyntheticLostContext);
|
| + forceLostContext(WebGLRenderingContextBase::AutoRecoverSyntheticLostContext);
|
| }
|
| }
|
|
|
| -void WebGLRenderingContext::findNewMaxEnabledAttribIndex()
|
| +void WebGLRenderingContextBase::findNewMaxEnabledAttribIndex()
|
| {
|
| // Trace backwards from the current max to find the new max enabled attrib index
|
| int startIndex = m_onePlusMaxEnabledAttribIndex - 1;
|
| @@ -5599,7 +5547,7 @@ void WebGLRenderingContext::findNewMaxEnabledAttribIndex()
|
| m_onePlusMaxEnabledAttribIndex = 0;
|
| }
|
|
|
| -void WebGLRenderingContext::findNewMaxNonDefaultTextureUnit()
|
| +void WebGLRenderingContextBase::findNewMaxNonDefaultTextureUnit()
|
| {
|
| // Trace backwards from the current max to find the new max non-default texture unit
|
| int startIndex = m_onePlusMaxNonDefaultTextureUnit - 1;
|
|
|