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

Issue 2637553002: Stop unnecessary flushing in Canvas2DLayerBridge (Closed)

Created:
3 years, 11 months ago by Justin Novosad
Modified:
3 years, 11 months ago
Reviewers:
xlai (Olivia)
CC:
chromium-reviews, krit, drott+blinkwatch_chromium.org, ajuma+watch-canvas_chromium.org, Stephen Chennney, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, blink-reviews-platform-graphics_chromium.org, Rik, f(malita), blink-reviews, kinuko+watch, ajuma+watch_chromium.org, danakj+watch_chromium.org, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Stop unnecessary flushing in Canvas2DLayerBridge Experiments with chrome://tracing revealed non-negligible CPU overhead from calling SkCanvas::flush() and gl->Flush() unnecessarily when nothing has been drawn to the canvas since the previous flush. This change adds a simple early exit. Performance gain will be visible through existing telemetry benchmarks. BUG=681200 Review-Url: https://codereview.chromium.org/2637553002 Cr-Commit-Position: refs/heads/master@{#443917} Committed: https://chromium.googlesource.com/chromium/src/+/11dadab7208d79cf95542cd9ac8c285844141a6a

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -3 lines) Patch
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp View 2 chunks +10 lines, -3 lines 1 comment Download

Messages

Total messages: 14 (8 generated)
Justin Novosad
PTAL
3 years, 11 months ago (2017-01-13 23:46:07 UTC) #4
xlai (Olivia)
lgtm
3 years, 11 months ago (2017-01-16 15:57:28 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2637553002/1
3 years, 11 months ago (2017-01-16 16:30:58 UTC) #9
xlai (Olivia)
https://codereview.chromium.org/2637553002/diff/1/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp File third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp (right): https://codereview.chromium.org/2637553002/diff/1/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp#newcode788 third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp:788: if (!m_didDrawSinceLastFlush) I have a second thought about this ...
3 years, 11 months ago (2017-01-16 16:58:19 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/11dadab7208d79cf95542cd9ac8c285844141a6a
3 years, 11 months ago (2017-01-16 17:47:50 UTC) #13
Justin Novosad
3 years, 11 months ago (2017-01-16 18:25:01 UTC) #14
Message was sent while issue was closed.
On 2017/01/16 16:58:19, xlai (Olivia) wrote:
>
https://codereview.chromium.org/2637553002/diff/1/third_party/WebKit/Source/p...
> File third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
> (right):
> 
>
https://codereview.chromium.org/2637553002/diff/1/third_party/WebKit/Source/p...
> third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp:788: if
> (!m_didDrawSinceLastFlush)
> I have a second thought about this CL: how about we add a small unit test to
it
> to verifies it works and prevent future code change from modifying the
behavior?
> There is an extra code branch introduced here and a unit test seems to be
> necessary in this case.

If we loose this behavior, performance tests will fire alerts.
But it is still a valid point. I will follow-up...

Powered by Google App Engine
This is Rietveld 408576698