Glide createGlide() {
        if (sourceService == null) {
            final int cores = Math.max(1, Runtime.getRuntime().availableProcessors());
            sourceService = new FifoPriorityThreadPoolExecutor(cores);
        }
        if (diskCacheService == null) {
            diskCacheService = new FifoPriorityThreadPoolExecutor(1);
        }

        MemorySizeCalculator calculator = new MemorySizeCalculator(context);
        if (bitmapPool == null) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                int size = calculator.getBitmapPoolSize();
                bitmapPool = new LruBitmapPool(size);
            } else {
                bitmapPool = new BitmapPoolAdapter();
            }
        }

        if (memoryCache == null) {
            memoryCache = new LruResourceCache(calculator.getMemoryCacheSize());
        }

        if (diskCacheFactory == null) {
            if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
                diskCacheFactory = new ExternalCacheDiskCacheFactory(context);
            } else {
                diskCacheFactory = new InternalCacheDiskCacheFactory(context);
            }
        }

        if (engine == null) {
            engine = new Engine(memoryCache, diskCacheFactory, diskCacheService, sourceService);
        }

        if (decodeFormat == null) {
            decodeFormat = DecodeFormat.DEFAULT;
        }

        return new Glide(engine, memoryCache, bitmapPool, context, decodeFormat, diskCacheFactory);
    }
Sets the {@link DecodeFormat} that will be the default format for all the default
decoders that can change the {@link android.graphics.Bitmap.Config} of the {@link android.graphics.Bitmap}s they
decode.

<p>
    Decode format is always a suggestion, not a requirement. See {@link DecodeFormat} for
    more details.
</p>

<p>
    If you instantiate and use a custom decoder, it will use
    {@link DecodeFormat#DEFAULT} as its default.
</p>

<p>
    Calls to this method are ignored on KitKat and Lollipop. See #301.
</p>

@param decodeFormat The format to use.
@return This builder.
core/src/main/java/com/bumptech/glide/GlideBuilder.java