|
|
Chromium Code Reviews|
Created:
4 years, 2 months ago by ccameron Modified:
4 years, 2 months ago CC:
chromium-reviews, krit, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, Justin Novosad, Rik, f(malita), blink-reviews, piman+watch_chromium.org, danakj+watch_chromium.org, ajuma+watch_chromium.org, Stephen Chennney, rwlbuis Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionDrawingBuffer clean-up: Aesthetic changes
Rename several variables to reflect that they are based on ColorBuffers.
Re-organize createColorBuffer to be in a single function with multiple
steps, rather than several functions that call each other.
Re-organize prepareTextureMailboxInternal to branch off into separate
gpu and software implementations.
This patch should have no functional effect.
BUG=648707
Committed: https://crrev.com/8b7a69f6544da9a4b1fa4c0719e814269115acbd
Cr-Commit-Position: refs/heads/master@{#424006}
Patch Set 1 #Patch Set 2 : Rebase #
Total comments: 2
Patch Set 3 : Fix alpha clearing behavior #
Total comments: 5
Depends on Patchset: Dependent Patchsets: Messages
Total messages: 24 (15 generated)
The CQ bit was checked by ccameron@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...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by ccameron@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...
ccameron@chromium.org changed reviewers: + erikchen@chromium.org, kbr@chromium.org
This rearranges code and renames variables. In the instance of ColorBuffer allocation, I replaced the inter-calling network of functions with one function which, although long, has very clear steps (and I've broken them into blocks). In the instance of populating mailboxes, I've split the function into the software and GPU flavors.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Thank you for cleaning up this code. Your reorganization is excellent and makes the code much more comprehensible. LGTM. One comment/question. https://codereview.chromium.org/2397713005/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/2397713005/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:1177: !m_wantAlphaChannel) { Should this code path also be gated on shouldUseChromiumImage()? It looks like it used to implicitly be in the old DrawingBuffer::createTextureAndAllocateMemory.
The CQ bit was checked by ccameron@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...
Thanks -- good catch! https://codereview.chromium.org/2397713005/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/2397713005/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:1177: !m_wantAlphaChannel) { On 2016/10/07 03:33:53, Ken Russell wrote: > Should this code path also be gated on shouldUseChromiumImage()? It looks like > it used to implicitly be in the old > DrawingBuffer::createTextureAndAllocateMemory. Yes, good catch. I've conditionalized this on having allocated an imageId.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2397713005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/2397713005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:319: { why the new scope? https://codereview.chromium.org/2397713005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:1116: std::vector<uint8_t> scanline(width * 4); if this gets called frequently, the new logic seems like a performance regression?
Thanks. Still LGTM. https://codereview.chromium.org/2397713005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/2397713005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:1116: std::vector<uint8_t> scanline(width * 4); On 2016/10/07 16:25:09, erikchen wrote: > if this gets called frequently, the new logic seems like a performance > regression? This is a pretty slow path anyway. I'm personally not concerned about moving the allocation here, and it'll reduce the bookkeeping involved.
Thanks! https://codereview.chromium.org/2397713005/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp (right): https://codereview.chromium.org/2397713005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:319: { On 2016/10/07 16:25:09, erikchen wrote: > why the new scope? Two reasons: - it makes it clear what the steps in the function are (without creating actual separate functions) - it makes it clear what the scope of use of the temporary variables are (needPremultiply, pixels, etc) I added lots of block like this to finishPrepareTextureMailboxGpu for the same reasons, and I think it really helps with the readability of the function. This particular function isn't very long, so it doesn't make too much of a difference. I was thinking to put the *outReleaseCallback and its "func" variable into a block as well, but that seemed excessive. https://codereview.chromium.org/2397713005/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp:1116: std::vector<uint8_t> scanline(width * 4); On 2016/10/07 18:34:41, Ken Russell wrote: > On 2016/10/07 16:25:09, erikchen wrote: > > if this gets called frequently, the new logic seems like a performance > > regression? > > This is a pretty slow path anyway. I'm personally not concerned about moving the > allocation here, and it'll reduce the bookkeeping involved. Yeah, I suspect that this was premature optimization. Reading back from GL is a very painful path (it includes an implicit GL finish, depending how you do it).
The CQ bit was checked by ccameron@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.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== DrawingBuffer clean-up: Aesthetic changes Rename several variables to reflect that they are based on ColorBuffers. Re-organize createColorBuffer to be in a single function with multiple steps, rather than several functions that call each other. Re-organize prepareTextureMailboxInternal to branch off into separate gpu and software implementations. This patch should have no functional effect. BUG=648707 ========== to ========== DrawingBuffer clean-up: Aesthetic changes Rename several variables to reflect that they are based on ColorBuffers. Re-organize createColorBuffer to be in a single function with multiple steps, rather than several functions that call each other. Re-organize prepareTextureMailboxInternal to branch off into separate gpu and software implementations. This patch should have no functional effect. BUG=648707 Committed: https://crrev.com/8b7a69f6544da9a4b1fa4c0719e814269115acbd Cr-Commit-Position: refs/heads/master@{#424006} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/8b7a69f6544da9a4b1fa4c0719e814269115acbd Cr-Commit-Position: refs/heads/master@{#424006} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
