| 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 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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 WebGLRenderingContextBase_h | 26 #ifndef WebGLRenderingContextBase_h |
| 27 #define WebGLRenderingContextBase_h | 27 #define WebGLRenderingContextBase_h |
| 28 | 28 |
| 29 #include "bindings/core/v8/Nullable.h" | 29 #include "bindings/core/v8/Nullable.h" |
| 30 #include "bindings/core/v8/ScriptState.h" | 30 #include "bindings/core/v8/ScriptState.h" |
| 31 #include "bindings/core/v8/ScriptValue.h" | 31 #include "bindings/core/v8/ScriptValue.h" |
| 32 #include "bindings/core/v8/ScriptWrappable.h" | 32 #include "bindings/core/v8/ScriptWrappable.h" |
| 33 #include "bindings/core/v8/ScriptWrappableVisitor.h" |
| 33 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
| 34 #include "core/dom/DOMTypedArray.h" | 35 #include "core/dom/DOMTypedArray.h" |
| 35 #include "core/dom/TypedFlexibleArrayBufferView.h" | 36 #include "core/dom/TypedFlexibleArrayBufferView.h" |
| 36 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 37 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
| 37 #include "core/html/canvas/CanvasRenderingContext.h" | 38 #include "core/html/canvas/CanvasRenderingContext.h" |
| 38 #include "core/layout/ContentChangeType.h" | 39 #include "core/layout/ContentChangeType.h" |
| 39 #include "modules/webgl/WebGLContextAttributes.h" | 40 #include "modules/webgl/WebGLContextAttributes.h" |
| 40 #include "modules/webgl/WebGLExtensionName.h" | 41 #include "modules/webgl/WebGLExtensionName.h" |
| 41 #include "modules/webgl/WebGLTexture.h" | 42 #include "modules/webgl/WebGLTexture.h" |
| 42 #include "modules/webgl/WebGLVertexArrayObjectBase.h" | 43 #include "modules/webgl/WebGLVertexArrayObjectBase.h" |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 // was lost. For better portability we always defer the dispatch of the event. | 705 // was lost. For better portability we always defer the dispatch of the event. |
| 705 Timer<WebGLRenderingContextBase> m_dispatchContextLostEventTimer; | 706 Timer<WebGLRenderingContextBase> m_dispatchContextLostEventTimer; |
| 706 bool m_restoreAllowed; | 707 bool m_restoreAllowed; |
| 707 Timer<WebGLRenderingContextBase> m_restoreTimer; | 708 Timer<WebGLRenderingContextBase> m_restoreTimer; |
| 708 | 709 |
| 709 bool m_markedCanvasDirty; | 710 bool m_markedCanvasDirty; |
| 710 HeapHashSet<WeakMember<WebGLContextObject>> m_contextObjects; | 711 HeapHashSet<WeakMember<WebGLContextObject>> m_contextObjects; |
| 711 | 712 |
| 712 // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER and | 713 // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER and |
| 713 // stored values for ELEMENT_ARRAY_BUFFER | 714 // stored values for ELEMENT_ARRAY_BUFFER |
| 714 Member<WebGLBuffer> m_boundArrayBuffer; | 715 TraceWrapperMember<WebGLBuffer> m_boundArrayBuffer; |
| 715 | 716 |
| 716 Member<WebGLVertexArrayObjectBase> m_defaultVertexArrayObject; | 717 Member<WebGLVertexArrayObjectBase> m_defaultVertexArrayObject; |
| 717 Member<WebGLVertexArrayObjectBase> m_boundVertexArrayObject; | 718 TraceWrapperMember<WebGLVertexArrayObjectBase> m_boundVertexArrayObject; |
| 718 void setBoundVertexArrayObject(WebGLVertexArrayObjectBase*); | 719 void setBoundVertexArrayObject(WebGLVertexArrayObjectBase*); |
| 719 | 720 |
| 720 enum VertexAttribValueType { | 721 enum VertexAttribValueType { |
| 721 Float32ArrayType, | 722 Float32ArrayType, |
| 722 Int32ArrayType, | 723 Int32ArrayType, |
| 723 Uint32ArrayType, | 724 Uint32ArrayType, |
| 724 }; | 725 }; |
| 725 | 726 |
| 726 Vector<VertexAttribValueType> m_vertexAttribType; | 727 Vector<VertexAttribValueType> m_vertexAttribType; |
| 727 unsigned m_maxVertexAttribs; | 728 unsigned m_maxVertexAttribs; |
| 728 void setVertexAttribType(GLuint index, VertexAttribValueType); | 729 void setVertexAttribType(GLuint index, VertexAttribValueType); |
| 729 | 730 |
| 730 Member<WebGLProgram> m_currentProgram; | 731 TraceWrapperMember<WebGLProgram> m_currentProgram; |
| 731 Member<WebGLFramebuffer> m_framebufferBinding; | 732 TraceWrapperMember<WebGLFramebuffer> m_framebufferBinding; |
| 732 Member<WebGLRenderbuffer> m_renderbufferBinding; | 733 TraceWrapperMember<WebGLRenderbuffer> m_renderbufferBinding; |
| 733 | 734 |
| 734 HeapVector<TextureUnitState> m_textureUnits; | 735 HeapVector<TextureUnitState> m_textureUnits; |
| 735 unsigned long m_activeTextureUnit; | 736 unsigned long m_activeTextureUnit; |
| 736 | 737 |
| 737 Vector<GLenum> m_compressedTextureFormats; | 738 Vector<GLenum> m_compressedTextureFormats; |
| 738 | 739 |
| 739 // Fixed-size cache of reusable image buffers for video texImage2D calls. | 740 // Fixed-size cache of reusable image buffers for video texImage2D calls. |
| 740 class LRUImageBufferCache { | 741 class LRUImageBufferCache { |
| 741 public: | 742 public: |
| 742 LRUImageBufferCache(int capacity); | 743 LRUImageBufferCache(int capacity); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 : ExtensionTracker(flags, prefixes), m_extensionField(extensionField) {} | 878 : ExtensionTracker(flags, prefixes), m_extensionField(extensionField) {} |
| 878 | 879 |
| 879 GC_PLUGIN_IGNORE("http://crbug.com/519953") | 880 GC_PLUGIN_IGNORE("http://crbug.com/519953") |
| 880 Member<T>& m_extensionField; | 881 Member<T>& m_extensionField; |
| 881 // ExtensionTracker holds it's own reference to the extension to ensure | 882 // ExtensionTracker holds it's own reference to the extension to ensure |
| 882 // that it is not deleted before this object's destructor is called | 883 // that it is not deleted before this object's destructor is called |
| 883 Member<T> m_extension; | 884 Member<T> m_extension; |
| 884 }; | 885 }; |
| 885 | 886 |
| 886 bool m_extensionEnabled[WebGLExtensionNameCount]; | 887 bool m_extensionEnabled[WebGLExtensionNameCount]; |
| 887 HeapVector<Member<ExtensionTracker>> m_extensions; | 888 HeapVector<TraceWrapperMember<ExtensionTracker>> m_extensions; |
| 888 | 889 |
| 889 template <typename T> | 890 template <typename T> |
| 890 void registerExtension(Member<T>& extensionPtr, | 891 void registerExtension(Member<T>& extensionPtr, |
| 891 ExtensionFlags flags = ApprovedExtension, | 892 ExtensionFlags flags = ApprovedExtension, |
| 892 const char* const* prefixes = nullptr) { | 893 const char* const* prefixes = nullptr) { |
| 893 m_extensions.append( | 894 m_extensions.append(TraceWrapperMember<ExtensionTracker>( |
| 894 TypedExtensionTracker<T>::create(extensionPtr, flags, prefixes)); | 895 this, TypedExtensionTracker<T>::create(extensionPtr, flags, prefixes))); |
| 895 } | 896 } |
| 896 | 897 |
| 897 bool extensionSupportedAndAllowed(const ExtensionTracker*); | 898 bool extensionSupportedAndAllowed(const ExtensionTracker*); |
| 898 | 899 |
| 899 inline bool extensionEnabled(WebGLExtensionName name) { | 900 inline bool extensionEnabled(WebGLExtensionName name) { |
| 900 return m_extensionEnabled[name]; | 901 return m_extensionEnabled[name]; |
| 901 } | 902 } |
| 902 | 903 |
| 903 // ScopedDrawingBufferBinder is used for | 904 // ScopedDrawingBufferBinder is used for |
| 904 // ReadPixels/CopyTexImage2D/CopySubImage2D to read from a multisampled | 905 // ReadPixels/CopyTexImage2D/CopySubImage2D to read from a multisampled |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1550 context, | 1551 context, |
| 1551 context->is3d(), | 1552 context->is3d(), |
| 1552 context.is3d()); | 1553 context.is3d()); |
| 1553 | 1554 |
| 1554 } // namespace blink | 1555 } // namespace blink |
| 1555 | 1556 |
| 1556 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( | 1557 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( |
| 1557 blink::WebGLRenderingContextBase::TextureUnitState); | 1558 blink::WebGLRenderingContextBase::TextureUnitState); |
| 1558 | 1559 |
| 1559 #endif // WebGLRenderingContextBase_h | 1560 #endif // WebGLRenderingContextBase_h |
| OLD | NEW |