| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 static unsigned getWebGLVersion(const CanvasRenderingContext*); | 164 static unsigned getWebGLVersion(const CanvasRenderingContext*); |
| 165 | 165 |
| 166 static PassOwnPtr<WebGraphicsContext3D> createWebGraphicsContext3D(HTMLCanva
sElement*, WebGLContextAttributes, unsigned webGLVersion); | 166 static PassOwnPtr<WebGraphicsContext3D> createWebGraphicsContext3D(HTMLCanva
sElement*, WebGLContextAttributes, unsigned webGLVersion); |
| 167 static void forceNextWebGLContextCreationToFail(); | 167 static void forceNextWebGLContextCreationToFail(); |
| 168 | 168 |
| 169 int drawingBufferWidth() const; | 169 int drawingBufferWidth() const; |
| 170 int drawingBufferHeight() const; | 170 int drawingBufferHeight() const; |
| 171 | 171 |
| 172 void activeTexture(GLenum texture); | 172 void activeTexture(GLenum texture); |
| 173 void attachShader(WebGLProgram*, WebGLShader*); | 173 void attachShader(ScriptState*, WebGLProgram*, WebGLShader*); |
| 174 void bindAttribLocation(WebGLProgram*, GLuint index, const String& name); | 174 void bindAttribLocation(WebGLProgram*, GLuint index, const String& name); |
| 175 void bindBuffer(GLenum target, WebGLBuffer*); | 175 void bindBuffer(ScriptState*, GLenum target, WebGLBuffer*); |
| 176 virtual void bindFramebuffer(GLenum target, WebGLFramebuffer*); | 176 virtual void bindFramebuffer(ScriptState*, GLenum target, WebGLFramebuffer*)
; |
| 177 void bindRenderbuffer(GLenum target, WebGLRenderbuffer*); | 177 void bindRenderbuffer(ScriptState*, GLenum target, WebGLRenderbuffer*); |
| 178 void bindTexture(GLenum target, WebGLTexture*); | 178 void bindTexture(ScriptState*, GLenum target, WebGLTexture*); |
| 179 void blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); | 179 void blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); |
| 180 void blendEquation(GLenum mode); | 180 void blendEquation(GLenum mode); |
| 181 void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); | 181 void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); |
| 182 void blendFunc(GLenum sfactor, GLenum dfactor); | 182 void blendFunc(GLenum sfactor, GLenum dfactor); |
| 183 void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum
dstAlpha); | 183 void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum
dstAlpha); |
| 184 | 184 |
| 185 void bufferData(GLenum target, long long size, GLenum usage); | 185 void bufferData(GLenum target, long long size, GLenum usage); |
| 186 void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); | 186 void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); |
| 187 void bufferData(GLenum target, DOMArrayBufferView* data, GLenum usage); | 187 void bufferData(GLenum target, DOMArrayBufferView* data, GLenum usage); |
| 188 void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); | 188 void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 214 void deleteBuffer(WebGLBuffer*); | 214 void deleteBuffer(WebGLBuffer*); |
| 215 virtual void deleteFramebuffer(WebGLFramebuffer*); | 215 virtual void deleteFramebuffer(WebGLFramebuffer*); |
| 216 void deleteProgram(WebGLProgram*); | 216 void deleteProgram(WebGLProgram*); |
| 217 void deleteRenderbuffer(WebGLRenderbuffer*); | 217 void deleteRenderbuffer(WebGLRenderbuffer*); |
| 218 void deleteShader(WebGLShader*); | 218 void deleteShader(WebGLShader*); |
| 219 void deleteTexture(WebGLTexture*); | 219 void deleteTexture(WebGLTexture*); |
| 220 | 220 |
| 221 void depthFunc(GLenum); | 221 void depthFunc(GLenum); |
| 222 void depthMask(GLboolean); | 222 void depthMask(GLboolean); |
| 223 void depthRange(GLfloat zNear, GLfloat zFar); | 223 void depthRange(GLfloat zNear, GLfloat zFar); |
| 224 void detachShader(WebGLProgram*, WebGLShader*); | 224 void detachShader(ScriptState*, WebGLProgram*, WebGLShader*); |
| 225 void disable(GLenum cap); | 225 void disable(GLenum cap); |
| 226 void disableVertexAttribArray(GLuint index); | 226 void disableVertexAttribArray(GLuint index); |
| 227 void drawArrays(GLenum mode, GLint first, GLsizei count); | 227 void drawArrays(GLenum mode, GLint first, GLsizei count); |
| 228 void drawElements(GLenum mode, GLsizei count, GLenum type, long long offset)
; | 228 void drawElements(GLenum mode, GLsizei count, GLenum type, long long offset)
; |
| 229 | 229 |
| 230 void drawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsiz
ei primcount); | 230 void drawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsiz
ei primcount); |
| 231 void drawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, lon
g long offset, GLsizei primcount); | 231 void drawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, lon
g long offset, GLsizei primcount); |
| 232 | 232 |
| 233 void enable(GLenum cap); | 233 void enable(GLenum cap); |
| 234 void enableVertexAttribArray(GLuint index); | 234 void enableVertexAttribArray(GLuint index); |
| 235 void finish(); | 235 void finish(); |
| 236 void flush(); | 236 void flush(); |
| 237 void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum render
buffertarget, WebGLRenderbuffer*); | 237 void framebufferRenderbuffer(ScriptState*, GLenum target, GLenum attachment,
GLenum renderbuffertarget, WebGLRenderbuffer*); |
| 238 void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget
, WebGLTexture*, GLint level); | 238 void framebufferTexture2D(ScriptState*, GLenum target, GLenum attachment, GL
enum textarget, WebGLTexture*, GLint level); |
| 239 void frontFace(GLenum mode); | 239 void frontFace(GLenum mode); |
| 240 void generateMipmap(GLenum target); | 240 void generateMipmap(GLenum target); |
| 241 | 241 |
| 242 WebGLActiveInfo* getActiveAttrib(WebGLProgram*, GLuint index); | 242 WebGLActiveInfo* getActiveAttrib(WebGLProgram*, GLuint index); |
| 243 WebGLActiveInfo* getActiveUniform(WebGLProgram*, GLuint index); | 243 WebGLActiveInfo* getActiveUniform(WebGLProgram*, GLuint index); |
| 244 bool getAttachedShaders(WebGLProgram*, HeapVector<Member<WebGLShader>>&); | 244 bool getAttachedShaders(WebGLProgram*, HeapVector<Member<WebGLShader>>&); |
| 245 Nullable<HeapVector<Member<WebGLShader>>> getAttachedShaders(WebGLProgram*); | 245 Nullable<HeapVector<Member<WebGLShader>>> getAttachedShaders(WebGLProgram*); |
| 246 GLint getAttribLocation(WebGLProgram*, const String& name); | 246 GLint getAttribLocation(WebGLProgram*, const String& name); |
| 247 ScriptValue getBufferParameter(ScriptState*, GLenum target, GLenum pname); | 247 ScriptValue getBufferParameter(ScriptState*, GLenum target, GLenum pname); |
| 248 void getContextAttributes(Nullable<WebGLContextAttributes>&); | 248 void getContextAttributes(Nullable<WebGLContextAttributes>&); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 void uniform4i(const WebGLUniformLocation*, GLint x, GLint y, GLint z, GLint
w); | 341 void uniform4i(const WebGLUniformLocation*, GLint x, GLint y, GLint z, GLint
w); |
| 342 void uniform4iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); | 342 void uniform4iv(const WebGLUniformLocation*, const FlexibleInt32ArrayView&); |
| 343 void uniform4iv(const WebGLUniformLocation*, Vector<GLint>&); | 343 void uniform4iv(const WebGLUniformLocation*, Vector<GLint>&); |
| 344 void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); | 344 void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); |
| 345 void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); | 345 void uniformMatrix2fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); |
| 346 void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); | 346 void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); |
| 347 void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); | 347 void uniformMatrix3fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); |
| 348 void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); | 348 void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, DOMF
loat32Array* value); |
| 349 void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); | 349 void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, Vect
or<GLfloat>& value); |
| 350 | 350 |
| 351 void useProgram(WebGLProgram*); | 351 void useProgram(ScriptState*, WebGLProgram*); |
| 352 void validateProgram(WebGLProgram*); | 352 void validateProgram(WebGLProgram*); |
| 353 | 353 |
| 354 void vertexAttrib1f(GLuint index, GLfloat x); | 354 void vertexAttrib1f(GLuint index, GLfloat x); |
| 355 void vertexAttrib1fv(GLuint index, const DOMFloat32Array* values); | 355 void vertexAttrib1fv(GLuint index, const DOMFloat32Array* values); |
| 356 void vertexAttrib1fv(GLuint index, const Vector<GLfloat>& values); | 356 void vertexAttrib1fv(GLuint index, const Vector<GLfloat>& values); |
| 357 void vertexAttrib2f(GLuint index, GLfloat x, GLfloat y); | 357 void vertexAttrib2f(GLuint index, GLfloat x, GLfloat y); |
| 358 void vertexAttrib2fv(GLuint index, const DOMFloat32Array* values); | 358 void vertexAttrib2fv(GLuint index, const DOMFloat32Array* values); |
| 359 void vertexAttrib2fv(GLuint index, const Vector<GLfloat>& values); | 359 void vertexAttrib2fv(GLuint index, const Vector<GLfloat>& values); |
| 360 void vertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); | 360 void vertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z); |
| 361 void vertexAttrib3fv(GLuint index, const DOMFloat32Array* values); | 361 void vertexAttrib3fv(GLuint index, const DOMFloat32Array* values); |
| 362 void vertexAttrib3fv(GLuint index, const Vector<GLfloat>& values); | 362 void vertexAttrib3fv(GLuint index, const Vector<GLfloat>& values); |
| 363 void vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w
); | 363 void vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w
); |
| 364 void vertexAttrib4fv(GLuint index, const DOMFloat32Array* values); | 364 void vertexAttrib4fv(GLuint index, const DOMFloat32Array* values); |
| 365 void vertexAttrib4fv(GLuint index, const Vector<GLfloat>& values); | 365 void vertexAttrib4fv(GLuint index, const Vector<GLfloat>& values); |
| 366 void vertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean no
rmalized, | 366 void vertexAttribPointer(ScriptState*, GLuint index, GLint size, GLenum type
, GLboolean normalized, |
| 367 GLsizei stride, long long offset); | 367 GLsizei stride, long long offset); |
| 368 | 368 |
| 369 void vertexAttribDivisorANGLE(GLuint index, GLuint divisor); | 369 void vertexAttribDivisorANGLE(GLuint index, GLuint divisor); |
| 370 | 370 |
| 371 void viewport(GLint x, GLint y, GLsizei width, GLsizei height); | 371 void viewport(GLint x, GLint y, GLsizei width, GLsizei height); |
| 372 | 372 |
| 373 // WEBGL_lose_context support | 373 // WEBGL_lose_context support |
| 374 enum AutoRecoveryMethod { | 374 enum AutoRecoveryMethod { |
| 375 // Don't restore automatically. | 375 // Don't restore automatically. |
| 376 Manual, | 376 Manual, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 friend class WebGLCompressedTextureASTC; | 443 friend class WebGLCompressedTextureASTC; |
| 444 friend class WebGLCompressedTextureATC; | 444 friend class WebGLCompressedTextureATC; |
| 445 friend class WebGLCompressedTextureETC1; | 445 friend class WebGLCompressedTextureETC1; |
| 446 friend class WebGLCompressedTexturePVRTC; | 446 friend class WebGLCompressedTexturePVRTC; |
| 447 friend class WebGLCompressedTextureS3TC; | 447 friend class WebGLCompressedTextureS3TC; |
| 448 friend class WebGLRenderingContextErrorMessageCallback; | 448 friend class WebGLRenderingContextErrorMessageCallback; |
| 449 friend class WebGLVertexArrayObjectBase; | 449 friend class WebGLVertexArrayObjectBase; |
| 450 friend class ScopedTexture2DRestorer; | 450 friend class ScopedTexture2DRestorer; |
| 451 friend class ScopedFramebufferRestorer; | 451 friend class ScopedFramebufferRestorer; |
| 452 | 452 |
| 453 WebGLRenderingContextBase(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext3
D>, const WebGLContextAttributes&); | 453 WebGLRenderingContextBase(HTMLCanvasElement*, ScriptState*, PassOwnPtr<WebGr
aphicsContext3D>, const WebGLContextAttributes&); |
| 454 PassRefPtr<DrawingBuffer> createDrawingBuffer(PassOwnPtr<WebGraphicsContext3
D>); | 454 PassRefPtr<DrawingBuffer> createDrawingBuffer(PassOwnPtr<WebGraphicsContext3
D>); |
| 455 void setupFlags(); | 455 void setupFlags(); |
| 456 | 456 |
| 457 // CanvasRenderingContext implementation. | 457 // CanvasRenderingContext implementation. |
| 458 bool is3d() const override { return true; } | 458 bool is3d() const override { return true; } |
| 459 bool isAccelerated() const override { return true; } | 459 bool isAccelerated() const override { return true; } |
| 460 void setIsHidden(bool) override; | 460 void setIsHidden(bool) override; |
| 461 bool paintRenderingResultsToCanvas(SourceDrawingBuffer) override; | 461 bool paintRenderingResultsToCanvas(SourceDrawingBuffer) override; |
| 462 WebLayer* platformLayer() const override; | 462 WebLayer* platformLayer() const override; |
| 463 void stop() override; | 463 void stop() override; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 486 // Adds a compressed texture format. | 486 // Adds a compressed texture format. |
| 487 void addCompressedTextureFormat(GLenum); | 487 void addCompressedTextureFormat(GLenum); |
| 488 void removeAllCompressedTextureFormats(); | 488 void removeAllCompressedTextureFormats(); |
| 489 | 489 |
| 490 PassRefPtr<Image> drawImageIntoBuffer(PassRefPtr<Image>, int width, int heig
ht, const char* functionName); | 490 PassRefPtr<Image> drawImageIntoBuffer(PassRefPtr<Image>, int width, int heig
ht, const char* functionName); |
| 491 | 491 |
| 492 PassRefPtr<Image> videoFrameToImage(HTMLVideoElement*); | 492 PassRefPtr<Image> videoFrameToImage(HTMLVideoElement*); |
| 493 | 493 |
| 494 WebGLRenderbuffer* ensureEmulatedStencilBuffer(GLenum target, WebGLRenderbuf
fer*); | 494 WebGLRenderbuffer* ensureEmulatedStencilBuffer(GLenum target, WebGLRenderbuf
fer*); |
| 495 | 495 |
| 496 // ScriptState at the time the context was created. |
| 497 RefPtr<ScriptState> m_scriptState; |
| 498 |
| 496 // Structure for rendering to a DrawingBuffer, instead of directly | 499 // Structure for rendering to a DrawingBuffer, instead of directly |
| 497 // to the back-buffer of m_context. | 500 // to the back-buffer of m_context. |
| 498 RefPtr<DrawingBuffer> m_drawingBuffer; | 501 RefPtr<DrawingBuffer> m_drawingBuffer; |
| 499 DrawingBuffer* drawingBuffer() const; | 502 DrawingBuffer* drawingBuffer() const; |
| 500 | 503 |
| 501 RefPtr<WebGLContextGroup> m_contextGroup; | 504 RefPtr<WebGLContextGroup> m_contextGroup; |
| 502 | 505 |
| 503 LostContextMode m_contextLostMode; | 506 LostContextMode m_contextLostMode; |
| 504 AutoRecoveryMethod m_autoRecoveryMethod; | 507 AutoRecoveryMethod m_autoRecoveryMethod; |
| 505 // Dispatches a context lost event once it is determined that one is needed. | 508 // Dispatches a context lost event once it is determined that one is needed. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 524 #endif | 527 #endif |
| 525 | 528 |
| 526 PersistentWillBeMember<WebGLRenderingContextLostCallback> m_contextLostCallb
ackAdapter; | 529 PersistentWillBeMember<WebGLRenderingContextLostCallback> m_contextLostCallb
ackAdapter; |
| 527 PersistentWillBeMember<WebGLRenderingContextErrorMessageCallback> m_errorMes
sageCallbackAdapter; | 530 PersistentWillBeMember<WebGLRenderingContextErrorMessageCallback> m_errorMes
sageCallbackAdapter; |
| 528 | 531 |
| 529 // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER a
nd stored values for ELEMENT_ARRAY_BUFFER | 532 // List of bound VBO's. Used to maintain info about sizes for ARRAY_BUFFER a
nd stored values for ELEMENT_ARRAY_BUFFER |
| 530 PersistentWillBeMember<WebGLBuffer> m_boundArrayBuffer; | 533 PersistentWillBeMember<WebGLBuffer> m_boundArrayBuffer; |
| 531 | 534 |
| 532 PersistentWillBeMember<WebGLVertexArrayObjectBase> m_defaultVertexArrayObjec
t; | 535 PersistentWillBeMember<WebGLVertexArrayObjectBase> m_defaultVertexArrayObjec
t; |
| 533 PersistentWillBeMember<WebGLVertexArrayObjectBase> m_boundVertexArrayObject; | 536 PersistentWillBeMember<WebGLVertexArrayObjectBase> m_boundVertexArrayObject; |
| 534 void setBoundVertexArrayObject(WebGLVertexArrayObjectBase* arrayObject) | 537 void setBoundVertexArrayObject(ScriptState*, WebGLVertexArrayObjectBase*); |
| 535 { | |
| 536 if (arrayObject) | |
| 537 m_boundVertexArrayObject = arrayObject; | |
| 538 else | |
| 539 m_boundVertexArrayObject = m_defaultVertexArrayObject; | |
| 540 } | |
| 541 | 538 |
| 542 enum VertexAttribValueType { | 539 enum VertexAttribValueType { |
| 543 Float32ArrayType, | 540 Float32ArrayType, |
| 544 Int32ArrayType, | 541 Int32ArrayType, |
| 545 Uint32ArrayType, | 542 Uint32ArrayType, |
| 546 }; | 543 }; |
| 547 | 544 |
| 548 class VertexAttribValue { | 545 class VertexAttribValue { |
| 549 public: | 546 public: |
| 550 VertexAttribValue() | 547 VertexAttribValue() |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 | 1094 |
| 1098 virtual void restoreCurrentFramebuffer(); | 1095 virtual void restoreCurrentFramebuffer(); |
| 1099 void restoreCurrentTexture2D(); | 1096 void restoreCurrentTexture2D(); |
| 1100 | 1097 |
| 1101 void multisamplingChanged(bool) override; | 1098 void multisamplingChanged(bool) override; |
| 1102 | 1099 |
| 1103 void findNewMaxNonDefaultTextureUnit(); | 1100 void findNewMaxNonDefaultTextureUnit(); |
| 1104 | 1101 |
| 1105 virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum
internalformat, GLsizei width, GLsizei height, const char* functionName); | 1102 virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum
internalformat, GLsizei width, GLsizei height, const char* functionName); |
| 1106 | 1103 |
| 1104 // Ensures that the JavaScript wrappers for objects that are |
| 1105 // latched into the context's state, or which are implicitly |
| 1106 // linked together (like programs and their attached shaders), are |
| 1107 // not garbage collected before they should be. |
| 1108 static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObjec
t, const char* baseName, unsigned long index, ScriptWrappable* targetObject); |
| 1109 void maybePreserveDefaultVAOObjectWrapper(ScriptState*); |
| 1110 |
| 1107 friend class WebGLStateRestorer; | 1111 friend class WebGLStateRestorer; |
| 1108 friend class WebGLRenderingContextEvictionManager; | 1112 friend class WebGLRenderingContextEvictionManager; |
| 1109 | 1113 |
| 1110 static Vector<WebGLRenderingContextBase*>& activeContexts(); | 1114 static Vector<WebGLRenderingContextBase*>& activeContexts(); |
| 1111 static Vector<WebGLRenderingContextBase*>& forciblyEvictedContexts(); | 1115 static Vector<WebGLRenderingContextBase*>& forciblyEvictedContexts(); |
| 1112 | 1116 |
| 1113 static void activateContext(WebGLRenderingContextBase*); | 1117 static void activateContext(WebGLRenderingContextBase*); |
| 1114 static void deactivateContext(WebGLRenderingContextBase*); | 1118 static void deactivateContext(WebGLRenderingContextBase*); |
| 1115 static void addToEvictedList(WebGLRenderingContextBase*); | 1119 static void addToEvictedList(WebGLRenderingContextBase*); |
| 1116 static void removeFromEvictedList(WebGLRenderingContextBase*); | 1120 static void removeFromEvictedList(WebGLRenderingContextBase*); |
| 1117 static void willDestroyContext(WebGLRenderingContextBase*); | 1121 static void willDestroyContext(WebGLRenderingContextBase*); |
| 1118 static void forciblyLoseOldestContext(const String& reason); | 1122 static void forciblyLoseOldestContext(const String& reason); |
| 1119 // Return the least recently used context's position in the active context v
ector. | 1123 // Return the least recently used context's position in the active context v
ector. |
| 1120 // If the vector is empty, return the maximum allowed active context number. | 1124 // If the vector is empty, return the maximum allowed active context number. |
| 1121 static size_t oldestContextIndex(); | 1125 static size_t oldestContextIndex(); |
| 1122 static IntSize oldestContextSize(); | 1126 static IntSize oldestContextSize(); |
| 1123 }; | 1127 }; |
| 1124 | 1128 |
| 1125 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); | 1129 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co
ntext->is3d(), context.is3d()); |
| 1126 | 1130 |
| 1127 } // namespace blink | 1131 } // namespace blink |
| 1128 | 1132 |
| 1129 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); | 1133 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB
ase::TextureUnitState); |
| 1130 | 1134 |
| 1131 #endif // WebGLRenderingContextBase_h | 1135 #endif // WebGLRenderingContextBase_h |
| OLD | NEW |