Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(936)

Unified Diff: Source/platform/graphics/gpu/DrawingBuffer.h

Issue 169933002: WebGL: Don't destroy mailbox textures in the destructor until they're released. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698