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

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: rebase to ToT 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 b8a51abb68908f13cc491b4e8e54be221b18badb..60e973a3fc0806404ae2372d0a4134de57f8ee02 100644
--- a/Source/platform/graphics/gpu/DrawingBuffer.h
+++ b/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -129,6 +129,7 @@ public:
void markContentsChanged();
void markLayerComposited();
bool layerComposited() const;
+ void setIsHidden(bool);
blink::WebLayer* platformLayer();
void paintCompositedResultsToCanvas(ImageBuffer*);
@@ -158,7 +159,7 @@ protected: // For unittests
bool initialize(const IntSize&);
private:
- void mailboxReleasedWhileDestructionInProgress(const blink::WebExternalTextureMailbox&);
+ void mailboxReleasedWithoutRecycling(const blink::WebExternalTextureMailbox&);
unsigned createColorTexture(const IntSize& size = IntSize());
// Create the depth/stencil and multisample buffers, if needed.
@@ -175,6 +176,7 @@ private:
PassRefPtr<MailboxInfo> recycledMailbox();
PassRefPtr<MailboxInfo> createNewMailbox(unsigned);
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);
@@ -255,6 +257,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