Commit 6dd5306c authored by Robert Phillips's avatar Robert Phillips Committed by Commit Bot

Remove additional FlushSkia in CanvasResourceProvider::WritePixels

This effectively reverts:

https://chromium-review.googlesource.com/c/chromium/src/+/1561611 (Explicitly flush after an SkCanvas::writePixels)

Together with the following Skia-side CL, this patch fixes Chrome's flushing behavior for platforms that prefer flushes over VRAM use (i.e., ANGLE) and for platforms that don't (e.g., Android).

https://skia-review.googlesource.com/c/skia/+/210062 (Change flushing policy in GrContextPriv::writeSurfacePixels)

Here are the perf numbers on Android and Windows for the putImageData performance test:

                              Android (Nexus 5x)   Windows (i.e., ANGLE)
Current Chrome                        112.9             512.1
Chrome w/ this CL                     131.9             334.8
Chrome w/ this CL and 210062          133.6             589.4

So, after both CLs have landed, Android will be faster while Windows will, roughly, remain the same.

Bug: 942538, 953720
Change-Id: I5db9f9fbc158e2132b1c532c40b60277a87d5e83
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1582181Reviewed-by: default avatarFlorin Malita <fmalita@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Cr-Commit-Position: refs/heads/master@{#653657}
parent d5049133
...@@ -1083,13 +1083,8 @@ bool CanvasResourceProvider::WritePixels(const SkImageInfo& orig_info, ...@@ -1083,13 +1083,8 @@ bool CanvasResourceProvider::WritePixels(const SkImageInfo& orig_info,
TRACE_EVENT0("blink", "CanvasResourceProvider::WritePixels"); TRACE_EVENT0("blink", "CanvasResourceProvider::WritePixels");
DCHECK(IsValid()); DCHECK(IsValid());
if (GetSkSurface()->getCanvas()->writePixels(orig_info, pixels, row_bytes, x, return GetSkSurface()->getCanvas()->writePixels(orig_info, pixels, row_bytes,
y)) { x, y);
FlushSkia();
return true;
}
return false;
} }
void CanvasResourceProvider::Clear() { void CanvasResourceProvider::Clear() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment