Commit 84c360e5 authored by Nathan Zabriskie's avatar Nathan Zabriskie Committed by Commit Bot

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: default avatarKhushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776618}
parent 61ed3705
...@@ -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