| 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++) {
|
|
|