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

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

Issue 251023004: WebGL: Free temporary GPU resources held by inactive or hidden WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use ASSERT instead of 'if' in prepareMailbox() Created 6 years, 5 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 4c457b7c7b747dc97b8763a629758a6bbe6de54f..545918e95e4265cdca195252de0871abb62f12ba 100644
--- a/Source/platform/graphics/gpu/DrawingBuffer.h
+++ b/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -142,6 +142,7 @@ public:
void markContentsChanged();
void markLayerComposited();
bool layerComposited() const;
+ void setIsHidden(bool);
blink::WebLayer* platformLayer();
void paintCompositedResultsToCanvas(ImageBuffer*);
@@ -178,7 +179,7 @@ protected: // For unittests
bool initialize(const IntSize&);
private:
- void mailboxReleasedWhileDestructionInProgress(const blink::WebExternalTextureMailbox&);
+ void mailboxReleasedWithoutRecycling(const blink::WebExternalTextureMailbox&);
unsigned createColorTexture();
// Create the depth/stencil and multisample buffers, if needed.
@@ -195,6 +196,7 @@ private:
PassRefPtr<MailboxInfo> recycledMailbox();
PassRefPtr<MailboxInfo> createNewMailbox(const TextureInfo&);
void deleteMailbox(const blink::WebExternalTextureMailbox&);
+ void freeRecycledMailboxes();
// Updates the current size of the buffer, ensuring that s_currentResourceUsePixels is updated.
void setSize(const IntSize& size);
@@ -279,6 +281,7 @@ private:
int m_sampleCount;
int m_packAlignment;
bool m_destructionInProgress;
+ bool m_isHidden;
OwnPtr<blink::WebExternalTextureLayer> m_layer;

Powered by Google App Engine
This is Rietveld 408576698