Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gl-react-native-v2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
gl-react-native-v2
Commits
5594cc33
Commit
5594cc33
authored
Sep 30, 2015
by
Gaëtan Renaudeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rollback previous changes for alpha & blending
parent
62f87ad2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5 additions
and
23 deletions
+5
-23
RNGL/GLCanvas.m
RNGL/GLCanvas.m
+2
-9
RNGL/GLData.h
RNGL/GLData.h
+1
-3
RNGL/GLData.m
RNGL/GLData.m
+0
-2
RNGL/GLRenderData.h
RNGL/GLRenderData.h
+1
-3
RNGL/GLRenderData.m
RNGL/GLRenderData.m
+0
-2
RNGL/RCTConvert+GLData.m
RNGL/RCTConvert+GLData.m
+1
-4
No files found.
RNGL/GLCanvas.m
View file @
5594cc33
...
@@ -160,7 +160,6 @@ RCT_NOT_IMPLEMENTED(-init)
...
@@ -160,7 +160,6 @@ RCT_NOT_IMPLEMENTED(-init)
weak_traverseTree
=
traverseTree
=
^
GLRenderData
*
(
GLData
*
data
)
{
weak_traverseTree
=
traverseTree
=
^
GLRenderData
*
(
GLData
*
data
)
{
NSNumber
*
width
=
data
.
width
;
NSNumber
*
width
=
data
.
width
;
NSNumber
*
height
=
data
.
height
;
NSNumber
*
height
=
data
.
height
;
BOOL
premultipliedAlpha
=
data
.
premultipliedAlpha
;
int
fboId
=
[
data
.
fboId
intValue
];
int
fboId
=
[
data
.
fboId
intValue
];
NSMutableArray
*
contextChildren
=
[[
NSMutableArray
alloc
]
init
];
NSMutableArray
*
contextChildren
=
[[
NSMutableArray
alloc
]
init
];
...
@@ -255,8 +254,7 @@ RCT_NOT_IMPLEMENTED(-init)
...
@@ -255,8 +254,7 @@ RCT_NOT_IMPLEMENTED(-init)
withHeight:
height
withHeight:
height
withFboId:
fboId
withFboId:
fboId
withContextChildren:
contextChildren
withContextChildren:
contextChildren
withChildren:
children
withChildren:
children
];
withPremultipliedAlpha:
premultipliedAlpha
];
};
};
_renderData
=
traverseTree
(
_data
);
_renderData
=
traverseTree
(
_data
);
...
@@ -350,14 +348,9 @@ RCT_NOT_IMPLEMENTED(-init)
...
@@ -350,14 +348,9 @@ RCT_NOT_IMPLEMENTED(-init)
[
renderData
.
shader
setUniform
:
uniformName
withValue
:
renderData
.
uniforms
[
uniformName
]];
[
renderData
.
shader
setUniform
:
uniformName
withValue
:
renderData
.
uniforms
[
uniformName
]];
}
}
glBlendFunc
Separate
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
,
GL_ONE
,
GL_ONE_MINUS_SRC_ALPHA
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
glClearColor
(
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
);
glClearColor
(
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
);
glClear
(
GL_COLOR_BUFFER_BIT
);
glClear
(
GL_COLOR_BUFFER_BIT
);
if
(
renderData
.
premultipliedAlpha
)
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
else
glBlendFunc
(
GL_ONE
,
GL_ONE_MINUS_SRC_ALPHA
);
glDrawArrays
(
GL_TRIANGLES
,
0
,
6
);
glDrawArrays
(
GL_TRIANGLES
,
0
,
6
);
};
};
...
...
RNGL/GLData.h
View file @
5594cc33
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
@property
(
nonatomic
)
NSNumber
*
fboId
;
@property
(
nonatomic
)
NSNumber
*
fboId
;
@property
(
nonatomic
)
NSArray
*
contextChildren
;
@property
(
nonatomic
)
NSArray
*
contextChildren
;
@property
(
nonatomic
)
NSArray
*
children
;
@property
(
nonatomic
)
NSArray
*
children
;
@property
(
nonatomic
)
BOOL
premultipliedAlpha
;
-
(
instancetype
)
initWithShader
:
(
NSNumber
*
)
shader
-
(
instancetype
)
initWithShader
:
(
NSNumber
*
)
shader
withUniforms
:
(
NSDictionary
*
)
uniforms
withUniforms
:
(
NSDictionary
*
)
uniforms
...
@@ -19,7 +18,6 @@
...
@@ -19,7 +18,6 @@
withHeight
:
(
NSNumber
*
)
height
withHeight
:
(
NSNumber
*
)
height
withFboId
:
(
NSNumber
*
)
fboId
withFboId
:
(
NSNumber
*
)
fboId
withContextChildren
:
(
NSArray
*
)
contextChildren
withContextChildren
:
(
NSArray
*
)
contextChildren
withChildren
:
(
NSArray
*
)
children
withChildren
:
(
NSArray
*
)
children
;
withPremultipliedAlpha
:
(
BOOL
)
premultipliedAlpha
;
@end
@end
RNGL/GLData.m
View file @
5594cc33
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
withFboId
:
(
NSNumber
*
)
fboId
withFboId
:
(
NSNumber
*
)
fboId
withContextChildren
:
(
NSArray
*
)
contextChildren
withContextChildren
:
(
NSArray
*
)
contextChildren
withChildren
:
(
NSArray
*
)
children
withChildren
:
(
NSArray
*
)
children
withPremultipliedAlpha
:
(
BOOL
)
premultipliedAlpha
{
{
if
((
self
=
[
super
init
]))
{
if
((
self
=
[
super
init
]))
{
self
.
shader
=
shader
;
self
.
shader
=
shader
;
...
@@ -19,7 +18,6 @@
...
@@ -19,7 +18,6 @@
self
.
fboId
=
fboId
;
self
.
fboId
=
fboId
;
self
.
contextChildren
=
contextChildren
;
self
.
contextChildren
=
contextChildren
;
self
.
children
=
children
;
self
.
children
=
children
;
self
.
premultipliedAlpha
=
premultipliedAlpha
;
}
}
return
self
;
return
self
;
}
}
...
...
RNGL/GLRenderData.h
View file @
5594cc33
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
@property
(
nonatomic
)
int
fboId
;
@property
(
nonatomic
)
int
fboId
;
@property
(
nonatomic
)
NSArray
*
contextChildren
;
@property
(
nonatomic
)
NSArray
*
contextChildren
;
@property
(
nonatomic
)
NSArray
*
children
;
@property
(
nonatomic
)
NSArray
*
children
;
@property
(
nonatomic
)
BOOL
premultipliedAlpha
;
-
(
instancetype
)
initWithShader
:
(
GLShader
*
)
shader
-
(
instancetype
)
initWithShader
:
(
GLShader
*
)
shader
withUniforms
:(
NSDictionary
*
)
uniforms
withUniforms
:(
NSDictionary
*
)
uniforms
...
@@ -21,7 +20,6 @@
...
@@ -21,7 +20,6 @@
withHeight
:
(
NSNumber
*
)
height
withHeight
:
(
NSNumber
*
)
height
withFboId
:
(
int
)
fboId
withFboId
:
(
int
)
fboId
withContextChildren
:
(
NSArray
*
)
contextChildren
withContextChildren
:
(
NSArray
*
)
contextChildren
withChildren
:
(
NSArray
*
)
children
withChildren
:
(
NSArray
*
)
children
;
withPremultipliedAlpha
:
(
BOOL
)
premultipliedAlpha
;
@end
@end
RNGL/GLRenderData.m
View file @
5594cc33
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
withFboId
:
(
int
)
fboId
withFboId
:
(
int
)
fboId
withContextChildren
:
(
NSArray
*
)
contextChildren
withContextChildren
:
(
NSArray
*
)
contextChildren
withChildren
:
(
NSArray
*
)
children
withChildren
:
(
NSArray
*
)
children
withPremultipliedAlpha
:
(
BOOL
)
premultipliedAlpha
{
{
if
((
self
=
[
super
init
]))
{
if
((
self
=
[
super
init
]))
{
...
@@ -23,7 +22,6 @@
...
@@ -23,7 +22,6 @@
self
.
fboId
=
fboId
;
self
.
fboId
=
fboId
;
self
.
contextChildren
=
contextChildren
;
self
.
contextChildren
=
contextChildren
;
self
.
children
=
children
;
self
.
children
=
children
;
self
.
premultipliedAlpha
=
premultipliedAlpha
;
}
}
return
self
;
return
self
;
}
}
...
...
RNGL/RCTConvert+GLData.m
View file @
5594cc33
...
@@ -25,8 +25,6 @@
...
@@ -25,8 +25,6 @@
GLData
*
child
=
[
self
GLData
:
childJSON
];
GLData
*
child
=
[
self
GLData
:
childJSON
];
[
contextChildren
addObject
:
child
];
[
contextChildren
addObject
:
child
];
}
}
BOOL
premultipliedAlpha
=
[
self
BOOL
:
json
[
@"premultipliedAlpha"
]];
return
[[
GLData
alloc
]
initWithShader
:
shader
return
[[
GLData
alloc
]
initWithShader
:
shader
withUniforms:
uniforms
withUniforms:
uniforms
...
@@ -34,8 +32,7 @@
...
@@ -34,8 +32,7 @@
withHeight:
height
withHeight:
height
withFboId:
fboId
withFboId:
fboId
withContextChildren:
contextChildren
withContextChildren:
contextChildren
withChildren:
children
withChildren:
children
];
withPremultipliedAlpha:
premultipliedAlpha
];
}
}
@end
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment