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

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

Issue 2089293002: WebGL: Be less aggressive about pruning image backed mailboxes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index 601e4dac652fdb6d119a741ecf98daa508a7917a..f79d52d2fcf4ae33fd0b4228ece2f87d9e80d4cc 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -391,13 +391,18 @@ PassRefPtr<DrawingBuffer::MailboxInfo> DrawingBuffer::recycledMailbox()
if (m_recycledMailboxQueue.isEmpty())
return PassRefPtr<MailboxInfo>();
+ // Creation of image backed mailboxes is very expensive, so be less
+ // aggressive about pruning them.
+ size_t cacheLimit = 1;
+ if (RuntimeEnabledFeatures::webGLImageChromiumEnabled())
+ cacheLimit = 4;
+
WebExternalTextureMailbox mailbox;
- while (!m_recycledMailboxQueue.isEmpty()) {
+ while (m_recycledMailboxQueue.size() > cacheLimit) {
mailbox = m_recycledMailboxQueue.takeLast();
- // Never have more than one mailbox in the released state.
- if (!m_recycledMailboxQueue.isEmpty())
- deleteMailbox(mailbox);
+ deleteMailbox(mailbox);
}
+ mailbox = m_recycledMailboxQueue.takeLast();
RefPtr<MailboxInfo> mailboxInfo;
for (size_t i = 0; i < m_textureMailboxes.size(); i++) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698