Commit 5594cc33 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

Rollback previous changes for alpha & blending

parent 62f87ad2
......@@ -160,7 +160,6 @@ RCT_NOT_IMPLEMENTED(-init)
weak_traverseTree = traverseTree = ^GLRenderData *(GLData *data) {
NSNumber *width = data.width;
NSNumber *height = data.height;
BOOL premultipliedAlpha = data.premultipliedAlpha;
int fboId = [data.fboId intValue];
NSMutableArray *contextChildren = [[NSMutableArray alloc] init];
......@@ -255,8 +254,7 @@ RCT_NOT_IMPLEMENTED(-init)
withHeight:height
withFboId:fboId
withContextChildren:contextChildren
withChildren:children
withPremultipliedAlpha:premultipliedAlpha];
withChildren:children];
};
_renderData = traverseTree(_data);
......@@ -350,14 +348,9 @@ RCT_NOT_IMPLEMENTED(-init)
[renderData.shader setUniform:uniformName withValue:renderData.uniforms[uniformName]];
}
glBlendFuncSeparate(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);
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);
};
......
......@@ -11,7 +11,6 @@
@property (nonatomic) NSNumber *fboId;
@property (nonatomic) NSArray *contextChildren;
@property (nonatomic) NSArray *children;
@property (nonatomic) BOOL premultipliedAlpha;
-(instancetype)initWithShader: (NSNumber *)shader
withUniforms: (NSDictionary *)uniforms
......@@ -19,7 +18,6 @@
withHeight: (NSNumber *)height
withFboId: (NSNumber *)fboId
withContextChildren: (NSArray *)contextChildren
withChildren: (NSArray *)children
withPremultipliedAlpha: (BOOL)premultipliedAlpha;
withChildren: (NSArray *)children;
@end
......@@ -9,7 +9,6 @@
withFboId: (NSNumber *)fboId
withContextChildren: (NSArray *)contextChildren
withChildren: (NSArray *)children
withPremultipliedAlpha: (BOOL)premultipliedAlpha
{
if ((self = [super init])) {
self.shader = shader;
......@@ -19,7 +18,6 @@
self.fboId = fboId;
self.contextChildren = contextChildren;
self.children = children;
self.premultipliedAlpha = premultipliedAlpha;
}
return self;
}
......
......@@ -12,7 +12,6 @@
@property (nonatomic) int fboId;
@property (nonatomic) NSArray *contextChildren;
@property (nonatomic) NSArray *children;
@property (nonatomic) BOOL premultipliedAlpha;
-(instancetype) initWithShader: (GLShader *)shader
withUniforms:(NSDictionary *)uniforms
......@@ -21,7 +20,6 @@
withHeight: (NSNumber *)height
withFboId: (int)fboId
withContextChildren: (NSArray *)contextChildren
withChildren: (NSArray *)children
withPremultipliedAlpha: (BOOL)premultipliedAlpha;
withChildren: (NSArray *)children;
@end
......@@ -11,7 +11,6 @@
withFboId: (int)fboId
withContextChildren: (NSArray *)contextChildren
withChildren: (NSArray *)children
withPremultipliedAlpha: (BOOL)premultipliedAlpha
{
if ((self = [super init])) {
......@@ -23,7 +22,6 @@
self.fboId = fboId;
self.contextChildren = contextChildren;
self.children = children;
self.premultipliedAlpha = premultipliedAlpha;
}
return self;
}
......
......@@ -26,16 +26,13 @@
[contextChildren addObject:child];
}
BOOL premultipliedAlpha = [self BOOL:json[@"premultipliedAlpha"]];
return [[GLData alloc] initWithShader: shader
withUniforms: uniforms
withWidth: width
withHeight: height
withFboId: fboId
withContextChildren: contextChildren
withChildren: children
withPremultipliedAlpha: premultipliedAlpha];
withChildren: children];
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment