From b3fd2bc1b68b988202e50fac757a318274c16be8 Mon Sep 17 00:00:00 2001 From: Sam Judd Date: Tue, 26 Sep 2023 09:33:53 -0700 Subject: [PATCH 1/5] Bump version to 5 RC01, 1.0 beta01 --- gradle.properties | 2 +- integration/compose/gradle.properties | 2 +- integration/ktx/gradle.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 3444b14b82..36eae2c62e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,4 +36,4 @@ TEST_JVM_MEMORY_SIZE=4096M VERSION_MAJOR=5 VERSION_MINOR=0 VERSION_PATCH=0 -VERSION_NAME=5.0.0-SNAPSHOT \ No newline at end of file +VERSION_NAME=5.0.0-rc01 \ No newline at end of file diff --git a/integration/compose/gradle.properties b/integration/compose/gradle.properties index 01c4b2bc2c..b7dc0b93e3 100644 --- a/integration/compose/gradle.properties +++ b/integration/compose/gradle.properties @@ -6,4 +6,4 @@ POM_DESCRIPTION=An integration library to integrate with Jetpack Compose VERSION_MAJOR=1 VERSION_MINOR=0 VERSION_PATCH=0 -VERSION_NAME=1.0.0-beta1-SNAPSHOT +VERSION_NAME=1.0.0-beta01 diff --git a/integration/ktx/gradle.properties b/integration/ktx/gradle.properties index d486de19cb..57f30aca92 100644 --- a/integration/ktx/gradle.properties +++ b/integration/ktx/gradle.properties @@ -6,4 +6,4 @@ POM_DESCRIPTION=An integration library to improve Kotlin interop with Glide VERSION_MAJOR=1 VERSION_MINOR=0 VERSION_PATCH=0 -VERSION_NAME=1.0.0-beta1-SNAPSHOT +VERSION_NAME=1.0.0-beta01 From f0d2b16034826757e4c68e5320b7707a8d43a289 Mon Sep 17 00:00:00 2001 From: Sam Judd Date: Fri, 29 Sep 2023 20:42:04 -0700 Subject: [PATCH 2/5] Set versions to next snapshot --- gradle.properties | 2 +- integration/compose/gradle.properties | 2 +- integration/ktx/gradle.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 36eae2c62e..83230c26d4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,4 +36,4 @@ TEST_JVM_MEMORY_SIZE=4096M VERSION_MAJOR=5 VERSION_MINOR=0 VERSION_PATCH=0 -VERSION_NAME=5.0.0-rc01 \ No newline at end of file +VERSION_NAME=5.0.0-SNAPSHOT diff --git a/integration/compose/gradle.properties b/integration/compose/gradle.properties index b7dc0b93e3..a114f9e4ce 100644 --- a/integration/compose/gradle.properties +++ b/integration/compose/gradle.properties @@ -6,4 +6,4 @@ POM_DESCRIPTION=An integration library to integrate with Jetpack Compose VERSION_MAJOR=1 VERSION_MINOR=0 VERSION_PATCH=0 -VERSION_NAME=1.0.0-beta01 +VERSION_NAME=1.0.0-beta02-SNAPSHOT diff --git a/integration/ktx/gradle.properties b/integration/ktx/gradle.properties index 57f30aca92..a0ed6fd785 100644 --- a/integration/ktx/gradle.properties +++ b/integration/ktx/gradle.properties @@ -6,4 +6,4 @@ POM_DESCRIPTION=An integration library to improve Kotlin interop with Glide VERSION_MAJOR=1 VERSION_MINOR=0 VERSION_PATCH=0 -VERSION_NAME=1.0.0-beta01 +VERSION_NAME=1.0.0-beta02-SNAPSHOT From 1863e6713a34507f584c4d1f2a061dd885b687ee Mon Sep 17 00:00:00 2001 From: Sam Judd Date: Fri, 29 Sep 2023 21:12:02 -0700 Subject: [PATCH 3/5] Only log duplicate library modules if there actually are duplicates --- .../com/bumptech/glide/annotation/ksp/GlideSymbolProcessor.kt | 4 +--- .../com/bumptech/glide/annotation/ksp/LibraryGlideModules.kt | 2 +- .../glide/annotation/ksp/test/LibraryGlideModuleTests.kt | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/annotation/ksp/src/main/kotlin/com/bumptech/glide/annotation/ksp/GlideSymbolProcessor.kt b/annotation/ksp/src/main/kotlin/com/bumptech/glide/annotation/ksp/GlideSymbolProcessor.kt index 0dbf5dc220..d8954bbbd8 100644 --- a/annotation/ksp/src/main/kotlin/com/bumptech/glide/annotation/ksp/GlideSymbolProcessor.kt +++ b/annotation/ksp/src/main/kotlin/com/bumptech/glide/annotation/ksp/GlideSymbolProcessor.kt @@ -21,11 +21,9 @@ import com.squareup.kotlinpoet.FileSpec * `AppGlideModule` is found, we then generate Glide's configuration so that it calls the * `AppGlideModule` and any included `LibraryGlideModules`. Using indexes allows us to process * `LibraryGlideModules` in multiple rounds and/or libraries. - * - * TODO(b/239086146): Finish implementing the behavior described here. */ class GlideSymbolProcessor(private val environment: SymbolProcessorEnvironment) : SymbolProcessor { - var isAppGlideModuleGenerated = false + private var isAppGlideModuleGenerated = false override fun process(resolver: Resolver): List { val symbols = resolver.getSymbolsWithAnnotation("com.bumptech.glide.annotation.GlideModule") diff --git a/annotation/ksp/src/main/kotlin/com/bumptech/glide/annotation/ksp/LibraryGlideModules.kt b/annotation/ksp/src/main/kotlin/com/bumptech/glide/annotation/ksp/LibraryGlideModules.kt index fdd3445e97..17894f7a7f 100644 --- a/annotation/ksp/src/main/kotlin/com/bumptech/glide/annotation/ksp/LibraryGlideModules.kt +++ b/annotation/ksp/src/main/kotlin/com/bumptech/glide/annotation/ksp/LibraryGlideModules.kt @@ -37,7 +37,7 @@ internal class LibraryGlideModulesParser( } .toList() val uniqueLibraryGlideModules = allLibraryGlideModules.associateBy { it.name }.values.toList() - if (uniqueLibraryGlideModules != libraryGlideModules) { + if (uniqueLibraryGlideModules.size != libraryGlideModules.size) { // Find the set of modules that have been included more than once by mapping the qualified // name of the module to a count of the number of times it's been seen. Duplicates are then // any keys that have a value > 1. diff --git a/annotation/ksp/test/src/test/kotlin/com/bumptech/glide/annotation/ksp/test/LibraryGlideModuleTests.kt b/annotation/ksp/test/src/test/kotlin/com/bumptech/glide/annotation/ksp/test/LibraryGlideModuleTests.kt index 200f6b7e84..a261b07bc0 100644 --- a/annotation/ksp/test/src/test/kotlin/com/bumptech/glide/annotation/ksp/test/LibraryGlideModuleTests.kt +++ b/annotation/ksp/test/src/test/kotlin/com/bumptech/glide/annotation/ksp/test/LibraryGlideModuleTests.kt @@ -44,6 +44,7 @@ class LibraryGlideModuleTests(override val sourceType: SourceType) : PerSourceTy ) compileCurrentSourceType(kotlinModule, javaModule) { + assertThat(it.messages).doesNotContainMatch("[we]: \\[ksp] .*") assertThat(it.exitCode).isEqualTo(ExitCode.OK) assertFailsWith { it.generatedAppGlideModuleContents() } } @@ -100,6 +101,7 @@ class LibraryGlideModuleTests(override val sourceType: SourceType) : PerSourceTy javaAppModule, javaLibraryModule ) { + assertThat(it.messages).doesNotContainMatch("[we]: \\[ksp] .*") assertThat(it.exitCode).isEqualTo(ExitCode.OK) assertThat(it.generatedAppGlideModuleContents()) .hasSourceEqualTo(appGlideModuleWithLibraryModule) From b1c6076bbbc3cc46d45f35924070cb11be44ff90 Mon Sep 17 00:00:00 2001 From: Sam Judd Date: Sun, 1 Oct 2023 19:19:00 -0700 Subject: [PATCH 4/5] Avoid drawing placeholder when it shouldn't be used --- .../glide/integration/compose/GlideModifier.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/integration/compose/src/main/java/com/bumptech/glide/integration/compose/GlideModifier.kt b/integration/compose/src/main/java/com/bumptech/glide/integration/compose/GlideModifier.kt index a193f844b8..1d43a7496d 100644 --- a/integration/compose/src/main/java/com/bumptech/glide/integration/compose/GlideModifier.kt +++ b/integration/compose/src/main/java/com/bumptech/glide/integration/compose/GlideModifier.kt @@ -332,10 +332,15 @@ internal class GlideNode : DrawModifierNode, LayoutModifierNode, SemanticsModifi override fun ContentDrawScope.draw() { if (draw) { val drawPlaceholder = transition.drawPlaceholder ?: DoNotTransition.drawPlaceholder - placeholder?.let { painter -> - drawContext.canvas.withSave { - placeholderPositionAndSize = drawOne(painter, placeholderPositionAndSize) { size -> - drawPlaceholder.invoke(this, painter, size, alpha, colorFilter) + // If we're only showing the placeholder, it should just be drawn as the primary image. + // If we've loaded a full image and we have a placeholder, then we should try to draw both so + // that the transition can decide what to do. + if (placeholder != primary && transition != DoNotTransition) { + placeholder?.let { painter -> + drawContext.canvas.withSave { + placeholderPositionAndSize = drawOne(painter, placeholderPositionAndSize) { size -> + drawPlaceholder.invoke(this, painter, size, alpha, colorFilter) + } } } } From 75599b7af05eeca1393c8f4267adb78e88e7821e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp?= Date: Tue, 10 Oct 2023 21:24:33 +0100 Subject: [PATCH 5/5] Fix BitmapPoolAdapter outdated JavaDoc --- .../glide/load/engine/bitmap_recycle/BitmapPoolAdapter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/BitmapPoolAdapter.java b/library/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/BitmapPoolAdapter.java index b0dfc41edc..cedbba2728 100644 --- a/library/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/BitmapPoolAdapter.java +++ b/library/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/BitmapPoolAdapter.java @@ -5,8 +5,8 @@ /** * An {@link com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool BitmapPool} implementation - * that rejects all {@link android.graphics.Bitmap Bitmap}s added to it and always returns {@code - * null} from get. + * that rejects all {@link android.graphics.Bitmap Bitmap}s added to it and always returns a new + * {@link android.graphics.Bitmap Bitmap} from {@link #get}. */ public class BitmapPoolAdapter implements BitmapPool { @Override