From 5594cc33653f68e6cd8c894315b09960b36b1550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Wed, 30 Sep 2015 13:40:22 +0200 Subject: [PATCH] Rollback previous changes for alpha & blending --- RNGL/GLCanvas.m | 11 ++--------- RNGL/GLData.h | 4 +--- RNGL/GLData.m | 2 -- RNGL/GLRenderData.h | 4 +--- RNGL/GLRenderData.m | 2 -- RNGL/RCTConvert+GLData.m | 5 +---- 6 files changed, 5 insertions(+), 23 deletions(-) diff --git a/RNGL/GLCanvas.m b/RNGL/GLCanvas.m index 874ea41..e5e19de 100644 --- a/RNGL/GLCanvas.m +++ b/RNGL/GLCanvas.m @@ -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); }; diff --git a/RNGL/GLData.h b/RNGL/GLData.h index 376528e..610261f 100644 --- a/RNGL/GLData.h +++ b/RNGL/GLData.h @@ -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 diff --git a/RNGL/GLData.m b/RNGL/GLData.m index c1db168..2466854 100644 --- a/RNGL/GLData.m +++ b/RNGL/GLData.m @@ -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; } diff --git a/RNGL/GLRenderData.h b/RNGL/GLRenderData.h index 80cab9c..44ecf9d 100644 --- a/RNGL/GLRenderData.h +++ b/RNGL/GLRenderData.h @@ -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 diff --git a/RNGL/GLRenderData.m b/RNGL/GLRenderData.m index 2d66984..f4b6721 100644 --- a/RNGL/GLRenderData.m +++ b/RNGL/GLRenderData.m @@ -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; } diff --git a/RNGL/RCTConvert+GLData.m b/RNGL/RCTConvert+GLData.m index 8299655..e65f49c 100644 --- a/RNGL/RCTConvert+GLData.m +++ b/RNGL/RCTConvert+GLData.m @@ -25,8 +25,6 @@ GLData *child = [self GLData:childJSON]; [contextChildren addObject:child]; } - - BOOL premultipliedAlpha = [self BOOL:json[@"premultipliedAlpha"]]; return [[GLData alloc] initWithShader: shader withUniforms: uniforms @@ -34,8 +32,7 @@ withHeight: height withFboId: fboId withContextChildren: contextChildren - withChildren: children - withPremultipliedAlpha: premultipliedAlpha]; + withChildren: children]; } @end -- 2.26.2