Commit afaad7f4 authored by Kunihiko Sakamoto's avatar Kunihiko Sakamoto Committed by Commit Bot

Reland "Ignore CanvasResourceProvider::Clear in OOPR Mode"

This reverts commit b47e683b.

Reason for revert: The revert didn't fix the issue. Relanding.

Original change's description:
> Revert "Ignore CanvasResourceProvider::Clear in OOPR Mode"
> 
> This reverts commit 84c360e5.
> 
> Reason for revert: Suspect this CL causes OOPBrowserTest.Basic failure on linux-trusty-rel
> 
> https://ci.chromium.org/p/chromium/builders/ci/linux-trusty-rel/12426
> 
> Original change's description:
> > Ignore CanvasResourceProvider::Clear in OOPR Mode
> > 
> > In OOPR Canvas2D we no longer have access to Skia in the client process.
> > We need to update CanvasResourceProvider::Clear to not access SkCanvas
> > in the case of OOPR. A more ideal fix is tracked in
> > https://crbug.com/1090081 but simply ignoring it is fine for now as
> > OOPR automatically handles clearing the canvas during initialization.
> > 
> > Bug: 1090083
> > Change-Id: I5fb75e4fac312ec00b8e5215d3756219672461ee
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2236193
> > Commit-Queue: Nathan Zabriskie <nazabris@microsoft.com>
> > Reviewed-by: Khushal <khushalsagar@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#776618}
> 
> TBR=khushalsagar@chromium.org,nazabris@microsoft.com
> 
> Change-Id: Ib906f07089a6b48eaf3e4b1f13fcfeae9d9b0896
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1090083
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2237572
> Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
> Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#776782}

TBR=ksakamoto@chromium.org,khushalsagar@chromium.org,nazabris@microsoft.com

# Not skipping CQ checks because this is a reland.

Bug: 1090083
Change-Id: Ie523abd0820a9a7d02c47bda13d778e5c6f177df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2237502Reviewed-by: default avatarKunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776839}
parent 4a17ff39
...@@ -1150,6 +1150,20 @@ bool CanvasResourceProvider::WritePixels(const SkImageInfo& orig_info, ...@@ -1150,6 +1150,20 @@ bool CanvasResourceProvider::WritePixels(const SkImageInfo& orig_info,
} }
void CanvasResourceProvider::Clear() { void CanvasResourceProvider::Clear() {
// We don't have an SkCanvas in OOPR mode so we can't do the clear below, plus
// OOPR already clears the canvas in BeginRaster.
if (IsAccelerated()) {
if (!ContextProviderWrapper())
return;
if (ContextProviderWrapper()
->ContextProvider()
->GetCapabilities()
.supports_oop_raster) {
return;
}
}
// Clear the background transparent or opaque, as required. This should only // Clear the background transparent or opaque, as required. This should only
// be called when a new resource provider is created to ensure that we're // be called when a new resource provider is created to ensure that we're
// not leaking data or displaying bad pixels (in the case of kOpaque // not leaking data or displaying bad pixels (in the case of kOpaque
......
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