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

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: Fix crash Created 6 years, 8 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 b74f4cf2fbb0ebd5241016bf5986b8ea396a1b68..66c397021d0fc43fd4f700c0e5b29a53b9ff7456 100644
--- a/Source/platform/graphics/gpu/DrawingBuffer.h
+++ b/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -72,6 +72,7 @@ class PLATFORM_EXPORT DrawingBuffer : public RefCounted<DrawingBuffer>, public b
blink::WebExternalTextureMailbox mailbox;
unsigned textureId;
IntSize size;
+ RefPtr<DrawingBuffer> m_parentDrawingBuffer;
Ken Russell (switch to Gerrit) 2014/04/15 02:24:02 Please document the semantics. "This keeps the pa
};
public:
enum PreserveDrawingBuffer {
@@ -83,6 +84,9 @@ public:
virtual ~DrawingBuffer();
+ // Destruction will be completed after all mailboxes are received.
Ken Russell (switch to Gerrit) 2014/04/15 02:24:02 received -> released
+ void beginDestruction();
+
// 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,12 +142,14 @@ public:
void paintRenderingResultsToCanvas(ImageBuffer*);
PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(int&, int&);
-private:
+protected: // For unittests
DrawingBuffer(PassOwnPtr<blink::WebGraphicsContext3D>, bool multisampleExtensionSupported,
bool packedDepthStencilExtensionSupported, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
bool initialize(const IntSize&);
- void releaseResources();
+
+private:
+ void mailboxReleasedInDestructionInProgress(const blink::WebExternalTextureMailbox&);
Ken Russell (switch to Gerrit) 2014/04/15 02:24:02 Please rename this to "mailboxReleasedWhileDestruc
unsigned createColorTexture(const IntSize& size = IntSize());
// Create the depth/stencil and multisample buffers, if needed.
@@ -237,6 +243,7 @@ private:
int m_maxTextureSize;
int m_sampleCount;
int m_packAlignment;
+ bool m_destructionInProgress;
OwnPtr<blink::WebExternalTextureLayer> m_layer;

Powered by Google App Engine
This is Rietveld 408576698