| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef WebGLRenderingContext_h | 26 #ifndef WebGLRenderingContextBase_h |
| 27 #define WebGLRenderingContext_h | 27 #define WebGLRenderingContextBase_h |
| 28 | 28 |
| 29 #include "core/dom/ActiveDOMObject.h" | 29 #include "core/dom/ActiveDOMObject.h" |
| 30 #include "core/html/canvas/CanvasRenderingContext.h" | 30 #include "core/html/canvas/CanvasRenderingContext.h" |
| 31 #include "core/html/canvas/WebGLExtensionName.h" |
| 31 #include "core/html/canvas/WebGLGetInfo.h" | 32 #include "core/html/canvas/WebGLGetInfo.h" |
| 32 #include "core/page/Page.h" | 33 #include "core/page/Page.h" |
| 33 #include "platform/Timer.h" | 34 #include "platform/Timer.h" |
| 34 #include "platform/graphics/GraphicsTypes3D.h" | 35 #include "platform/graphics/GraphicsTypes3D.h" |
| 35 #include "platform/graphics/ImageBuffer.h" | 36 #include "platform/graphics/ImageBuffer.h" |
| 36 #include "platform/graphics/gpu/Extensions3DUtil.h" | 37 #include "platform/graphics/gpu/Extensions3DUtil.h" |
| 37 #include "platform/graphics/gpu/WebGLImageConversion.h" | 38 #include "platform/graphics/gpu/WebGLImageConversion.h" |
| 38 #include "public/platform/WebGraphicsContext3D.h" | 39 #include "public/platform/WebGraphicsContext3D.h" |
| 39 #include "wtf/Float32Array.h" | 40 #include "wtf/Float32Array.h" |
| 40 #include "wtf/Int32Array.h" | 41 #include "wtf/Int32Array.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 class WebGLShader; | 86 class WebGLShader; |
| 86 class WebGLShaderPrecisionFormat; | 87 class WebGLShaderPrecisionFormat; |
| 87 class WebGLSharedObject; | 88 class WebGLSharedObject; |
| 88 class WebGLTexture; | 89 class WebGLTexture; |
| 89 class WebGLUniformLocation; | 90 class WebGLUniformLocation; |
| 90 class WebGLVertexArrayObjectOES; | 91 class WebGLVertexArrayObjectOES; |
| 91 | 92 |
| 92 class WebGLRenderingContextLostCallback; | 93 class WebGLRenderingContextLostCallback; |
| 93 class WebGLRenderingContextErrorMessageCallback; | 94 class WebGLRenderingContextErrorMessageCallback; |
| 94 | 95 |
| 95 class WebGLRenderingContext FINAL : public CanvasRenderingContext, public Active
DOMObject, private Page::MultisamplingChangedObserver { | 96 class WebGLRenderingContextBase : public CanvasRenderingContext, public ActiveDO
MObject, private Page::MultisamplingChangedObserver { |
| 96 public: | 97 public: |
| 97 static PassOwnPtr<WebGLRenderingContext> create(HTMLCanvasElement*, WebGLCon
textAttributes*); | 98 virtual ~WebGLRenderingContextBase(); |
| 98 virtual ~WebGLRenderingContext(); | |
| 99 | 99 |
| 100 virtual bool is3d() const OVERRIDE { return true; } | 100 virtual bool is3d() const OVERRIDE { return true; } |
| 101 virtual bool isAccelerated() const OVERRIDE { return true; } | 101 virtual bool isAccelerated() const OVERRIDE { return true; } |
| 102 virtual unsigned version() const = 0; |
| 103 virtual String contextName() const = 0; |
| 104 virtual void registerContextExtensions() = 0; |
| 105 |
| 106 static unsigned getWebGLVersion(const CanvasRenderingContext*); |
| 102 | 107 |
| 103 int drawingBufferWidth() const; | 108 int drawingBufferWidth() const; |
| 104 int drawingBufferHeight() const; | 109 int drawingBufferHeight() const; |
| 105 | 110 |
| 106 void activeTexture(GLenum texture); | 111 void activeTexture(GLenum texture); |
| 107 void attachShader(WebGLProgram*, WebGLShader*); | 112 void attachShader(WebGLProgram*, WebGLShader*); |
| 108 void bindAttribLocation(WebGLProgram*, GLuint index, const String& name); | 113 void bindAttribLocation(WebGLProgram*, GLuint index, const String& name); |
| 109 void bindBuffer(GLenum target, WebGLBuffer*); | 114 void bindBuffer(GLenum target, WebGLBuffer*); |
| 110 void bindFramebuffer(GLenum target, WebGLFramebuffer*); | 115 void bindFramebuffer(GLenum target, WebGLFramebuffer*); |
| 111 void bindRenderbuffer(GLenum target, WebGLRenderbuffer*); | 116 void bindRenderbuffer(GLenum target, WebGLRenderbuffer*); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 336 |
| 332 void removeSharedObject(WebGLSharedObject*); | 337 void removeSharedObject(WebGLSharedObject*); |
| 333 void removeContextObject(WebGLContextObject*); | 338 void removeContextObject(WebGLContextObject*); |
| 334 | 339 |
| 335 unsigned maxVertexAttribs() const { return m_maxVertexAttribs; } | 340 unsigned maxVertexAttribs() const { return m_maxVertexAttribs; } |
| 336 | 341 |
| 337 // ActiveDOMObject notifications | 342 // ActiveDOMObject notifications |
| 338 virtual bool hasPendingActivity() const OVERRIDE; | 343 virtual bool hasPendingActivity() const OVERRIDE; |
| 339 virtual void stop() OVERRIDE; | 344 virtual void stop() OVERRIDE; |
| 340 | 345 |
| 341 private: | 346 protected: |
| 342 friend class WebGLDrawBuffers; | 347 friend class WebGLDrawBuffers; |
| 343 friend class WebGLFramebuffer; | 348 friend class WebGLFramebuffer; |
| 344 friend class WebGLObject; | 349 friend class WebGLObject; |
| 345 friend class OESVertexArrayObject; | 350 friend class OESVertexArrayObject; |
| 346 friend class WebGLDebugShaders; | 351 friend class WebGLDebugShaders; |
| 347 friend class WebGLCompressedTextureATC; | 352 friend class WebGLCompressedTextureATC; |
| 348 friend class WebGLCompressedTexturePVRTC; | 353 friend class WebGLCompressedTexturePVRTC; |
| 349 friend class WebGLCompressedTextureS3TC; | 354 friend class WebGLCompressedTextureS3TC; |
| 350 friend class WebGLRenderingContextErrorMessageCallback; | 355 friend class WebGLRenderingContextErrorMessageCallback; |
| 351 friend class WebGLVertexArrayObjectOES; | 356 friend class WebGLVertexArrayObjectOES; |
| 352 | 357 |
| 353 WebGLRenderingContext(HTMLCanvasElement*, PassOwnPtr<blink::WebGraphicsConte
xt3D>, WebGLContextAttributes*); | 358 WebGLRenderingContextBase(HTMLCanvasElement*, PassOwnPtr<blink::WebGraphicsC
ontext3D>, WebGLContextAttributes*); |
| 354 void initializeNewContext(); | 359 void initializeNewContext(); |
| 355 void setupFlags(); | 360 void setupFlags(); |
| 356 | 361 |
| 357 void addSharedObject(WebGLSharedObject*); | 362 void addSharedObject(WebGLSharedObject*); |
| 358 void addContextObject(WebGLContextObject*); | 363 void addContextObject(WebGLContextObject*); |
| 359 void detachAndRemoveAllObjects(); | 364 void detachAndRemoveAllObjects(); |
| 360 | 365 |
| 361 void destroyContext(); | 366 void destroyContext(); |
| 362 void markContextChanged(); | 367 void markContextChanged(); |
| 363 | 368 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 390 | 395 |
| 391 // Structure for rendering to a DrawingBuffer, instead of directly | 396 // Structure for rendering to a DrawingBuffer, instead of directly |
| 392 // to the back-buffer of m_context. | 397 // to the back-buffer of m_context. |
| 393 RefPtr<DrawingBuffer> m_drawingBuffer; | 398 RefPtr<DrawingBuffer> m_drawingBuffer; |
| 394 | 399 |
| 395 // Dispatches a context lost event once it is determined that one is needed. | 400 // Dispatches a context lost event once it is determined that one is needed. |
| 396 // This is used both for synthetic and real context losses. For real ones, i
t's | 401 // This is used both for synthetic and real context losses. For real ones, i
t's |
| 397 // likely that there's no JavaScript on the stack, but that might be depende
nt | 402 // likely that there's no JavaScript on the stack, but that might be depende
nt |
| 398 // on how exactly the platform discovers that the context was lost. For bett
er | 403 // on how exactly the platform discovers that the context was lost. For bett
er |
| 399 // portability we always defer the dispatch of the event. | 404 // portability we always defer the dispatch of the event. |
| 400 Timer<WebGLRenderingContext> m_dispatchContextLostEventTimer; | 405 Timer<WebGLRenderingContextBase> m_dispatchContextLostEventTimer; |
| 401 bool m_restoreAllowed; | 406 bool m_restoreAllowed; |
| 402 Timer<WebGLRenderingContext> m_restoreTimer; | 407 Timer<WebGLRenderingContextBase> m_restoreTimer; |
| 403 | 408 |
| 404 bool m_needsUpdate; | 409 bool m_needsUpdate; |
| 405 bool m_markedCanvasDirty; | 410 bool m_markedCanvasDirty; |
| 406 HashSet<WebGLContextObject*> m_contextObjects; | 411 HashSet<WebGLContextObject*> m_contextObjects; |
| 407 | 412 |
| 408 OwnPtr<WebGLRenderingContextLostCallback> m_contextLostCallbackAdapter; | 413 OwnPtr<WebGLRenderingContextLostCallback> m_contextLostCallbackAdapter; |
| 409 OwnPtr<WebGLRenderingContextErrorMessageCallback> m_errorMessageCallbackAdap
ter; | 414 OwnPtr<WebGLRenderingContextErrorMessageCallback> m_errorMessageCallbackAdap
ter; |
| 410 | 415 |
| 411 // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER a
nd stored values for ELEMENT_ARRAY_BUFFER | 416 // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER a
nd stored values for ELEMENT_ARRAY_BUFFER |
| 412 RefPtr<WebGLBuffer> m_boundArrayBuffer; | 417 RefPtr<WebGLBuffer> m_boundArrayBuffer; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 int m_numGLErrorsToConsoleAllowed; | 522 int m_numGLErrorsToConsoleAllowed; |
| 518 | 523 |
| 519 bool m_multisamplingAllowed; | 524 bool m_multisamplingAllowed; |
| 520 bool m_multisamplingObserverRegistered; | 525 bool m_multisamplingObserverRegistered; |
| 521 | 526 |
| 522 GLuint m_onePlusMaxEnabledAttribIndex; | 527 GLuint m_onePlusMaxEnabledAttribIndex; |
| 523 unsigned long m_onePlusMaxNonDefaultTextureUnit; | 528 unsigned long m_onePlusMaxNonDefaultTextureUnit; |
| 524 | 529 |
| 525 OwnPtr<Extensions3DUtil> m_extensionsUtil; | 530 OwnPtr<Extensions3DUtil> m_extensionsUtil; |
| 526 | 531 |
| 527 // Enabled extension objects. | |
| 528 RefPtr<ANGLEInstancedArrays> m_angleInstancedArrays; | |
| 529 RefPtr<EXTFragDepth> m_extFragDepth; | |
| 530 RefPtr<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; | |
| 531 RefPtr<OESTextureFloat> m_oesTextureFloat; | |
| 532 RefPtr<OESTextureFloatLinear> m_oesTextureFloatLinear; | |
| 533 RefPtr<OESTextureHalfFloat> m_oesTextureHalfFloat; | |
| 534 RefPtr<OESTextureHalfFloatLinear> m_oesTextureHalfFloatLinear; | |
| 535 RefPtr<OESStandardDerivatives> m_oesStandardDerivatives; | |
| 536 RefPtr<OESVertexArrayObject> m_oesVertexArrayObject; | |
| 537 RefPtr<OESElementIndexUint> m_oesElementIndexUint; | |
| 538 RefPtr<WebGLLoseContext> m_webglLoseContext; | |
| 539 RefPtr<WebGLDebugRendererInfo> m_webglDebugRendererInfo; | |
| 540 RefPtr<WebGLDebugShaders> m_webglDebugShaders; | |
| 541 RefPtr<WebGLDrawBuffers> m_webglDrawBuffers; | |
| 542 RefPtr<WebGLCompressedTextureATC> m_webglCompressedTextureATC; | |
| 543 RefPtr<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC; | |
| 544 RefPtr<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC; | |
| 545 RefPtr<WebGLDepthTexture> m_webglDepthTexture; | |
| 546 | |
| 547 enum ExtensionFlags { | 532 enum ExtensionFlags { |
| 548 ApprovedExtension = 0x00, | 533 ApprovedExtension = 0x00, |
| 549 DraftExtension = 0x01, | 534 DraftExtension = 0x01, |
| 550 PrivilegedExtension = 0x02, | 535 PrivilegedExtension = 0x02, |
| 551 PrefixedExtension = 0x04, | 536 PrefixedExtension = 0x04, |
| 552 WebGLDebugRendererInfoExtension = 0x08, | 537 WebGLDebugRendererInfoExtension = 0x08, |
| 553 }; | 538 }; |
| 554 | 539 |
| 555 class ExtensionTracker { | 540 class ExtensionTracker { |
| 556 public: | 541 public: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 582 return m_draft; | 567 return m_draft; |
| 583 } | 568 } |
| 584 | 569 |
| 585 bool webglDebugRendererInfo() const | 570 bool webglDebugRendererInfo() const |
| 586 { | 571 { |
| 587 return m_webglDebugRendererInfo; | 572 return m_webglDebugRendererInfo; |
| 588 } | 573 } |
| 589 | 574 |
| 590 bool matchesNameWithPrefixes(const String&) const; | 575 bool matchesNameWithPrefixes(const String&) const; |
| 591 | 576 |
| 592 virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContext*)
const = 0; | 577 virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContextBas
e*) = 0; |
| 593 virtual bool supported(WebGLRenderingContext*) const = 0; | 578 virtual bool supported(WebGLRenderingContextBase*) const = 0; |
| 594 virtual const char* extensionName() const = 0; | 579 virtual const char* extensionName() const = 0; |
| 595 virtual void loseExtension() = 0; | 580 virtual void loseExtension() = 0; |
| 596 | 581 |
| 597 private: | 582 private: |
| 598 bool m_privileged; | 583 bool m_privileged; |
| 599 bool m_draft; | 584 bool m_draft; |
| 600 bool m_prefixed; | 585 bool m_prefixed; |
| 601 bool m_webglDebugRendererInfo; | 586 bool m_webglDebugRendererInfo; |
| 602 const char* const* m_prefixes; | 587 const char* const* m_prefixes; |
| 603 }; | 588 }; |
| 604 | 589 |
| 605 template <typename T> | 590 template <typename T> |
| 606 class TypedExtensionTracker FINAL : public ExtensionTracker { | 591 class TypedExtensionTracker FINAL : public ExtensionTracker { |
| 607 public: | 592 public: |
| 608 TypedExtensionTracker(RefPtr<T>& extensionField, ExtensionFlags flags, c
onst char* const* prefixes) | 593 TypedExtensionTracker(RefPtr<T>& extensionField, ExtensionFlags flags, c
onst char* const* prefixes) |
| 609 : ExtensionTracker(flags, prefixes) | 594 : ExtensionTracker(flags, prefixes) |
| 610 , m_extensionField(extensionField) | 595 , m_extensionField(extensionField) |
| 596 , m_extension(nullptr) |
| 611 { | 597 { |
| 612 } | 598 } |
| 613 | 599 |
| 614 virtual ~TypedExtensionTracker() | 600 virtual ~TypedExtensionTracker() |
| 615 { | 601 { |
| 616 if (m_extensionField) { | 602 if (m_extension) { |
| 617 m_extensionField->lose(true); | 603 m_extension->lose(true); |
| 618 m_extensionField = nullptr; | 604 m_extension = nullptr; |
| 619 } | 605 } |
| 620 } | 606 } |
| 621 | 607 |
| 622 virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContext* c
ontext) const OVERRIDE | 608 virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContextBas
e* context) OVERRIDE |
| 623 { | 609 { |
| 624 if (!m_extensionField) | 610 if (!m_extension) { |
| 625 m_extensionField = T::create(context); | 611 m_extension = T::create(context); |
| 612 m_extensionField = m_extension; |
| 613 } |
| 626 | 614 |
| 627 return m_extensionField; | 615 return m_extension; |
| 628 } | 616 } |
| 629 | 617 |
| 630 virtual bool supported(WebGLRenderingContext* context) const OVERRIDE | 618 virtual bool supported(WebGLRenderingContextBase* context) const OVERRID
E |
| 631 { | 619 { |
| 632 return T::supported(context); | 620 return T::supported(context); |
| 633 } | 621 } |
| 634 | 622 |
| 635 virtual const char* extensionName() const OVERRIDE | 623 virtual const char* extensionName() const OVERRIDE |
| 636 { | 624 { |
| 637 return T::extensionName(); | 625 return T::extensionName(); |
| 638 } | 626 } |
| 639 | 627 |
| 640 virtual void loseExtension() OVERRIDE | 628 virtual void loseExtension() OVERRIDE |
| 641 { | 629 { |
| 642 if (m_extensionField) { | 630 if (m_extension) { |
| 643 m_extensionField->lose(false); | 631 m_extension->lose(false); |
| 644 if (m_extensionField->isLost()) | 632 if (m_extension->isLost()) |
| 645 m_extensionField = nullptr; | 633 m_extension = nullptr; |
| 646 } | 634 } |
| 647 } | 635 } |
| 648 | 636 |
| 649 private: | 637 private: |
| 650 RefPtr<T>& m_extensionField; | 638 RefPtr<T>& m_extensionField; |
| 639 // ExtensionTracker holds it's own reference to the extension to ensure |
| 640 // that it is not deleted before this object's destructor is called |
| 641 RefPtr<T> m_extension; |
| 651 }; | 642 }; |
| 652 | 643 |
| 644 bool m_extensionEnabled[WebGLExtensionNameCount]; |
| 653 Vector<ExtensionTracker*> m_extensions; | 645 Vector<ExtensionTracker*> m_extensions; |
| 654 | 646 |
| 655 template <typename T> | 647 template <typename T> |
| 656 void registerExtension(RefPtr<T>& extensionPtr, ExtensionFlags flags = Appro
vedExtension, const char* const* prefixes = 0) | 648 void registerExtension(RefPtr<T>& extensionPtr, ExtensionFlags flags = Appro
vedExtension, const char* const* prefixes = 0) |
| 657 { | 649 { |
| 658 m_extensions.append(new TypedExtensionTracker<T>(extensionPtr, flags, pr
efixes)); | 650 m_extensions.append(new TypedExtensionTracker<T>(extensionPtr, flags, pr
efixes)); |
| 659 } | 651 } |
| 660 | 652 |
| 653 inline bool extensionEnabled(WebGLExtensionName name) |
| 654 { |
| 655 return m_extensionEnabled[name]; |
| 656 } |
| 657 |
| 661 // Errors raised by synthesizeGLError() while the context is lost. | 658 // Errors raised by synthesizeGLError() while the context is lost. |
| 662 Vector<GLenum> m_lostContextErrors; | 659 Vector<GLenum> m_lostContextErrors; |
| 663 | 660 |
| 664 // Helpers for getParameter and others | 661 // Helpers for getParameter and others |
| 665 WebGLGetInfo getBooleanParameter(GLenum); | 662 WebGLGetInfo getBooleanParameter(GLenum); |
| 666 WebGLGetInfo getBooleanArrayParameter(GLenum); | 663 WebGLGetInfo getBooleanArrayParameter(GLenum); |
| 667 WebGLGetInfo getFloatParameter(GLenum); | 664 WebGLGetInfo getFloatParameter(GLenum); |
| 668 WebGLGetInfo getIntParameter(GLenum); | 665 WebGLGetInfo getIntParameter(GLenum); |
| 669 WebGLGetInfo getUnsignedIntParameter(GLenum); | 666 WebGLGetInfo getUnsignedIntParameter(GLenum); |
| 670 WebGLGetInfo getWebGLFloatArrayParameter(GLenum); | 667 WebGLGetInfo getWebGLFloatArrayParameter(GLenum); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 | 843 |
| 847 // Helper function for delete* (deleteBuffer, deleteProgram, etc) functions. | 844 // Helper function for delete* (deleteBuffer, deleteProgram, etc) functions. |
| 848 // Return false if caller should return without further processing. | 845 // Return false if caller should return without further processing. |
| 849 bool deleteObject(WebGLObject*); | 846 bool deleteObject(WebGLObject*); |
| 850 | 847 |
| 851 // Helper function for bind* (bindBuffer, bindTexture, etc) and useProgram. | 848 // Helper function for bind* (bindBuffer, bindTexture, etc) and useProgram. |
| 852 // If the object has already been deleted, set deleted to true upon return. | 849 // If the object has already been deleted, set deleted to true upon return. |
| 853 // Return false if caller should return without further processing. | 850 // Return false if caller should return without further processing. |
| 854 bool checkObjectToBeBound(const char* functionName, WebGLObject*, bool& dele
ted); | 851 bool checkObjectToBeBound(const char* functionName, WebGLObject*, bool& dele
ted); |
| 855 | 852 |
| 856 void dispatchContextLostEvent(Timer<WebGLRenderingContext>*); | 853 void dispatchContextLostEvent(Timer<WebGLRenderingContextBase>*); |
| 857 // Helper for restoration after context lost. | 854 // Helper for restoration after context lost. |
| 858 void maybeRestoreContext(Timer<WebGLRenderingContext>*); | 855 void maybeRestoreContext(Timer<WebGLRenderingContextBase>*); |
| 859 | 856 |
| 860 // Determine if we are running privileged code in the browser, for example, | 857 // Determine if we are running privileged code in the browser, for example, |
| 861 // a Safari or Chrome extension. | 858 // a Safari or Chrome extension. |
| 862 bool allowPrivilegedExtensions() const; | 859 bool allowPrivilegedExtensions() const; |
| 863 | 860 |
| 864 // Determine if WEBGL_debug_renderer_info extension is enabled. For the | 861 // Determine if WEBGL_debug_renderer_info extension is enabled. For the |
| 865 // moment it can be enabled either through a chromium finch experiment | 862 // moment it can be enabled either through a chromium finch experiment |
| 866 // or for privileged code in the browser. | 863 // or for privileged code in the browser. |
| 867 bool allowWebGLDebugRendererInfo() const; | 864 bool allowWebGLDebugRendererInfo() const; |
| 868 | 865 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 899 void restoreCurrentTexture2D(); | 896 void restoreCurrentTexture2D(); |
| 900 | 897 |
| 901 virtual void multisamplingChanged(bool) OVERRIDE; | 898 virtual void multisamplingChanged(bool) OVERRIDE; |
| 902 | 899 |
| 903 void findNewMaxEnabledAttribIndex(); | 900 void findNewMaxEnabledAttribIndex(); |
| 904 void findNewMaxNonDefaultTextureUnit(); | 901 void findNewMaxNonDefaultTextureUnit(); |
| 905 | 902 |
| 906 friend class WebGLStateRestorer; | 903 friend class WebGLStateRestorer; |
| 907 friend class WebGLRenderingContextEvictionManager; | 904 friend class WebGLRenderingContextEvictionManager; |
| 908 | 905 |
| 909 static Vector<WebGLRenderingContext*>& activeContexts(); | 906 static Vector<WebGLRenderingContextBase*>& activeContexts(); |
| 910 static Vector<WebGLRenderingContext*>& forciblyEvictedContexts(); | 907 static Vector<WebGLRenderingContextBase*>& forciblyEvictedContexts(); |
| 911 | 908 |
| 912 static void activateContext(WebGLRenderingContext*); | 909 static void activateContext(WebGLRenderingContextBase*); |
| 913 static void deactivateContext(WebGLRenderingContext*, bool addToInactiveList
); | 910 static void deactivateContext(WebGLRenderingContextBase*, bool addToInactive
List); |
| 914 static void willDestroyContext(WebGLRenderingContext*); | 911 static void willDestroyContext(WebGLRenderingContextBase*); |
| 915 static void forciblyLoseOldestContext(const String& reason); | 912 static void forciblyLoseOldestContext(const String& reason); |
| 916 // Return the least recently used context's position in the active context v
ector. | 913 // Return the least recently used context's position in the active context v
ector. |
| 917 // If the vector is empty, return the maximum allowed active context number. | 914 // If the vector is empty, return the maximum allowed active context number. |
| 918 static size_t oldestContextIndex(); | 915 static size_t oldestContextIndex(); |
| 919 static IntSize oldestContextSize(); | 916 static IntSize oldestContextSize(); |
| 920 }; | 917 }; |
| 921 | 918 |
| 922 DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context, contex
t->is3d(), context.is3d()); | 919 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); |
| 923 | 920 |
| 924 } // namespace WebCore | 921 } // namespace WebCore |
| 925 | 922 |
| 926 #endif | 923 #endif // WebGLRenderingContextBase_h |
| OLD | NEW |