Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 <!--
2 Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6 <!DOCTYPE html>
7 <html>
8 <head>
9 <meta charset="utf-8">
10 <title>GLSL sin function test</title>
11 <link rel="stylesheet" href="../../../resources/js-test-style.css"/>
12 <link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/>
13 <script src="../../../resources/js-test-pre.js"></script>
14 <script src="../../resources/webgl-test.js"> </script>
15 <script src="../../resources/webgl-test-utils.js"> </script>
16 <script src="../../resources/glsl-generator.js"> </script>
17 </head>
18 <body>
19 <div id="description"></div>
20 <div id="console"></div>
21 <script>
23 var piConstants = [
24 "const float kPI = 3.14159265358979323846;",
25 "const float kHalfPI = (kPI * 0.5);",
26 "const float k2PI = (kPI * 2.0);"
27 ].join("\n");
29 var kPI = Math.PI;
30 var kHalfPI = Math.PI * 0.5;
31 var k2PI = Math.PI * 2.0;
32 var sin = Math.sin; // shorthand
34 GLSLGenerator.runReferenceImageTest({
35 feature: "sin",
36 args: "$(type) value",
37 testFunc: "$(func)($(type))",
38 gridRes: 8,
39 tolerance: 4,
40 extra: piConstants,
41 tests: [
42 {
43 source: ["$(output) = vec4(",
44 " $(func)($(input).x * kHalfPI + kHalfPI),",
45 " $(func)($(input).y * kHalfPI),",
46 " 0,",
47 " 1);"].join("\n"),
48 generator: function(x, y, z, w) {
49 return [ sin(x * kHalfPI + kHalfPI),
50 sin(y * kHalfPI),
51 0,
52 1 ];
53 },
54 },
55 {
56 source: ["$(output) = vec4(",
57 " $(func)($(input).xy * vec2(kPI, k2PI)) * 0.5 + vec2(0.5, 0.5),",
58 " 0, 1);"].join("\n"),
59 generator: function(x, y, z, w) {
60 return [ sin(x * kPI) * 0.5 + 0.5,
61 sin(y * k2PI) * 0.5 + 0.5,
62 0,
63 1 ];
64 },
65 },
66 {
67 source: ["$(output) = vec4(",
68 " $(func)($(input).xyz * vec3(kPI, k2PI, 4.0)) * ",
69 " 0.5 + vec3(0.5, 0.5, 0.5),",
70 " 1);"].join("\n"),
71 generator: function(x, y, z, w) {
72 return [ sin(x * kPI) * 0.5 + 0.5,
73 sin(y * k2PI) * 0.5 + 0.5,
74 sin(z * 4.0) * 0.5 + 0.5,
75 1 ];
76 },
77 },
78 {
79 source: ["$(output) = ",
80 " $(func)($(input) * vec4(k2PI, 4.0, kHalfPI, kPI)) *",
81 " 0.5 + vec4(0.5, 0.5, 0.5, 1);",
82 ].join("\n"),
83 generator: function(x, y, z, w) {
84 return [ sin(x * k2PI) * 0.5 + 0.5,
85 sin(y * 4.0) * 0.5 + 0.5,
86 sin(z * kHalfPI) * 0.5 + 0.5,
87 sin(w * kPI) * 0.5 + 1 ];
88 },
89 },
90 ]
91 });
92 successfullyParsed = true;
93 </script>
94 </body>
95 </html>