|
|
Created:
4 years, 3 months ago by xidachen Modified:
4 years, 2 months ago CC:
ajuma+watch_chromium.org, blink-reviews, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), jbroman, pdr+graphicswatchlist_chromium.org, piman+watch_chromium.org, rwlbuis, Stephen Chennney Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionChange Deque<RecycledBitmap> to Vector in DrawingBuffer
Right now in DrawingBuffer class, we keep a Deque of RecycledBitmap to
keep a set of shared memory bitmaps that were released by compositor and
can be reused. However, there is a for loop in createOrRecycleBitmap()
that is not safe at this moment.
This CL changes the Deque structure to Vector and rewrite the for loop
to use size_t as index instead of using iterator.
BUG=647896
Committed: https://crrev.com/09b9264503a9ce8f36005d2a3136cd922ea397b4
Cr-Commit-Position: refs/heads/master@{#420088}
Patch Set 1 #
Total comments: 3
Messages
Total messages: 21 (10 generated)
xidachen@chromium.org changed reviewers: + danakj@chromium.org, kbr@chromium.org
PTAL
Description was changed from ========== Change Deque<RecycledBitmap> to Vector Right now in DrawingBuffer class, we keep a Deque of RecycledBitmap to keep a set of shared memory bitmaps that were released by compositor and can be reused. However, there is a for loop in createOrRecycleBitmap() that is not safe at this moment. This CL changes the Deque structure to Vector and rewrite the for loop to use size_t as index instead of using iterator. BUG=647896 ========== to ========== Change Deque<RecycledBitmap> to Vector in DrawingBuffer Right now in DrawingBuffer class, we keep a Deque of RecycledBitmap to keep a set of shared memory bitmaps that were released by compositor and can be reused. However, there is a for loop in createOrRecycleBitmap() that is not safe at this moment. This CL changes the Deque structure to Vector and rewrite the for loop to use size_t as index instead of using iterator. BUG=647896 ==========
LGTM though I'd like danakj@ to take a look if possible. https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/p... File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/p... third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:258: m_recycledBitmap.removeLast(); Is there any more efficient way of implementing this? Is it worth adding a takeLast() operation to wtf/Vector.h?
xidachen@chromium.org changed reviewers: + junov@chromium.org
adding junov@ who was investigating a independent bug that happens to be caused by the same problem. junov@: in the bug, danakj@ mentioned to change the Deque to Vector. WDYT?
This change is good, but you are missing a test. In fact, I was looking at DrawingBufferTest.cpp and I found that it is generally lacking unit test coverage for mailbox usage in software compositing mode. I have a good WIP CL with a test. Why don't you go ahead and land this, and I will land my test on top of it. lgtm
The CQ bit was checked by xidachen@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/p... File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/p... third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:258: m_recycledBitmap.removeLast(); On 2016/09/20 22:55:37, Ken Russell wrote: > Is there any more efficient way of implementing this? > > Is it worth adding a takeLast() operation to wtf/Vector.h? When I looked at Deque::takeLast(), it includes the same steps as here: T oldLast = std::move(last()); removeLast(); return oldLast;
The CQ bit was unchecked by xidachen@chromium.org
The CQ bit was checked by xidachen@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Change Deque<RecycledBitmap> to Vector in DrawingBuffer Right now in DrawingBuffer class, we keep a Deque of RecycledBitmap to keep a set of shared memory bitmaps that were released by compositor and can be reused. However, there is a for loop in createOrRecycleBitmap() that is not safe at this moment. This CL changes the Deque structure to Vector and rewrite the for loop to use size_t as index instead of using iterator. BUG=647896 ========== to ========== Change Deque<RecycledBitmap> to Vector in DrawingBuffer Right now in DrawingBuffer class, we keep a Deque of RecycledBitmap to keep a set of shared memory bitmaps that were released by compositor and can be reused. However, there is a for loop in createOrRecycleBitmap() that is not safe at this moment. This CL changes the Deque structure to Vector and rewrite the for loop to use size_t as index instead of using iterator. BUG=647896 ==========
Message was sent while issue was closed.
Committed patchset #1 (id:1)
Message was sent while issue was closed.
Description was changed from ========== Change Deque<RecycledBitmap> to Vector in DrawingBuffer Right now in DrawingBuffer class, we keep a Deque of RecycledBitmap to keep a set of shared memory bitmaps that were released by compositor and can be reused. However, there is a for loop in createOrRecycleBitmap() that is not safe at this moment. This CL changes the Deque structure to Vector and rewrite the for loop to use size_t as index instead of using iterator. BUG=647896 ========== to ========== Change Deque<RecycledBitmap> to Vector in DrawingBuffer Right now in DrawingBuffer class, we keep a Deque of RecycledBitmap to keep a set of shared memory bitmaps that were released by compositor and can be reused. However, there is a for loop in createOrRecycleBitmap() that is not safe at this moment. This CL changes the Deque structure to Vector and rewrite the for loop to use size_t as index instead of using iterator. BUG=647896 Committed: https://crrev.com/09b9264503a9ce8f36005d2a3136cd922ea397b4 Cr-Commit-Position: refs/heads/master@{#420088} ==========
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/09b9264503a9ce8f36005d2a3136cd922ea397b4 Cr-Commit-Position: refs/heads/master@{#420088}
Message was sent while issue was closed.
LGTM thanks for figuring out the reason for the crash
Message was sent while issue was closed.
esprehn@chromium.org changed reviewers: + esprehn@chromium.org
Message was sent while issue was closed.
https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/p... File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/p... third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:252: m_recycledBitmap.remove(i); // Removed this position so iterate on it again. This is causing a bunch of vector resizing and copying. I think you want to create a new Vector on the stack, copy into it all the values which do match m_size, and then swap() with the m_recycledBitmap member. That's the more idiomatic way to do this in blink.
Message was sent while issue was closed.
On 2016/09/28 23:41:06, esprehn wrote: > https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/p... > File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): > > https://codereview.chromium.org/2356803002/diff/1/third_party/WebKit/Source/p... > third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:252: > m_recycledBitmap.remove(i); // Removed this position so iterate on it again. > This is causing a bunch of vector resizing and copying. I think you want to > create a new Vector on the stack, copy into it all the values which do match > m_size, and then swap() with the m_recycledBitmap member. That's the more > idiomatic way to do this in blink. Thanks for pointing it out, I will take deeper look. |