| Index: Source/core/html/canvas/WebGLRenderingContext.h
|
| diff --git a/Source/core/html/canvas/WebGLRenderingContext.h b/Source/core/html/canvas/WebGLRenderingContext.h
|
| index 358b94b3391948b660b60b701dd7877a3fab8189..8d8acf818e29ae9b0e8c6d1b3969b1cd84183847 100644
|
| --- a/Source/core/html/canvas/WebGLRenderingContext.h
|
| +++ b/Source/core/html/canvas/WebGLRenderingContext.h
|
| @@ -80,6 +80,7 @@ class WebGLProgram;
|
| class WebGLRenderbuffer;
|
| class WebGLShader;
|
| class WebGLSharedObject;
|
| +class WebGLSharedResources;
|
| class WebGLShaderPrecisionFormat;
|
| class WebGLTexture;
|
| class WebGLUniformLocation;
|
| @@ -98,6 +99,10 @@ public:
|
| int drawingBufferWidth() const;
|
| int drawingBufferHeight() const;
|
|
|
| + unsigned contextIndex() const;
|
| + unsigned resourceSyncCount() const;
|
| + void flushResourceChanges();
|
| +
|
| void activeTexture(GC3Denum texture, ExceptionCode&);
|
| void attachShader(WebGLProgram*, WebGLShader*, ExceptionCode&);
|
| void bindAttribLocation(WebGLProgram*, GC3Duint index, const String& name, ExceptionCode&);
|
| @@ -196,7 +201,7 @@ public:
|
|
|
| void hint(GC3Denum target, GC3Denum mode);
|
| GC3Dboolean isBuffer(WebGLBuffer*);
|
| - bool isContextLost();
|
| + bool isContextLost() const;
|
| GC3Dboolean isEnabled(GC3Denum cap);
|
| GC3Dboolean isFramebuffer(WebGLFramebuffer*);
|
| GC3Dboolean isProgram(WebGLProgram*);
|
| @@ -300,6 +305,10 @@ public:
|
|
|
| void viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
|
|
|
| + long acquireSharedResource(WebGLSharedObject*, WebGLSharedObject::AcquireMode, PassRefPtr<WebGLAcquireSharedResourceCallback>, ExceptionCode&);
|
| + void releaseSharedResource(WebGLSharedObject*, ExceptionCode&);
|
| + void cancelAcquireSharedResource(long);
|
| +
|
| // WEBKIT_lose_context support
|
| enum LostContextMode {
|
| // Lost context occurred at the graphics system level.
|
| @@ -334,6 +343,15 @@ public:
|
| virtual bool hasPendingActivity() const;
|
| virtual void stop();
|
|
|
| + enum ConsoleDisplayPreference {
|
| + DisplayInConsole,
|
| + DontDisplayInConsole
|
| + };
|
| +
|
| + // Wrapper for GraphicsContext3D::synthesizeGLError that sends a message
|
| + // to the JavaScript console.
|
| + void synthesizeGLError(GC3Denum, const char* functionName, const char* description, ConsoleDisplayPreference = DisplayInConsole);
|
| +
|
| private:
|
| friend class WebGLDrawBuffers;
|
| friend class WebGLFramebuffer;
|
| @@ -346,7 +364,7 @@ public:
|
| friend class WebGLRenderingContextErrorMessageCallback;
|
| friend class WebGLVertexArrayObjectOES;
|
|
|
| - WebGLRenderingContext(HTMLCanvasElement*, PassRefPtr<GraphicsContext3D>, GraphicsContext3D::Attributes, GraphicsContext3D::Attributes);
|
| + WebGLRenderingContext(HTMLCanvasElement*, PassRefPtr<GraphicsContext3D>, GraphicsContext3D::Attributes, GraphicsContext3D::Attributes, PassRefPtr<WebGLContextGroup>);
|
| void initializeNewContext();
|
| void setupFlags();
|
|
|
| @@ -369,12 +387,15 @@ public:
|
| // Check if each enabled vertex attribute is bound to a buffer.
|
| bool validateRenderingState();
|
|
|
| - bool validateWebGLObject(const char*, WebGLObject*);
|
| + bool validateWebGLContextObject(const char*, WebGLContextObject*);
|
| + bool validateWebGLSharedObject(const char*, WebGLSharedObject*, WebGLSharedObject::AcquireMode);
|
|
|
| // Adds a compressed texture format.
|
| void addCompressedTextureFormat(GC3Denum);
|
| void removeAllCompressedTextureFormats();
|
|
|
| + WebGLBuffer* getBufferForTarget(const char* functionName, GC3Denum target);
|
| +
|
| PassRefPtr<Image> videoFrameToImage(HTMLVideoElement*, BackingStoreCopy, ExceptionCode&);
|
|
|
| WebGLRenderbuffer* ensureEmulatedStencilBuffer(GC3Denum target, WebGLRenderbuffer*);
|
| @@ -527,6 +548,7 @@ public:
|
| RefPtr<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC;
|
| RefPtr<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC;
|
| RefPtr<WebGLDepthTexture> m_webglDepthTexture;
|
| + RefPtr<WebGLSharedResources> m_webglSharedResources;
|
|
|
| class ExtensionTracker {
|
| public:
|
| @@ -639,6 +661,9 @@ public:
|
| WebGLGetInfo getWebGLFloatArrayParameter(GC3Denum);
|
| WebGLGetInfo getWebGLIntArrayParameter(GC3Denum);
|
|
|
| + bool isAcquiredForModification(const char*, WebGLSharedObject*);
|
| + bool isAcquiredForReading(const char*, WebGLSharedObject*);
|
| +
|
| // Clear the backbuffer if it was composited since the last operation.
|
| // clearMask is set to the bitfield of any clear that would happen anyway at this time
|
| // and the function returns true if that clear is now unnecessary.
|
| @@ -684,7 +709,7 @@ public:
|
| // Helper function to check target and texture bound to the target.
|
| // Generate GL errors and return 0 if target is invalid or texture bound is
|
| // null. Otherwise, return the texture bound to the target.
|
| - WebGLTexture* validateTextureBinding(const char* functionName, GC3Denum target, bool useSixEnumsForCubeMap);
|
| + WebGLTexture* validateTextureBinding(const char* functionName, GC3Denum target, bool useSixEnumsForCubeMap, WebGLSharedObject::AcquireMode);
|
|
|
| // Helper function to check input format/type for functions {copy}Tex{Sub}Image.
|
| // Generates GL error and returns false if parameters are invalid.
|
| @@ -828,12 +853,14 @@ public:
|
|
|
| // Helper function for delete* (deleteBuffer, deleteProgram, etc) functions.
|
| // Return false if caller should return without further processing.
|
| - bool deleteObject(WebGLObject*);
|
| + bool deleteContextObject(const char* functionName, WebGLContextObject*);
|
| + bool deleteSharedObject(const char* functionName, WebGLSharedObject*);
|
|
|
| // Helper function for bind* (bindBuffer, bindTexture, etc) and useProgram.
|
| // If the object has already been deleted, set deleted to true upon return.
|
| // Return false if caller should return without further processing.
|
| - bool checkObjectToBeBound(const char* functionName, WebGLObject*, bool& deleted);
|
| + bool checkContextObjectToBeBound(const char* functionName, WebGLContextObject*, bool& deleted);
|
| + bool checkSharedObjectToBeBound(const char* functionName, WebGLSharedObject*, bool& deleted, bool& boundSinceLastAcquire);
|
|
|
| void dispatchContextLostEvent(Timer<WebGLRenderingContext>*);
|
| // Helper for restoration after context lost.
|
| @@ -843,15 +870,6 @@ public:
|
| // a Safari or Chrome extension.
|
| bool allowPrivilegedExtensions() const;
|
|
|
| - enum ConsoleDisplayPreference {
|
| - DisplayInConsole,
|
| - DontDisplayInConsole
|
| - };
|
| -
|
| - // Wrapper for GraphicsContext3D::synthesizeGLError that sends a message
|
| - // to the JavaScript console.
|
| - void synthesizeGLError(GC3Denum, const char* functionName, const char* description, ConsoleDisplayPreference = DisplayInConsole);
|
| -
|
| String ensureNotNull(const String&) const;
|
|
|
| // Enable or disable stencil test based on user setting and
|
|
|