feat:add switch for performance,default is off
This commit is contained in:
@@ -59,6 +59,7 @@ @interface DoricLibraries : NSObject
|
||||
@property(nonatomic, strong) NSMutableSet <DoricLibrary *> *libraries;
|
||||
@property(nonatomic, strong) NSMutableArray <NSValue *> *registries;
|
||||
@property(nonatomic, strong) NSMutableDictionary *envDic;
|
||||
@property(nonatomic, assign) BOOL enablePerformance;
|
||||
|
||||
+ (instancetype)instance;
|
||||
@end
|
||||
@@ -69,6 +70,7 @@ - (instancetype)init {
|
||||
_libraries = [NSMutableSet new];
|
||||
_registries = [NSMutableArray new];
|
||||
_envDic = [NSMutableDictionary new];
|
||||
_enablePerformance = NO;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -133,6 +135,14 @@ - (instancetype)initWithJSEngine:(DoricJSEngine *)jsEngine {
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (void)enablePerformance:(BOOL)enable {
|
||||
DoricLibraries.instance.enablePerformance = enable;
|
||||
}
|
||||
|
||||
+ (BOOL)isEnablePerformance {
|
||||
return DoricLibraries.instance.enablePerformance;
|
||||
}
|
||||
|
||||
- (void)innerRegister {
|
||||
[self registerNativePlugin:DoricShaderPlugin.class withName:@"shader"];
|
||||
[self registerNativePlugin:DoricModalPlugin.class withName:@"modal"];
|
||||
|
||||
Reference in New Issue
Block a user