diff --git a/CHANGELOG.md b/CHANGELOG.md index 60ef0d3579..d0d67f8b4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.0.0-alpha09] - July 23, 2024 + +- **BREAKING**: Rename the `io.coil-kt.coil3:coil-network-ktor` artifact to `io.coil-kt.coil3:coil-network-ktor2` which depends on Ktor 2.x. Additionally, introduce `io.coil-kt.coil3:coil-network-ktor3` which depends on Ktor 3.x. `wasmJs` support is only available in Ktor 3.x. +- **New**: Add `AsyncImagePainter.restart()` to manually restart an image request. +- Remove `@ExperimentalCoilApi` from `NetworkClient` and related classes. +- Optimize `ImageRequest` to avoid unnecessary `Extras` and `Map` allocations. + ## [2.7.0] - July 17, 2024 - Slightly optimize internal coroutines usage to improve the performance of `ImageLoader.execute`, `AsyncImage`, `SubcomposeAsyncImage`, and `rememberAsyncImagePainter`. ([#2205](https://github.com/coil-kt/coil/pull/2205)) diff --git a/coil-compose-core/src/androidMain/baseline-prof.txt b/coil-compose-core/src/androidMain/baseline-prof.txt index 220f04ca8d..344c5d8236 100644 --- a/coil-compose-core/src/androidMain/baseline-prof.txt +++ b/coil-compose-core/src/androidMain/baseline-prof.txt @@ -24,7 +24,7 @@ HSPLcoil3/compose/AsyncImagePainter;->access$updateRequest(Lcoil3/compose/AsyncI HSPLcoil3/compose/AsyncImagePainter;->access$updateState(Lcoil3/compose/AsyncImagePainter;Lcoil3/compose/AsyncImagePainter$State;)V HSPLcoil3/compose/AsyncImagePainter;->getAlpha()F HPLcoil3/compose/AsyncImagePainter;->getColorFilter()Landroidx/compose/ui/graphics/ColorFilter; -HSPLcoil3/compose/AsyncImagePainter;->getIntrinsicSize-NH-jbRc()J +HPLcoil3/compose/AsyncImagePainter;->getIntrinsicSize-NH-jbRc()J HPLcoil3/compose/AsyncImagePainter;->getPainter()Landroidx/compose/ui/graphics/painter/Painter; HSPLcoil3/compose/AsyncImagePainter;->getScope$coil_compose_core_release()Lkotlinx/coroutines/CoroutineScope; HSPLcoil3/compose/AsyncImagePainter;->get_input$coil_compose_core_release()Lkotlinx/coroutines/flow/MutableStateFlow; @@ -36,7 +36,7 @@ HSPLcoil3/compose/AsyncImagePainter;->setFilterQuality-vDHp3xo$coil_compose_core HSPLcoil3/compose/AsyncImagePainter;->setOnState$coil_compose_core_release(Lkotlin/jvm/functions/Function1;)V HSPLcoil3/compose/AsyncImagePainter;->setPainter(Landroidx/compose/ui/graphics/painter/Painter;)V HSPLcoil3/compose/AsyncImagePainter;->setPreviewHandler$coil_compose_core_release(Lcoil3/compose/AsyncImagePreviewHandler;)V -HPLcoil3/compose/AsyncImagePainter;->setRememberJob(Lkotlinx/coroutines/Job;)V +HSPLcoil3/compose/AsyncImagePainter;->setRememberJob(Lkotlinx/coroutines/Job;)V HSPLcoil3/compose/AsyncImagePainter;->setScope$coil_compose_core_release(Lkotlinx/coroutines/CoroutineScope;)V HSPLcoil3/compose/AsyncImagePainter;->setTransform$coil_compose_core_release(Lkotlin/jvm/functions/Function1;)V HPLcoil3/compose/AsyncImagePainter;->toState(Lcoil3/request/ImageResult;)Lcoil3/compose/AsyncImagePainter$State; @@ -72,9 +72,9 @@ HSPLcoil3/compose/AsyncImagePainter$State$Success;->(Landroidx/compose/ui/ HSPLcoil3/compose/AsyncImagePainter$State$Success;->getPainter()Landroidx/compose/ui/graphics/painter/Painter; HSPLcoil3/compose/AsyncImagePainter$State$Success;->getResult()Lcoil3/request/SuccessResult; Lcoil3/compose/AsyncImagePainter$onRemembered$1$2; -HSPLcoil3/compose/AsyncImagePainter$onRemembered$1$2;->(Lcoil3/compose/AsyncImagePainter;Lkotlin/coroutines/Continuation;)V +HSPLcoil3/compose/AsyncImagePainter$onRemembered$1$2;->(Lkotlinx/coroutines/flow/Flow;Lcoil3/compose/AsyncImagePainter;Lkotlin/coroutines/Continuation;)V HSPLcoil3/compose/AsyncImagePainter$onRemembered$1$2;->access$invokeSuspend$updateState(Lcoil3/compose/AsyncImagePainter;Lcoil3/compose/AsyncImagePainter$State;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; -HSPLcoil3/compose/AsyncImagePainter$onRemembered$1$2;->create(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation; +HPLcoil3/compose/AsyncImagePainter$onRemembered$1$2;->create(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation; HSPLcoil3/compose/AsyncImagePainter$onRemembered$1$2;->invokeSuspend$updateState(Lcoil3/compose/AsyncImagePainter;Lcoil3/compose/AsyncImagePainter$State;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; HPLcoil3/compose/AsyncImagePainter$onRemembered$1$2;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; Lcoil3/compose/AsyncImagePainter$onRemembered$1$2$1; @@ -87,6 +87,11 @@ Lcoil3/compose/AsyncImagePainter$onRemembered$1$2$2; HSPLcoil3/compose/AsyncImagePainter$onRemembered$1$2$2;->(Lcoil3/compose/AsyncImagePainter;)V HSPLcoil3/compose/AsyncImagePainter$onRemembered$1$2$2;->emit(Lcoil3/compose/AsyncImagePainter$State;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; HSPLcoil3/compose/AsyncImagePainter$onRemembered$1$2$2;->emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +Lcoil3/compose/AsyncImagePainter$onRemembered$lambda$3$$inlined$flatMapLatest$1; +HSPLcoil3/compose/AsyncImagePainter$onRemembered$lambda$3$$inlined$flatMapLatest$1;->(Lkotlin/coroutines/Continuation;Lcoil3/compose/AsyncImagePainter;)V +HSPLcoil3/compose/AsyncImagePainter$onRemembered$lambda$3$$inlined$flatMapLatest$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +HPLcoil3/compose/AsyncImagePainter$onRemembered$lambda$3$$inlined$flatMapLatest$1;->invoke(Lkotlinx/coroutines/flow/FlowCollector;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +HPLcoil3/compose/AsyncImagePainter$onRemembered$lambda$3$$inlined$flatMapLatest$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; Lcoil3/compose/AsyncImagePainter$updateRequest$$inlined$target$default$1; HSPLcoil3/compose/AsyncImagePainter$updateRequest$$inlined$target$default$1;->(Lcoil3/request/ImageRequest;Lcoil3/compose/AsyncImagePainter;)V HPLcoil3/compose/AsyncImagePainter$updateRequest$$inlined$target$default$1;->onStart(Lcoil3/Image;)V diff --git a/coil-core/src/androidMain/baseline-prof.txt b/coil-core/src/androidMain/baseline-prof.txt index 0ea1326114..a42c94a491 100644 --- a/coil-core/src/androidMain/baseline-prof.txt +++ b/coil-core/src/androidMain/baseline-prof.txt @@ -92,8 +92,8 @@ HPLcoil3/Extras;->get(Lcoil3/Extras$Key;)Ljava/lang/Object; HSPLcoil3/Extras;->newBuilder()Lcoil3/Extras$Builder; HPLcoil3/Extras;->toString()Ljava/lang/String; Lcoil3/Extras$Builder; -HPLcoil3/Extras$Builder;->()V -HSPLcoil3/Extras$Builder;->(Lcoil3/Extras;)V +HSPLcoil3/Extras$Builder;->()V +HPLcoil3/Extras$Builder;->(Lcoil3/Extras;)V HSPLcoil3/Extras$Builder;->(Ljava/util/Map;)V HPLcoil3/Extras$Builder;->build()Lcoil3/Extras; HSPLcoil3/Extras$Builder;->set(Lcoil3/Extras$Key;Ljava/lang/Object;)Lcoil3/Extras$Builder; @@ -112,7 +112,6 @@ Lcoil3/ExtrasKt; HPLcoil3/ExtrasKt;->getExtra(Lcoil3/request/ImageRequest;Lcoil3/Extras$Key;)Ljava/lang/Object; HSPLcoil3/ExtrasKt;->getExtra(Lcoil3/request/Options;Lcoil3/Extras$Key;)Ljava/lang/Object; HSPLcoil3/ExtrasKt;->getOrDefault(Lcoil3/Extras;Lcoil3/Extras$Key;)Ljava/lang/Object; -HSPLcoil3/ExtrasKt;->orEmpty(Lcoil3/Extras;)Lcoil3/Extras; Lcoil3/Image; Lcoil3/ImageLoader; Lcoil3/ImageLoader$Builder; @@ -572,10 +571,10 @@ Lcoil3/request/ImageRequest; HPLcoil3/request/ImageRequest;->(Landroid/content/Context;Ljava/lang/Object;Lcoil3/target/Target;Lcoil3/request/ImageRequest$Listener;Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;Lokio/FileSystem;Lkotlin/Pair;Lcoil3/decode/Decoder$Factory;Lkotlin/coroutines/CoroutineContext;Lkotlin/coroutines/CoroutineContext;Lkotlin/coroutines/CoroutineContext;Lcoil3/request/CachePolicy;Lcoil3/request/CachePolicy;Lcoil3/request/CachePolicy;Lcoil3/memory/MemoryCache$Key;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lcoil3/size/SizeResolver;Lcoil3/size/Scale;Lcoil3/size/Precision;Lcoil3/Extras;Lcoil3/request/ImageRequest$Defined;Lcoil3/request/ImageRequest$Defaults;)V HSPLcoil3/request/ImageRequest;->(Landroid/content/Context;Ljava/lang/Object;Lcoil3/target/Target;Lcoil3/request/ImageRequest$Listener;Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;Lokio/FileSystem;Lkotlin/Pair;Lcoil3/decode/Decoder$Factory;Lkotlin/coroutines/CoroutineContext;Lkotlin/coroutines/CoroutineContext;Lkotlin/coroutines/CoroutineContext;Lcoil3/request/CachePolicy;Lcoil3/request/CachePolicy;Lcoil3/request/CachePolicy;Lcoil3/memory/MemoryCache$Key;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lcoil3/size/SizeResolver;Lcoil3/size/Scale;Lcoil3/size/Precision;Lcoil3/Extras;Lcoil3/request/ImageRequest$Defined;Lcoil3/request/ImageRequest$Defaults;Lkotlin/jvm/internal/DefaultConstructorMarker;)V HSPLcoil3/request/ImageRequest;->getContext()Landroid/content/Context; -HSPLcoil3/request/ImageRequest;->getData()Ljava/lang/Object; +HPLcoil3/request/ImageRequest;->getData()Ljava/lang/Object; HSPLcoil3/request/ImageRequest;->getDecoderCoroutineContext()Lkotlin/coroutines/CoroutineContext; HSPLcoil3/request/ImageRequest;->getDecoderFactory()Lcoil3/decode/Decoder$Factory; -HPLcoil3/request/ImageRequest;->getDefaults()Lcoil3/request/ImageRequest$Defaults; +HSPLcoil3/request/ImageRequest;->getDefaults()Lcoil3/request/ImageRequest$Defaults; HPLcoil3/request/ImageRequest;->getDefined()Lcoil3/request/ImageRequest$Defined; HSPLcoil3/request/ImageRequest;->getDiskCacheKey()Ljava/lang/String; HSPLcoil3/request/ImageRequest;->getDiskCachePolicy()Lcoil3/request/CachePolicy; @@ -593,8 +592,8 @@ HSPLcoil3/request/ImageRequest;->getPlaceholderMemoryCacheKey()Lcoil3/memory/Mem PLcoil3/request/ImageRequest;->getPrecision()Lcoil3/size/Precision; HSPLcoil3/request/ImageRequest;->getScale()Lcoil3/size/Scale; HSPLcoil3/request/ImageRequest;->getSizeResolver()Lcoil3/size/SizeResolver; -HPLcoil3/request/ImageRequest;->getTarget()Lcoil3/target/Target; -HSPLcoil3/request/ImageRequest;->newBuilder$default(Lcoil3/request/ImageRequest;Landroid/content/Context;ILjava/lang/Object;)Lcoil3/request/ImageRequest$Builder; +HSPLcoil3/request/ImageRequest;->getTarget()Lcoil3/target/Target; +HPLcoil3/request/ImageRequest;->newBuilder$default(Lcoil3/request/ImageRequest;Landroid/content/Context;ILjava/lang/Object;)Lcoil3/request/ImageRequest$Builder; HPLcoil3/request/ImageRequest;->newBuilder(Landroid/content/Context;)Lcoil3/request/ImageRequest$Builder; HPLcoil3/request/ImageRequest;->placeholder()Lcoil3/Image; Lcoil3/request/ImageRequest$Builder; @@ -651,7 +650,7 @@ HSPLcoil3/request/ImageRequestsKt;->crossfade(Lcoil3/ImageLoader$Builder;I)Lcoil HPLcoil3/request/ImageRequestsKt;->getAllowHardware(Lcoil3/request/ImageRequest;)Z HPLcoil3/request/ImageRequestsKt;->getAllowRgb565(Lcoil3/request/ImageRequest;)Z HSPLcoil3/request/ImageRequestsKt;->getAllowRgb565(Lcoil3/request/Options;)Z -HSPLcoil3/request/ImageRequestsKt;->getBitmapConfig(Lcoil3/request/ImageRequest;)Landroid/graphics/Bitmap$Config; +HPLcoil3/request/ImageRequestsKt;->getBitmapConfig(Lcoil3/request/ImageRequest;)Landroid/graphics/Bitmap$Config; HSPLcoil3/request/ImageRequestsKt;->getBitmapConfig(Lcoil3/request/Options;)Landroid/graphics/Bitmap$Config; HSPLcoil3/request/ImageRequestsKt;->getColorSpace(Lcoil3/request/Options;)Landroid/graphics/ColorSpace; HPLcoil3/request/ImageRequestsKt;->getLifecycle(Lcoil3/request/ImageRequest;)Landroidx/lifecycle/Lifecycle; @@ -779,7 +778,7 @@ HSPLcoil3/util/AndroidSystemCallbacks$Companion;->(Lkotlin/jvm/internal/De Lcoil3/util/BitmapsKt; HSPLcoil3/util/BitmapsKt;->getAllocationByteCountCompat(Landroid/graphics/Bitmap;)I PLcoil3/util/BitmapsKt;->getSafeConfig(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap$Config; -HSPLcoil3/util/BitmapsKt;->isHardware(Landroid/graphics/Bitmap$Config;)Z +HPLcoil3/util/BitmapsKt;->isHardware(Landroid/graphics/Bitmap$Config;)Z Lcoil3/util/CollectionsKt; HSPLcoil3/util/CollectionsKt;->LruMutableMap$default(IFILjava/lang/Object;)Ljava/util/Map; HSPLcoil3/util/CollectionsKt;->LruMutableMap(IF)Ljava/util/Map; diff --git a/gradle.properties b/gradle.properties index f917397a5e..f8a3f59c7a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -31,7 +31,7 @@ SONATYPE_HOST=DEFAULT RELEASE_SIGNING_ENABLED=true POM_GROUP_ID=io.coil-kt.coil3 -POM_VERSION=3.0.0-SNAPSHOT +POM_VERSION=3.0.0-alpha09 POM_DESCRIPTION=An image loading library for Android and Compose Multiplatform. POM_INCEPTION_YEAR=2019