diff --git a/Examples/Tests/Copy.js b/Examples/Tests/Copy.js
new file mode 100644
index 0000000000000000000000000000000000000000..3214b84d0c7c53bf4eea2189849b6cc0cd62575f
--- /dev/null
+++ b/Examples/Tests/Copy.js
@@ -0,0 +1,32 @@
+const React = require("react-native");
+const GL = require("gl-react-native");
+
+const shaders = GL.Shaders.create({
+ Copy: {
+ frag: `
+precision highp float;
+
+varying vec2 uv;
+uniform sampler2D t;
+
+void main () {
+ gl_FragColor = texture2D(t, uv);
+}
+`
+ }
+});
+
+class Copy extends GL.Component {
+ render () {
+ const { width, height, children: t, ...rest } = this.props;
+ return ;
+ }
+}
+
+module.exports = Copy;
diff --git a/Examples/Tests/Layer.js b/Examples/Tests/Layer.js
index ff2d490fdf1be2ac0a3a4e699d6f22c57a1157b0..ddf77b3ce65228f39dd8d01327e5b4f01c5e4257 100644
--- a/Examples/Tests/Layer.js
+++ b/Examples/Tests/Layer.js
@@ -21,10 +21,11 @@ void main () {
class Layer extends GL.Component {
render () {
- const { width, height, children } = this.props;
+ const { width, height, children, ...rest } = this.props;
if (!children || children.length !== 2) throw new Error("You must provide 2 children to Layer");
const [t1, t2] = children;
return
+ {React.Children.map(children, child =>
+
+ {child}
+
+ )}
+ ;
+ }
+}
+
+module.exports = NativeLayer;
diff --git a/Examples/Tests/index.ios.js b/Examples/Tests/index.ios.js
index fa78cea0128e346b980aa3103228f625f41391f2..4cce0868d6dfca2eb8ffb50f46de357ca4470ff8 100644
--- a/Examples/Tests/index.ios.js
+++ b/Examples/Tests/index.ios.js
@@ -3,14 +3,18 @@ const {
AppRegistry,
Text,
View,
+ ScrollView,
+ Image,
} = React;
const Blur = require("./Blur");
const Add = require("./Add");
const Multiply = require("./Multiply");
const Layer = require("./Layer");
+const NativeLayer = require("./NativeLayer");
const HelloGL = require("./HelloGL");
const Display2 = require("./Display2");
+const Copy = require("./Copy");
const { width: viewportW, height: viewportH } = require("Dimensions").get("window");
class Tests extends React.Component {
@@ -27,6 +31,9 @@ class Tests extends React.Component {
console.log("PROGRESS", progress, loaded, total);
}
render () {
+
+ const debugSize = viewportW / 2;
+
const helloGL =
;
@@ -59,26 +66,61 @@ class Tests extends React.Component {
{txt}
;
- return
-
-
-
- {txt}
- {helloGL}
-
-
-
-
- {blurredImageOverText}
- {helloGL}
-
-
- {blurredImage}
-
+ return
+
+
+ {txt}
+ {helloGL}
+
+
+
+
+ {blurredImageOverText}
+ {helloGL}
+
+
+ {blurredImage}
- {txt}
- ;
+
+
+
+
+
+
+
+
+
+
+
+ http://i.imgur.com/S22HNaU.png
+
+
+
+
+
+
+
+ http://i.imgur.com/mp79p5T.png
+
+
+
+
+
+ http://i.imgur.com/S22HNaU.png
+
+
+ http://i.imgur.com/mp79p5T.png
+
+
+
+
+ {"http://i.imgur.com/S22HNaU.png"}
+ {"http://i.imgur.com/mp79p5T.png"}
+
+
+
+ ;
}
}