-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ImageBitmapRenderingContext interaction with software compositor.
Before this CL, there was an early exit condition that prevented texture-backed resources from being presented to the software compositor even when the texture backing is swiftshader. This meant that in some cases, ImageBitmaps that were created by webGL contexts would fail to render. Once the early exit removed, there were other bugs due to the fact that bitmaps were not being converted to N32 format before being dispatched to the software compositor. This could cause several types of rendering artifacts, including leaking bitmap data between contexts. BUG=1283434 Change-Id: I6f353bc6301b79d7a4124445c85956125135f539 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3387268 Reviewed-by: Juanmi Huertas <juanmihd@chromium.org> Commit-Queue: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/main@{#959192}
- Loading branch information
Showing
3 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
third_party/blink/web_tests/fast/canvas/bug1283434-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
<!doctype html> | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<p>The two squares below should be filled in blue.</p> | ||
<canvas id="c" width="100" height="100" style="background-color: #00f;"></canvas> | ||
<canvas id="c2" width="100" height="100" style="background-color: #00f;"></canvas> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
<!doctype html> | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<p>The two squares below should be filled in blue.</p> | ||
<canvas id="c" width="100" height="100" style="background-color: red;"></canvas> | ||
<canvas id="c2" width="100" height="100" style="background-color: red;"></canvas> | ||
<script> | ||
const canvas = document.getElementById('c'); | ||
const canvas2 = document.getElementById('c2'); | ||
const renderer = canvas.getContext('bitmaprenderer'); | ||
const renderer2 = canvas2.getContext('2d'); | ||
|
||
const temp_canvas = new OffscreenCanvas(640, 480); | ||
const gl = temp_canvas.getContext('webgl'); | ||
|
||
gl.clearColor(0.0, 0.0, 1.0, 1.0); | ||
gl.clear(gl.COLOR_BUFFER_BIT); | ||
|
||
const bitmap = temp_canvas.transferToImageBitmap(); | ||
|
||
renderer2.drawImage(bitmap, 0, 0); | ||
renderer.transferFromImageBitmap(bitmap); | ||
</script> | ||
</body> | ||
</html> |