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

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

Issue 385663002: Revert of WebGL: Free temporary GPU resources held by inactive or hidden WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/platform/graphics/gpu/DrawingBuffer.h ('k') | Source/platform/graphics/gpu/DrawingBufferTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/gpu/DrawingBuffer.cpp
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.cpp b/Source/platform/graphics/gpu/DrawingBuffer.cpp
index 3e70a4319fdb995d717a73289dea85a188cd3286..bcf1a10ae65da690d43f1828cf206946252c421a 100644
--- a/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -148,7 +148,6 @@
, m_sampleCount(0)
, m_packAlignment(4)
, m_destructionInProgress(false)
- , m_isHidden(false)
, m_contextEvictionManager(contextEvictionManager)
{
// Used by browser tests to detect the use of a DrawingBuffer.
@@ -186,26 +185,6 @@
m_layerComposited = true;
}
-
-void DrawingBuffer::setIsHidden(bool hidden)
-{
- ASSERT(!m_destructionInProgress);
- if (m_isHidden == hidden)
- return;
- m_isHidden = hidden;
- if (m_isHidden)
- freeRecycledMailboxes();
-}
-
-void DrawingBuffer::freeRecycledMailboxes()
-{
- if (m_recycledMailboxQueue.isEmpty())
- return;
- m_context->makeContextCurrent();
- while (!m_recycledMailboxQueue.isEmpty())
- deleteMailbox(m_recycledMailboxQueue.takeLast());
-}
-
blink::WebGraphicsContext3D* DrawingBuffer::context()
{
return m_context.get();
@@ -213,7 +192,6 @@
bool DrawingBuffer::prepareMailbox(blink::WebExternalTextureMailbox* outMailbox, blink::WebExternalBitmap* bitmap)
{
- ASSERT(!m_isHidden);
if (!m_contentsChanged)
return false;
@@ -300,8 +278,8 @@
void DrawingBuffer::mailboxReleased(const blink::WebExternalTextureMailbox& mailbox)
{
- if (m_destructionInProgress || m_isHidden) {
- mailboxReleasedWithoutRecycling(mailbox);
+ if (m_destructionInProgress) {
+ mailboxReleasedWhileDestructionInProgress(mailbox);
return;
}
@@ -318,7 +296,7 @@
ASSERT_NOT_REACHED();
}
-void DrawingBuffer::mailboxReleasedWithoutRecycling(const blink::WebExternalTextureMailbox& mailbox)
+void DrawingBuffer::mailboxReleasedWhileDestructionInProgress(const blink::WebExternalTextureMailbox& mailbox)
{
ASSERT(m_textureMailboxes.size());
m_context->makeContextCurrent();
« no previous file with comments | « Source/platform/graphics/gpu/DrawingBuffer.h ('k') | Source/platform/graphics/gpu/DrawingBufferTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698