| Index: Source/platform/graphics/gpu/DrawingBuffer.h
|
| diff --git a/Source/platform/graphics/gpu/DrawingBuffer.h b/Source/platform/graphics/gpu/DrawingBuffer.h
|
| index 9e69e0984cebf6ba4543b20a6be767e7f56e3b68..ef96ecc814e81756856e3b2b532a8890cdae94df 100644
|
| --- a/Source/platform/graphics/gpu/DrawingBuffer.h
|
| +++ b/Source/platform/graphics/gpu/DrawingBuffer.h
|
| @@ -79,10 +79,14 @@ public:
|
| Discard
|
| };
|
|
|
| - static PassRefPtr<DrawingBuffer> create(blink::WebGraphicsContext3D*, const IntSize&, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
|
| + static PassRefPtr<DrawingBuffer> create(PassOwnPtr<blink::WebGraphicsContext3D>, const IntSize&, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
|
|
|
| virtual ~DrawingBuffer();
|
|
|
| + // Clear all resources from this object, as well as context. Called when context is destroyed
|
| + // to prevent invalid accesses to the resources.
|
| + void releaseResources();
|
| +
|
| // Issues a glClear() on all framebuffers associated with this DrawingBuffer. The caller is responsible for
|
| // making the context current and setting the clear values and masks. Modifies the framebuffer binding.
|
| void clearFramebuffers(GLbitfield clearMask);
|
| @@ -138,13 +142,11 @@ public:
|
| PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(int&, int&);
|
|
|
| private:
|
| - DrawingBuffer(blink::WebGraphicsContext3D*, bool multisampleExtensionSupported,
|
| + DrawingBuffer(PassOwnPtr<blink::WebGraphicsContext3D>, bool multisampleExtensionSupported,
|
| bool packedDepthStencilExtensionSupported, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
|
|
|
| bool initialize(const IntSize&);
|
| - // Clear all resources from this object, as well as context. Called when context is destroyed
|
| - // to prevent invalid accesses to the resources.
|
| - void releaseResources();
|
| + void releaseSelf(const blink::WebExternalTextureMailbox&);
|
|
|
| unsigned createColorTexture(const IntSize& size = IntSize());
|
| // Create the depth/stencil and multisample buffers, if needed.
|
| @@ -196,7 +198,7 @@ private:
|
| Platform3DObject m_framebufferBinding;
|
| GLenum m_activeTextureUnit;
|
|
|
| - blink::WebGraphicsContext3D* m_context;
|
| + OwnPtr<blink::WebGraphicsContext3D> m_context;
|
| IntSize m_size;
|
| bool m_multisampleExtensionSupported;
|
| bool m_packedDepthStencilExtensionSupported;
|
| @@ -237,6 +239,8 @@ private:
|
| Vector<RefPtr<MailboxInfo> > m_textureMailboxes;
|
| // Mailboxes that were released by the compositor and can be used again by this DrawingBuffer.
|
| Vector<RefPtr<MailboxInfo> > m_recycledMailboxes;
|
| + // This class will be destructed after all mailboxes are received.
|
| + RefPtr<DrawingBuffer> m_selfToWaitForMailboxes;
|
|
|
| RefPtr<ContextEvictionManager> m_contextEvictionManager;
|
|
|
|
|