| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 } | 426 } |
| 427 | 427 |
| 428 // Creation of image backed mailboxes is very expensive, so be less | 428 // Creation of image backed mailboxes is very expensive, so be less |
| 429 // aggressive about pruning them. Pruning is done in FIFO order. | 429 // aggressive about pruning them. Pruning is done in FIFO order. |
| 430 size_t cacheLimit = 1; | 430 size_t cacheLimit = 1; |
| 431 if (shouldUseChromiumImage()) | 431 if (shouldUseChromiumImage()) |
| 432 cacheLimit = 4; | 432 cacheLimit = 4; |
| 433 while (m_recycledColorBufferQueue.size() >= cacheLimit) | 433 while (m_recycledColorBufferQueue.size() >= cacheLimit) |
| 434 m_recycledColorBufferQueue.takeLast(); | 434 m_recycledColorBufferQueue.takeLast(); |
| 435 | 435 |
| 436 m_recycledColorBufferQueue.prepend(colorBuffer); | 436 m_recycledColorBufferQueue.push_front(colorBuffer); |
| 437 } | 437 } |
| 438 | 438 |
| 439 void DrawingBuffer::mailboxReleasedSoftware( | 439 void DrawingBuffer::mailboxReleasedSoftware( |
| 440 std::unique_ptr<cc::SharedBitmap> bitmap, | 440 std::unique_ptr<cc::SharedBitmap> bitmap, |
| 441 const IntSize& size, | 441 const IntSize& size, |
| 442 const gpu::SyncToken& syncToken, | 442 const gpu::SyncToken& syncToken, |
| 443 bool lostResource) { | 443 bool lostResource) { |
| 444 DCHECK(!syncToken.HasData()); // No sync tokens for software resources. | 444 DCHECK(!syncToken.HasData()); // No sync tokens for software resources. |
| 445 if (m_destructionInProgress || lostResource || m_isHidden || size != m_size) | 445 if (m_destructionInProgress || lostResource || m_isHidden || size != m_size) |
| 446 return; // Just delete the bitmap. | 446 return; // Just delete the bitmap. |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1292 if (m_pixelUnpackBufferBindingDirty) | 1292 if (m_pixelUnpackBufferBindingDirty) |
| 1293 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); | 1293 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); |
| 1294 } | 1294 } |
| 1295 | 1295 |
| 1296 bool DrawingBuffer::shouldUseChromiumImage() { | 1296 bool DrawingBuffer::shouldUseChromiumImage() { |
| 1297 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && | 1297 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && |
| 1298 m_chromiumImageUsage == AllowChromiumImage; | 1298 m_chromiumImageUsage == AllowChromiumImage; |
| 1299 } | 1299 } |
| 1300 | 1300 |
| 1301 } // namespace blink | 1301 } // namespace blink |
| OLD | NEW |