Repository navigation
Releases
v1.0.1
Performance
- Adaptive downsampling: with
BlurQuality.BALANCED(the default) andLOW, large radii are now blurred at a lower resolution, keeping the blur radius in the buffer at 8 px or less (5 px forLOW). The result looks the same, because a blur that strong has no fine detail, but every per-frame cost scales with the buffer: capture, upload, GPU blur and the GLES readback.HIGHandULTRAkeepdownsampleexactly. On the Android 10 emulator (GLES path), aBlurViewupdate went from 3.5 ms to 1.8–2.0 ms. - Unchanged content is not blurred again: the capture is double-buffered and compared with the previous one. When the window redraws for something unrelated (a spinner, a cursor, the surface's own children), the blur, texture upload and readback are skipped. That frame costs 0.04 ms instead of 2.7 ms. New:
ViewCapture.lastCaptureChanged. - Trace sections:
BlurEngine:update,:capture,:blurand:recordshow up in Perfetto and the Android Studio profiler. They cost nothing when tracing is off.
Fixed
BlurSurfaceRenderer.skippedCapturewas alsotruewhile a backend was still warming up. It now means only what it says: capture was skipped because the blur was a no-op.- Device tests on CI emulators (software GL):
- tests now wait until the blur is drawn by its final renderer instead of a fixed delay;
- they pin the animation scale to 1 while they run;
- they take screenshots only once the screen has stopped changing.
Changed
- Build: publishing plugin
com.vanniktech.maven.publish0.29.0 → 0.34.0. Central Portal deployments are now namedio.github.mrsluffy-<version>instead of a random ID. The publishing properties use the plugin's current names:mavenCentralPublishing,mavenCentralAutomaticPublishingandsignAllPublications. The published artifacts are unchanged. - Releases: only the repository owner can start the publish workflow.
Install
implementation("io.github.mrsluffy:blur-view:1.0.1") // Android Views
implementation("io.github.mrsluffy:blur-compose:1.0.1") // Jetpack Composeblur-showcase-v1.0.1.apk is the demo app (a debug build; Android 10+).
v1.0.0
The first stable release. The public API is now frozen under semantic versioning.
Added
- Liquid glass:
GlassStyle(BlurView.glass, Composeglass()). On every API level it adds a rim highlight, gloss and edge shading. On API 33+ it also refracts and disperses color at the rim, using an AGSLRuntimeShaderchained after the blur, so it costs no main-thread time. - Progressive blur:
BlurGradient(BlurView.gradient, Composegradient), with presetsTopToBottom,BottomToTop,LeftToRightandRightToLeft. - Multi-layer blur: blur surfaces drawn earlier now appear in the blur of the ones drawn after them, so stacked glass panels show each other.
ViewCapture.capturegained anownerparameter for this. blur-showcase: a Compose app that demonstrates the three effects and theBlurViewanimation API. Itsautoplaymode makes recordings repeatable.scripts/record-demo.ps1: records the README screenshots and GIFs fromblur-showcaseon an emulator or device.- License: released under the Apache License 2.0. Every Kotlin, Gradle and XML source file carries the license header.
./gradlew spotlessApplyadds it to new files, andspotlessCheck(run in CI) fails if one is missing. - Publishing: Maven Central publishing for the 8 library modules under
io.github.mrsluffy, each with a sources jar, a Dokka javadoc jar and signed artifacts. - API docs: generated with Dokka (
./gradlew dokkaHtmlMultiModule). - API check: public API snapshots (
api/*.api), checked by./gradlew check. - CI: GitHub Actions runs lint, unit tests, the API check and device tests on API 29 and 34. Pushing a
v*tag runs the publish workflow. - Timing switch for device tests: the instrumentation argument
timingAssertions=falseturns off frame-rate checks for emulators without GPU acceleration. CI sets it. Correctness checks always run.
Fixed
-
GLES threading: the GLES backend now runs every GL call on one thread that it owns.
BlurViewcreates the backend on a background thread and renders on the main thread, and moving the EGL context between those threads was unreliable. On the Android emulator, a test reproduced three faults:- the first render on the second thread failed with GL_INVALID_VALUE;
- the GL objects broke once the creating thread exited;
- the main thread paid about 300 ms of one-time GL setup on its first frame, which dropped frames at the start of a GLES animation.
initialize,renderandreleasestill block until their work is done, and the hand-off allocates nothing per frame.GlesThreadingTestcovers all three faults. -
API 29 lint error:
RenderEffectBackendFactory, which must be safe to load on API 29 and 30, referenced the API 31 backend class. It now owns theIDconstant itself and uses an explicitSDK_INTbranch.
Changed
RenderEffectBlurBackend.IDis now defined asRenderEffectBackendFactory.ID. The value,"render-effect", is unchanged.
Install
implementation("io.github.mrsluffy:blur-view:1.0.0") // Android Views
implementation("io.github.mrsluffy:blur-compose:1.0.0") // Jetpack Composeblur-showcase-v1.0.0.apk is the demo app (a debug build; Android 10+).