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

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
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;
Justin Novosad 2016/10/24 21:22:27 What is the justification for this number? Seems l
xidachen 2016/10/25 00:58:35 +kbr@ for this. When I added the "pixel_offscreenC
Ken Russell (switch to Gerrit) 2016/10/25 01:03:29 I recall it was added a while ago in order to addr
+
+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') | content/test/gpu/gpu_tests/pixel_test_pages.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698