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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 void enableVertexAttribArray(GLuint index); | 178 void enableVertexAttribArray(GLuint index); |
179 void finish(); | 179 void finish(); |
180 void flush(); | 180 void flush(); |
181 void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum render
buffertarget, WebGLRenderbuffer*); | 181 void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum render
buffertarget, WebGLRenderbuffer*); |
182 void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget
, WebGLTexture*, GLint level); | 182 void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget
, WebGLTexture*, GLint level); |
183 void frontFace(GLenum mode); | 183 void frontFace(GLenum mode); |
184 void generateMipmap(GLenum target); | 184 void generateMipmap(GLenum target); |
185 | 185 |
186 PassRefPtrWillBeRawPtr<WebGLActiveInfo> getActiveAttrib(WebGLProgram*, GLuin
t index); | 186 PassRefPtrWillBeRawPtr<WebGLActiveInfo> getActiveAttrib(WebGLProgram*, GLuin
t index); |
187 PassRefPtrWillBeRawPtr<WebGLActiveInfo> getActiveUniform(WebGLProgram*, GLui
nt index); | 187 PassRefPtrWillBeRawPtr<WebGLActiveInfo> getActiveUniform(WebGLProgram*, GLui
nt index); |
188 bool getAttachedShaders(WebGLProgram*, WillBeHeapVector<RefPtrWillBeMember<W
ebGLShader> >&); | 188 bool getAttachedShaders(WebGLProgram*, WillBeHeapVector<RefPtrWillBeMember<W
ebGLShader>>&); |
189 Nullable<WillBeHeapVector<RefPtrWillBeMember<WebGLShader> > > getAttachedSha
ders(WebGLProgram*); | 189 Nullable<WillBeHeapVector<RefPtrWillBeMember<WebGLShader>>> getAttachedShade
rs(WebGLProgram*); |
190 GLint getAttribLocation(WebGLProgram*, const String& name); | 190 GLint getAttribLocation(WebGLProgram*, const String& name); |
191 WebGLGetInfo getBufferParameter(GLenum target, GLenum pname); | 191 WebGLGetInfo getBufferParameter(GLenum target, GLenum pname); |
192 PassRefPtrWillBeRawPtr<WebGLContextAttributes> getContextAttributes(); | 192 PassRefPtrWillBeRawPtr<WebGLContextAttributes> getContextAttributes(); |
193 GLenum getError(); | 193 GLenum getError(); |
194 PassRefPtrWillBeRawPtr<WebGLExtension> getExtension(const String& name); | 194 PassRefPtrWillBeRawPtr<WebGLExtension> getExtension(const String& name); |
195 WebGLGetInfo getFramebufferAttachmentParameter(GLenum target, GLenum attachm
ent, GLenum pname); | 195 WebGLGetInfo getFramebufferAttachmentParameter(GLenum target, GLenum attachm
ent, GLenum pname); |
196 WebGLGetInfo getParameter(GLenum pname); | 196 WebGLGetInfo getParameter(GLenum pname); |
197 WebGLGetInfo getProgramParameter(WebGLProgram*, GLenum pname); | 197 WebGLGetInfo getProgramParameter(WebGLProgram*, GLenum pname); |
198 String getProgramInfoLog(WebGLProgram*); | 198 String getProgramInfoLog(WebGLProgram*); |
199 WebGLGetInfo getRenderbufferParameter(GLenum target, GLenum pname); | 199 WebGLGetInfo getRenderbufferParameter(GLenum target, GLenum pname); |
200 WebGLGetInfo getShaderParameter(WebGLShader*, GLenum pname); | 200 WebGLGetInfo getShaderParameter(WebGLShader*, GLenum pname); |
201 String getShaderInfoLog(WebGLShader*); | 201 String getShaderInfoLog(WebGLShader*); |
202 PassRefPtrWillBeRawPtr<WebGLShaderPrecisionFormat> getShaderPrecisionFormat(
GLenum shaderType, GLenum precisionType); | 202 PassRefPtrWillBeRawPtr<WebGLShaderPrecisionFormat> getShaderPrecisionFormat(
GLenum shaderType, GLenum precisionType); |
203 String getShaderSource(WebGLShader*); | 203 String getShaderSource(WebGLShader*); |
204 Nullable<Vector<String> > getSupportedExtensions(); | 204 Nullable<Vector<String>> getSupportedExtensions(); |
205 WebGLGetInfo getTexParameter(GLenum target, GLenum pname); | 205 WebGLGetInfo getTexParameter(GLenum target, GLenum pname); |
206 WebGLGetInfo getUniform(WebGLProgram*, const WebGLUniformLocation*); | 206 WebGLGetInfo getUniform(WebGLProgram*, const WebGLUniformLocation*); |
207 PassRefPtrWillBeRawPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram
*, const String&); | 207 PassRefPtrWillBeRawPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram
*, const String&); |
208 WebGLGetInfo getVertexAttrib(GLuint index, GLenum pname); | 208 WebGLGetInfo getVertexAttrib(GLuint index, GLenum pname); |
209 long long getVertexAttribOffset(GLuint index, GLenum pname); | 209 long long getVertexAttribOffset(GLuint index, GLenum pname); |
210 | 210 |
211 void hint(GLenum target, GLenum mode); | 211 void hint(GLenum target, GLenum mode); |
212 GLboolean isBuffer(WebGLBuffer*); | 212 GLboolean isBuffer(WebGLBuffer*); |
213 bool isContextLost() const; | 213 bool isContextLost() const; |
214 GLboolean isEnabled(GLenum cap); | 214 GLboolean isEnabled(GLenum cap); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 // Dispatches a context lost event once it is determined that one is needed. | 450 // Dispatches a context lost event once it is determined that one is needed. |
451 // This is used for synthetic, WEBGL_lose_context and real context losses. F
or real ones, it's | 451 // This is used for synthetic, WEBGL_lose_context and real context losses. F
or real ones, it's |
452 // likely that there's no JavaScript on the stack, but that might be depende
nt | 452 // likely that there's no JavaScript on the stack, but that might be depende
nt |
453 // on how exactly the platform discovers that the context was lost. For bett
er | 453 // on how exactly the platform discovers that the context was lost. For bett
er |
454 // portability we always defer the dispatch of the event. | 454 // portability we always defer the dispatch of the event. |
455 Timer<WebGLRenderingContextBase> m_dispatchContextLostEventTimer; | 455 Timer<WebGLRenderingContextBase> m_dispatchContextLostEventTimer; |
456 bool m_restoreAllowed; | 456 bool m_restoreAllowed; |
457 Timer<WebGLRenderingContextBase> m_restoreTimer; | 457 Timer<WebGLRenderingContextBase> m_restoreTimer; |
458 | 458 |
459 bool m_markedCanvasDirty; | 459 bool m_markedCanvasDirty; |
460 WillBeHeapHashSet<RawPtrWillBeWeakMember<WebGLContextObject> > m_contextObje
cts; | 460 WillBeHeapHashSet<RawPtrWillBeWeakMember<WebGLContextObject>> m_contextObjec
ts; |
461 | 461 |
462 OwnPtrWillBeMember<WebGLRenderingContextLostCallback> m_contextLostCallbackA
dapter; | 462 OwnPtrWillBeMember<WebGLRenderingContextLostCallback> m_contextLostCallbackA
dapter; |
463 OwnPtrWillBeMember<WebGLRenderingContextErrorMessageCallback> m_errorMessage
CallbackAdapter; | 463 OwnPtrWillBeMember<WebGLRenderingContextErrorMessageCallback> m_errorMessage
CallbackAdapter; |
464 | 464 |
465 // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER a
nd stored values for ELEMENT_ARRAY_BUFFER | 465 // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER a
nd stored values for ELEMENT_ARRAY_BUFFER |
466 RefPtrWillBeMember<WebGLBuffer> m_boundArrayBuffer; | 466 RefPtrWillBeMember<WebGLBuffer> m_boundArrayBuffer; |
467 | 467 |
468 RefPtrWillBeMember<WebGLVertexArrayObjectOES> m_defaultVertexArrayObject; | 468 RefPtrWillBeMember<WebGLVertexArrayObjectOES> m_defaultVertexArrayObject; |
469 RefPtrWillBeMember<WebGLVertexArrayObjectOES> m_boundVertexArrayObject; | 469 RefPtrWillBeMember<WebGLVertexArrayObjectOES> m_boundVertexArrayObject; |
470 void setBoundVertexArrayObject(PassRefPtrWillBeRawPtr<WebGLVertexArrayObject
OES> arrayObject) | 470 void setBoundVertexArrayObject(PassRefPtrWillBeRawPtr<WebGLVertexArrayObject
OES> arrayObject) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 virtual void trace(Visitor*) { } | 609 virtual void trace(Visitor*) { } |
610 | 610 |
611 private: | 611 private: |
612 bool m_draft; | 612 bool m_draft; |
613 const char* const* m_prefixes; | 613 const char* const* m_prefixes; |
614 }; | 614 }; |
615 | 615 |
616 template <typename T> | 616 template <typename T> |
617 class TypedExtensionTracker final : public ExtensionTracker { | 617 class TypedExtensionTracker final : public ExtensionTracker { |
618 public: | 618 public: |
619 static PassOwnPtrWillBeRawPtr<TypedExtensionTracker<T> > create(RefPtrWi
llBeMember<T>& extensionField, ExtensionFlags flags, const char* const* prefixes
) | 619 static PassOwnPtrWillBeRawPtr<TypedExtensionTracker<T>> create(RefPtrWil
lBeMember<T>& extensionField, ExtensionFlags flags, const char* const* prefixes) |
620 { | 620 { |
621 return adoptPtrWillBeNoop(new TypedExtensionTracker<T>(extensionFiel
d, flags, prefixes)); | 621 return adoptPtrWillBeNoop(new TypedExtensionTracker<T>(extensionFiel
d, flags, prefixes)); |
622 } | 622 } |
623 | 623 |
624 #if !ENABLE(OILPAN) | 624 #if !ENABLE(OILPAN) |
625 virtual ~TypedExtensionTracker() | 625 virtual ~TypedExtensionTracker() |
626 { | 626 { |
627 if (m_extension) { | 627 if (m_extension) { |
628 m_extension->lose(true); | 628 m_extension->lose(true); |
629 m_extension = nullptr; | 629 m_extension = nullptr; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 { | 673 { |
674 } | 674 } |
675 | 675 |
676 RefPtrWillBeMember<T>& m_extensionField; | 676 RefPtrWillBeMember<T>& m_extensionField; |
677 // ExtensionTracker holds it's own reference to the extension to ensure | 677 // ExtensionTracker holds it's own reference to the extension to ensure |
678 // that it is not deleted before this object's destructor is called | 678 // that it is not deleted before this object's destructor is called |
679 RefPtrWillBeMember<T> m_extension; | 679 RefPtrWillBeMember<T> m_extension; |
680 }; | 680 }; |
681 | 681 |
682 bool m_extensionEnabled[WebGLExtensionNameCount]; | 682 bool m_extensionEnabled[WebGLExtensionNameCount]; |
683 WillBeHeapVector<OwnPtrWillBeMember<ExtensionTracker> > m_extensions; | 683 WillBeHeapVector<OwnPtrWillBeMember<ExtensionTracker>> m_extensions; |
684 | 684 |
685 template <typename T> | 685 template <typename T> |
686 void registerExtension(RefPtrWillBeMember<T>& extensionPtr, ExtensionFlags f
lags = ApprovedExtension, const char* const* prefixes = 0) | 686 void registerExtension(RefPtrWillBeMember<T>& extensionPtr, ExtensionFlags f
lags = ApprovedExtension, const char* const* prefixes = 0) |
687 { | 687 { |
688 m_extensions.append(TypedExtensionTracker<T>::create(extensionPtr, flags
, prefixes)); | 688 m_extensions.append(TypedExtensionTracker<T>::create(extensionPtr, flags
, prefixes)); |
689 } | 689 } |
690 | 690 |
691 bool extensionSupportedAndAllowed(const ExtensionTracker*); | 691 bool extensionSupportedAndAllowed(const ExtensionTracker*); |
692 | 692 |
693 inline bool extensionEnabled(WebGLExtensionName name) | 693 inline bool extensionEnabled(WebGLExtensionName name) |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 static IntSize oldestContextSize(); | 956 static IntSize oldestContextSize(); |
957 }; | 957 }; |
958 | 958 |
959 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); | 959 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); |
960 | 960 |
961 } // namespace blink | 961 } // namespace blink |
962 | 962 |
963 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); | 963 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); |
964 | 964 |
965 #endif // WebGLRenderingContextBase_h | 965 #endif // WebGLRenderingContextBase_h |
OLD | NEW |