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

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

Issue 2362473002: Adding unit test for DrawingBuffer's bitmap recycling mechanism (Closed)
Patch Set: fix nits Created 4 years, 3 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: 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 7024c53ab22997f1f2a9810e9e17032c97893882..0ecd0bcaad0e4888a1edf665677298341841127c 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -247,15 +247,15 @@ void DrawingBuffer::freeRecycledMailboxes()
std::unique_ptr<cc::SharedBitmap> DrawingBuffer::createOrRecycleBitmap()
{
size_t i = 0;
- while (i < m_recycledBitmap.size()) {
- if (m_recycledBitmap[i].size != m_size)
- m_recycledBitmap.remove(i); // Removed this position so iterate on it again.
+ while (i < m_recycledBitmaps.size()) {
+ if (m_recycledBitmaps[i].size != m_size)
+ m_recycledBitmaps.remove(i); // Removed this position so iterate on it again.
else
++i;
}
- if (!m_recycledBitmap.isEmpty()) {
- RecycledBitmap recycled = std::move(m_recycledBitmap.last());
- m_recycledBitmap.removeLast();
+ if (!m_recycledBitmaps.isEmpty()) {
+ RecycledBitmap recycled = std::move(m_recycledBitmaps.last());
+ m_recycledBitmaps.removeLast();
DCHECK(recycled.size == m_size);
return std::move(recycled.bitmap);
}
@@ -416,7 +416,7 @@ void DrawingBuffer::softwareMailboxReleased(std::unique_ptr<cc::SharedBitmap> bi
return; // Just delete the bitmap.
RecycledBitmap recycled = { std::move(bitmap), m_size };
- m_recycledBitmap.append(std::move(recycled));
+ m_recycledBitmaps.append(std::move(recycled));
}
PassRefPtr<StaticBitmapImage> DrawingBuffer::transferToStaticBitmapImage()

Powered by Google App Engine
This is Rietveld 408576698