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) ...@@ -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]];
} }
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); 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);
}; };
......
...@@ -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
...@@ -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;
} }
......
...@@ -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
...@@ -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;
} }
......
...@@ -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
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