use of com.facebook.samples.scrollperf.internal.ScrollPerfExecutorSupplier 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);
}
Aggregations