use of com.facebook.imagepipeline.core.DefaultExecutorSupplier in project fresco by facebook.
the class ScrollPerfApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
final Config config = Config.load(this);
ImagePipelineConfig.Builder imagePipelineConfigBuilder = ImagePipelineConfig.newBuilder(this).setResizeAndRotateEnabledForNetwork(false).setDownsampleEnabled(config.downsampling);
if (WebpSupportStatus.sIsWebpSupportRequired) {
imagePipelineConfigBuilder.experiment().setWebpSupportEnabled(config.webpSupportEnabled);
}
if (config.decodingThreadCount == 0) {
imagePipelineConfigBuilder.setExecutorSupplier(new DefaultExecutorSupplier(Const.NUMBER_OF_PROCESSORS));
} else {
imagePipelineConfigBuilder.setExecutorSupplier(new ScrollPerfExecutorSupplier(Const.NUMBER_OF_PROCESSORS, config.decodingThreadCount));
}
imagePipelineConfigBuilder.experiment().setDecodeCancellationEnabled(config.decodeCancellation);
DraweeConfig draweeConfig = DraweeConfig.newBuilder().setDrawDebugOverlay(config.draweeOverlayEnabled).build();
Fresco.initialize(this, imagePipelineConfigBuilder.build(), draweeConfig);
}
use of com.facebook.imagepipeline.core.DefaultExecutorSupplier in project gl-react-native by ProjectSeptemberInc.
the class GLCanvasManager method createViewInstance.
@Override
public GLCanvas createViewInstance(ThemedReactContext context) {
if (executorSupplier == null) {
PoolFactory poolFactory = new PoolFactory(PoolConfig.newBuilder().build());
int numCpuBoundThreads = poolFactory.getFlexByteArrayPoolMaxNumThreads();
executorSupplier = new DefaultExecutorSupplier(numCpuBoundThreads);
}
return new GLCanvas(context, executorSupplier);
}
Aggregations