Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2277)

Unified Diff: content/test/data/gpu/pixel_canvas_display_linear-rgb.html

Issue 2448583002: Adding browser pixel test for linear-rgb support in Canvas. (Closed)
Patch Set: Addressing comments. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/test/gpu/gpu_tests/pixel_expectations.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/gpu/pixel_canvas_display_linear-rgb.html
diff --git a/content/test/data/gpu/pixel_canvas_display_linear-rgb.html b/content/test/data/gpu/pixel_canvas_display_linear-rgb.html
new file mode 100644
index 0000000000000000000000000000000000000000..b33ec64479fda2fbfb8ee53eb712a6f79d279389
--- /dev/null
+++ b/content/test/data/gpu/pixel_canvas_display_linear-rgb.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<canvas id="cnv" width=140 height=140></canvas>
+
+<script>
+// This layout test checks if the 2D canvas is properly displayed
+// when the color space is set to linear-rgb.
+
+var g_swapsBeforeAck = 15;
+
+function main()
+{
+ draw();
+ waitForFinish();
+}
+
+function draw()
+{
+ var ctx = document.getElementById("cnv").getContext("2d", {colorSpace:'linear-rgb'});
+ ctx.fillStyle = 'red';
+ ctx.fillRect(20,20,50,50);
+ ctx.fillStyle = 'green';
+ ctx.fillRect(70,20,50,50);
+ ctx.fillStyle = 'blue';
+ ctx.fillRect(20,70,50,50);
+ ctx.fillStyle = 'black';
+ ctx.fillRect(70,70,50,50);
+}
+
+function waitForFinish()
+{
+ if (g_swapsBeforeAck == 0) {
+ domAutomationController.setAutomationId(1);
+ domAutomationController.send("SUCCESS");
+ } else {
+ g_swapsBeforeAck--;
+ document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1;
+ window.webkitRequestAnimationFrame(waitForFinish);
+ }
+}
+
+main();
+</script>
+
+
« no previous file with comments | « no previous file | content/test/gpu/gpu_tests/pixel_expectations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698