New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 681200 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

canvas to canvas drawImage performs flush of the source canvas each time

Project Member Reported by junov@chromium.org, Jan 13 2017

Issue description

When an accelerated 2D canvas is used as a source image in a drawImage call, we call Canvas2DLayerBridge::flush(), which consume about 50 microseconds of CPU each time when there are no actual draw calls to be flushed. We should do an early exit based on whether didDraw was called since the previous flush.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/11dadab7208d79cf95542cd9ac8c285844141a6a

commit 11dadab7208d79cf95542cd9ac8c285844141a6a
Author: junov <junov@chromium.org>
Date: Mon Jan 16 17:47:17 2017

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}

[modify] https://crrev.com/11dadab7208d79cf95542cd9ac8c285844141a6a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
[modify] https://crrev.com/11dadab7208d79cf95542cd9ac8c285844141a6a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h

Comment 2 by junov@chromium.org, Jan 16 2017

Status: Fixed (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a4eab9aa9b5cbeb5e9dde2ce1eb0ecd6313c8f6c

commit a4eab9aa9b5cbeb5e9dde2ce1eb0ecd6313c8f6c
Author: junov <junov@chromium.org>
Date: Mon Jan 16 22:28:52 2017

Adding test to verify that Canvas2DLayerBridge flushes only when required

This is a follow-up to CL:
https://codereview.chromium.org/2637553002/
It adds a unit test to validate the functionality of the new
optimization that prevents redundant flushing.

BUG= 681200 

Review-Url: https://codereview.chromium.org/2636973002
Cr-Commit-Position: refs/heads/master@{#443955}

[modify] https://crrev.com/a4eab9aa9b5cbeb5e9dde2ce1eb0ecd6313c8f6c/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
[modify] https://crrev.com/a4eab9aa9b5cbeb5e9dde2ce1eb0ecd6313c8f6c/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp

Sign in to add a comment