graphics
This table lists all the artifacts in the androidx.graphics group.
| Artifact | Stable Release | Release Candidate | Beta Release | Alpha Release |
|---|---|---|---|---|
| graphics-core | 1.0.3 | - | - | - |
| graphics-path | 1.0.1 | - | - | 1.1.0-alpha01 |
| graphics-shapes | 1.1.0 | - | - | - |
Declaring dependencies
To add a dependency on Graphics, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.
Add the dependencies for the artifacts you need in the build.gradle file for
your app or module:
Groovy
dependencies { implementation "androidx.graphics:graphics-core:1.0.3" implementation "androidx.graphics:graphics-path:1.1.0-alpha01" implementation "androidx.graphics:graphics-shapes:1.1.0" }
Kotlin
dependencies { implementation("androidx.graphics:graphics-core:1.0.3") implementation("androidx.graphics:graphics-path:1.1.0-alpha01") implementation("androidx.graphics:graphics-shapes:1.1.0") }
For more information about dependencies, see Add build dependencies.
Feedback
Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.
See the Issue Tracker documentation for more information.
There are no release notes for this artifact.
Graphics Version 1.1
Version 1.1.0
October 22, 2025
androidx.graphics:graphics-*:1.1.0 is released. Version 1.1.0 contains these commits.
Version 1.1.0-rc01
September 10, 2025
androidx.graphics:graphics-*:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.
Version 1.1.0-beta01
July 30, 2025
androidx.graphics:graphics-*:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.
API Changes
- Projects released with Kotlin 2.0 require KGP 2.0.0 or newer to be consumed (Idb6b5)
- Add
mingwX64, js and wasm compilation targets. (I2c46a)
Version 1.1.0-alpha01
December 11, 2024
androidx.graphics:graphics-*:1.1.0-alpha01 is released. Version 1.1.0-alpha01 contains these commits.
New Features
- Reworked the main demo into a generic Shape Editor. This allows you to import shapes from a svg path, manually edit the detected features in case of misses in the automatic process, and export the result into code that can be used in production code. (I1ac13)
- Replace angle measurements for shape outline progress with curve length measurements, this allows more complex shapes to be used for morphing. (I75478) , I390dd
- Improved the feature mapping algorithm, so more morphs should look more natural. (I83287)
API Changes
- Add SVG path import and feature serializer. The usual flow is:
- Use the new
SvgPathParser.parseFeatures()to convert a svg path (the value of thedattribute on thepathelement of a svg) into aList<Feature>. - That can be modified, then serialized into a string with
FeatureSerializer.serialize(). - The resulted string can be used in production code, importing it with
FeatureSerializer.parse() - Note that the steps 1 & 2 are done once, and can be done with the new app. Production code should only need to do step 3. (I9bd00, b/371196190), (Ic3842), (If68ed), (I10251)
- Use the new
- Expose polygon features and feature types. More generic
RoundedPolygonscan now be created with the base constructor that takes aList<Features>. Features are mainly a list of Cubic bezier curves, but they are tagged to help the Morph algorithm match between the start and end shapes (convex corners are mapped to convex corners and concave corners are mapped to concave corners). (I61e76), (I1fc5c) - Adds support for
watchosDeviceArm64KMP target and target kotlin 1.9. (Icf15d, b/364652024)
Bug Fixes
- Fixed edge case when the last feature was empty. (I390dd)
- Make
RoundedPolygoncreation more robust. (Ib862c, b/360888486) - Fix a bug on
RoundedPolygoninitialization. (I83ddb) - Fix an error in the algorithm to estimate the center of the polygon. (Ida147)
Graphics Shapes Version 1.0
Version 1.0.1
September 4, 2024
androidx.graphics:graphics-shapes:1.0.1, androidx.graphics:graphics-shapes-android:1.0.1, and androidx.graphics:graphics-shapes-desktop:1.0.1 are released. Version 1.0.1 contains these commits.
Version 1.0.0
August 21, 2024
androidx.graphics:graphics-shapes:1.0.0, androidx.graphics:graphics-shapes-android:1.0.0, and androidx.graphics:graphics-shapes-desktop:1.0.0 are released. Version 1.0.0 contains these commits.
Version 1.0.0-rc01
July 24, 2024
androidx.graphics:graphics-shapes:1.0.0-rc01, androidx.graphics:graphics-shapes-android:1.0.0-rc01, and androidx.graphics:graphics-shapes-desktop:1.0.0-rc01 are released. Version 1.0.0-rc01 contains these commits.
Version 1.0.0-beta01
May 1, 2024
androidx.graphics:graphics-shapes:1.0.0-beta01, androidx.graphics:graphics-shapes-android:1.0.0-beta01, and androidx.graphics:graphics-shapes-desktop:1.0.0-beta01 are released. Version 1.0.0-beta01 contains these commits.
API Changes
- Allow shapes to be pre-rotated to start at a different point. This change allows
pillStarshapes to start their curves from a non-default point on the perimeter. This can be useful when animating the stroking of the shape's path, to start drawing from a specific location on the shape's outline. (Ifbb4d, b/324303807) - Added
calculateBounds()functions to Morph, which parallel the same functions onRoundedPolygon. (I8a3b6, b/325463575)
Version 1.0.0-alpha05
February 7, 2024
androidx.graphics:graphics-shapes:1.0.0-alpha05, androidx.graphics:graphics-shapes-android:1.0.0-alpha05, and androidx.graphics:graphics-shapes-desktop:1.0.0-alpha05 are released. Version 1.0.0-alpha05 contains these commits.
New Features
- The library now offers new
pill()andpillStar()functions for easy creation of these rounded/starred shapes. There are also new APIs for calculating the exact bounds required for a shape (the previous bounds were just an estimate based on the underlying Bezier curve anchor and control points), as well as the max possible bounds, which can be helpful to determine the size of the container holding it if it will be rotated within that container. (I71827)
API Changes
- Now more options for retrieving exact and max bounds. (I6d49f, b/317286450)
Bug Fixes
- There were occasional rendering artifacts when drawing these shapes as stroked paths, due to a low-level rendering issue related to zero-length curves. This bug was fixed by eliminating all zero-length curves (which the shapes do not need, thus also saving on the overhead of the paths produced by the shapes).
Version 1.0.0-alpha04
December 13, 2023
androidx.graphics:graphics-shapes:1.0.0-alpha04, androidx.graphics:graphics-shapes-android:1.0.0-alpha04, and androidx.graphics:graphics-shapes-desktop:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.
New Features
- This release contains several API changes, as well as bug fixes.
- Many of the API changes make the Shapes library KMP-friendly. This makes it easier to call from non-Android code (such as Android-agnostic Compose code). For example, there are no Android types in the API, such as the previous PointF, Matrix, and Path types.
- There were also several changes made to APIs and implementation for performance reasons, specifically to minimize object allocation (and collection). For example, the move from PointF to separate Float parameters avoids allocating many temporary PointF structures to hold those vertices.
API Changes
- Replaced
Morph.asMutableCubicswith a function to iterate over theMutableCubics. ChangedPointTransformerfunctional interface, now it takes x and y coordinates of aPointand returns aTransformedResult(which is constructed with the transformed x & y coordinates) (I6719e) - Removed the public
Cubicconstructor and made it a factory function. (I409ce) - Adding Android-specific transform and drawing APIs (I079f6, b/292289543)
- Eliminate android dependencies (Iadc1c, b/292289543)
- Anchor and control property names are more sensible now (If13bd, b/294562941)
PointFparameters changed toFloatpairs (Id4705, b/276466399, b/290254314)progressis now passed toMorphdrawing commands directly (Icdca2)
Bug Fixes
- Fixed bug when creating big shapes. (I4fd66, b/313497325)
Version 1.0.0-alpha03
June 7, 2023
androidx.graphics:graphics-shapes:1.0.0-alpha03 is released. Version 1.0.0-alpha03 contains these commits.
API Changes
- Added new
RoundedPolygon.rectangle()function (I78e7e, b/280322189) - Star and Circle functions are now decapitalized and called via
RoundedPolygon's companion object: e.g.,RoundedPolygon.star(...)(I14735)
Bug Fixes
- Fixed bug on smoothing (Ibf894)
- Fixed a bug that occured when start and end shape were the same. Better distribute available space on side for cuts, first using available space for rounding, then for smoothing if there is space left. (Ibd320, b/277936300)
Version 1.0.0-alpha02
April 19, 2023
androidx.graphics:graphics-shapes:1.0.0-alpha02 is released. Version 1.0.0-alpha02 contains these commits.
API Changes
- The Polygon superclass was merged in with its subclass,
RoundedPolygon; all polygons are now [optionally] rounded polygons. - The Star function (which still returns a
RoundedPolygon, as before) now takes aninnerRadiusvalue, instead of the previousinnerRadiusRatioparameter. This is in the same units as the existing radius parameter, making things simpler and more consistent. Also, thenumOuterVerticesparameter was renamed tonumVerticesPerRadiusto clarify that the same number is applied to both inner and outer radii. CornerRounding.radiuswas previously documented to be relative to the size of the polygon, but it was (and should be) an absolute, not relative, value. The docs were updated and the annotation limiting it to a max value of 1.0 was fixed.
Version 1.0.0-alpha01
April 5, 2023
Graphics-Shapes is a new library which allows easy creation and rendering of rounded polygonal shapes, as well as simple and automatic morphing (animation) between different shapes.
androidx.graphics:graphics-shapes:1.0.0-alpha01 is released. This version was released from an internal branch.
New Features
- Use the Polygon API to create regular and star polygons with the desired number of vertices.
- Use optional
CornerRoundingparameters to specify the rounding radius and smoothing parameters for the corners, resulting in polygonal shapes with rounded corners. - Use the new
Morph(Polygon, Polygon)API to automatically calculate a “morph” shape whose progress can be set from 0 to 1 to animate between the starting and ending shapes. Animate that progress over time, drawing the result on every frame, to create a smooth animation between these new rounded shapes.
Graphics Path Version 1.0
Version 1.1.0-alpha01
August 13, 2025
androidx.graphics:graphics-path:1.1.0-alpha01 is released. Version 1.1.0-alpha01 contains these commits.
Bug Fixes
- Add implementation for conversion from conic to quadratic and use it on host platforms. f059b1
Version 1.0.1
May 1, 2024
androidx.graphics:graphics-path:1.0.1 is released. Version 1.0.1 contains these commits.
Bug Fixes
- Improvements to compiler flags.
Version 1.0.0
March 6, 2024
androidx.graphics:graphics-path:1.0.0 is released.
Version 1.0.0-rc01
February 21, 2024
androidx.graphics:graphics-path:1.0.0-rc01 is released. Version 1.0.0-rc01 contains these commits.
Bug Fixes
- Improve performance of PathIterator on API < 34 (Id4629)
Version 1.0.0-beta02
January 10, 2024
The changes in this release were all about reducing the size of the library, which was larger than necessary due to assumptions made by native code.
androidx.graphics:graphics-path:1.0.0-beta02 is released. Version 1.0.0-beta02 contains these commits.
Bug Fixes
- Reduced the size of
libandroidx.graphics.path.soby 96%. (I71397) - Reduce the size of
libandroidx.graphics.path.soby 5%. (I2da7c) - Shrunk the native components of
androidx.graphics:graphics-pathby 43%. (I8e40d)
Version 1.0.0-beta01
November 29, 2023
androidx.graphics:graphics-path:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.
API Changes
- Removed usages of experimental
isAtLeastU()API (Ie9117, b/289269026)
Bug Fixes
- Various fixes and performance improvements, including how the library deals with conics.
Version 1.0.0-alpha02
June 7, 2023
androidx.graphics:graphics-path:1.0.0-alpha02 is released. This version is developed in an internal branch.
New Features
- Fixed problem with internal platform version check which caused problems when running on Android 14 previews (the version check would fail, but the mechanism for doing things on previous releases doesn’t work correctly on Android 14 in particular).
Version 1.0.0-alpha01
March 22, 2023
androidx.graphics:graphics-path:1.0.0-alpha01 is released. Version 1.0.0-alpha01 contains these commits.
New Features
- This new library allows querying of Path data via the new
PathIteratorAPI. Using this API, callers can iterate through all segments of a Path object to determine the operation and data for those segments. - The library uses similar APIs introduced in Android 14 preview, but this AndroidX version of the API also works on versions back to API 21.
Graphics Core Version 1.0
Version 1.0.3
March 26, 2025
androidx.graphics:graphics-core:1.0.3 is released. Version 1.0.3 contains these commits.
Bug Fixes
- Fix for full-screen flickers while drawing on certain devices with API<33.
Version 1.0.2
October 16, 2024
androidx.graphics:graphics-core:1.0.2 is released. Version 1.0.2 contains these commits.
Bug Fixes
- Fixed issue where
SurfaceControlinstances would still be managed by the system compositor even after they were released. - Fixed issue where the currently presented
HardwareBufferinstance would not be released after low latency dependencies were disposed - Fixed flickering issue on certain Android 14+ devices that did not support the front buffer usage flag
Version 1.0.1
September 4, 2024
androidx.graphics:graphics-core:1.0.1 is released. Version 1.0.1 contains these commits.
Bug Fixes
- Fixed issue where memory resources would occasionally not be released.
Version 1.0.0
May 29, 2024
androidx.graphics:graphics-core:1.0.0 is released. Version 1.0.0 contains these commits.
Major features of 1.0.0
- Official stable release of the graphics-core library. Includes minor bug fixes and performance improvements from 1.0.0-rc01
Version 1.0.0-rc01
April 17, 2024
androidx.graphics:graphics-core:1.0.0-rc01 is released. This version is developed in an internal branch.
Bug Fixes
- Fixed issue leading to potential double closure of file descriptors with the
CanvasBufferedRendererAPIwith certain Android devices running Android 14. - Fixed issue where
FrameBufferwould not properly delete framebuffer instances.
Version 1.0.0-beta01
December 13, 2023
androidx.graphics:graphics-core:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.
New Features
- Introduced a new
LowLatencyCanvasViewAPI to support low latency rendering with Android’s 2d graphics APIs (Canvas + Paint) within the View hierarchy. - Introduced
CanvasBufferedRendererAPI to support hardware accelerated Canvas rendering to aHardwareBuffer. This can be used to draw a portion of a user interface into a buffer that can be converted to a Bitmap using theBitmap.wrapHardwareBufferAPI.
API Changes
- Updated
CanvasBufferRenderer#releaseBufferAPI to have an optional fence parameter. Updated documentation to describe whenRenderResult#fenceis returned. (If1ea7) - Add
drawmethod toRenderRequestto support leveraging coroutines to schedule draw requests. Renamed the previous draw method that consumed an executor todrawAsync. RefactoredisClosed()method to a property. (I5bff6) - Exposed buffer format parameter to
CanvasFrontBufferRendererto map directly toCanvasBufferedRenderer.Builder#setBufferFormat(I0f272) - Created
CanvasBufferedRendererAPI to handle hardware accelerated canvas rendering into aHardwareBuffer. This provides a backported implementation to Android Q alongside configuration of a swapchain depth ofHardwareBuffers.ColorSpaceconfiguration is still limited to Android U+ however the compat implementation provides no-op behavior on the developers' behalf. (I9b1d8) - Add
setFrameRate/clearFrameRateAPIs toSurfaceControlCompat.Transactionin order to control the frame rate alongside the change strategy for seamless or default transitions. (I6045c) - Lowered required API level for
setDataSpaceto Android Q from Android T. (I59c34) - Added
onBufferReleasedcallback toGLFrameBufferRendererAPI to give consumers the opportunity to clean up state when a buffer is no longer being presented (I8a4e2) - Create
LowLatencyCanvasViewto support a simple use case of rendering content with low latency that gets synchronized with the View hierarchy rendering. This mitigates the complexities associated withSurfaceViewmanagement by internally managing theSurfaceViewinstance that gets translated off/on screen for synchronized and low latency rendering respectively. (I9253b) - Added colorspace configuration support to
CanvasFrontBufferedRendererAPI. Updated multibuffered callbacks to also include the back bufferedSurfaceControl(I24bd9)
Version 1.0.0-alpha05
September 6, 2023
androidx.graphics:graphics-core:1.0.0-alpha05 is released. Version 1.0.0-alpha05 contains these commits.
New Features
- Introduced
GLFrameBufferRendererAPI. This provides a combination of OpenGL dependencies, swap chain configuration, pixel formats andSurfaceControlconfiguration. (Ic775b)
API Changes
- Added width + height parameters to various callback APIs to pipe dimensions from
SurfaceHolder#Callbacks. (I7f9fc) - Added clear API to clear both front and multi buffered layers. (Ic1f95)
- Added support to configure the underlying buffer type of swapchains used within
GLFrontBufferedRenderer. (I07a13) - Added kotlin properties for getters on
GLFrameBufferRenderer,IntRangeannotation for max buffer entries, andHardwareBufferFormartandHardwareBufferUsageannotations forsetFormat/setUsagerespectively. (Ief89e) - Updated
setBufferAPI onSurfaceControltransactions to provide a release fence. (Ice1bb) - Added
SurfaceControlCompat.TransactionAPIs to configure the data space as well as set the extended brightness range. (Ic378d)
Version 1.0.0-alpha04
June 7, 2023
androidx.graphics:graphics-core:1.0.0-alpha04 is released. Version 1.0.0-alpha04 contains these commits.
New Features
- Introduced
CanvasFrontBufferedRendererto support low latency graphics leveraging theandroid.graphics.CanvasAPI alongside the existing OpenGL implementation
API Changes
- Updated
SurfaceControlCompat.Transaction#setBufferAPI to allow for nullableHardwareBufferinstances to mirror the corresponding platform API (I173d7) - Rename methods referring to Double Buffered rendering to Multi Buffered instead as the backing swapchain may contain more than 2 buffers. (I830d7)
- Create
CanvasFrontBufferedRendererAPI to enable 3ps to leverage a front buffered rendering system using the Canvas API. (Ibfc29)
Bug Fixes
- Fixed issue where
GLFrontBufferedRendererwould not render content after resuming the corresponding Activity. - Fixed issue where front buffered content would be cleared prematurely.
- Fixed issue where
SurfaceHolder.Callbackswould not be removed after low latency graphics APIs were released.
Version 1.0.0-alpha03
March 22, 2023
androidx.graphics:graphics-core:1.0.0-alpha03 is released. Version 1.0.0-alpha03 contains these commits.
API Changes
- Updated
GLFrontBufferedRenderercallback implementation to provideBufferInfoobject that contains buffer width/height along with a frame buffer identifier that can be used to re-target the original destination after rendering to an intermediate scratch buffer. (I7fe20) - Consolidated
SyncFencecreation to static factory method onSyncFenceCompat. - Removed public compatibility method for
eglDupNativeFenceFDANDROIDin favor ofSyncFenceCompatfactory method for SyncFence creation. This is to ensure all API surfaces receive the correctSyncFenceimplementation regardless of API level. (I849bb) - Added documentation for
FrameBufferRendererandSyncStrategy.- Moved
FrameBufferRenderer+FrameBuffer+FrameBufferPooltoandroidx.graphics.openglpackage - Moved
SyncStrategytoandroidx.graphics.openglpackage - Updated
RenderCallback#onDrawdocs - Updated documentation of
RenderCallback#obtainFrameBufferthat implementor of API is responsible for callingFrameBuffer.close - Updated
onDrawCompleteto indicate consumers are responsible for dispatching contents to display - Moved
SyncFencecompatibility interfaces/classes toandroidx.hardwarepackage to mirror the framework - Renamed
SyncFenceAPI toSyncFenceV19and made private to consolidate usages toSyncFenceCompatwhich leverages the framework'sSyncFenceAPI wherever possible. (I5149c)
- Moved
- Added
GLFrontBufferedRenderer#cancelandGLFrontBufferedRenderer#executemethods. The former is useful in palm rejection scenarios where rendering to the front buffer should be cancelled and hide the front buffer. The latter is useful in scenarios to manipulate objects on the GL thread without having to schedule a render. (If0b7f) - Add API to render directly to the double buffered layer. This assists with re-rendering a scene after resume as well as giving an opportunity to consumers to selectively determine when to leverage front buffered rendering dynamically based on the desired scene to render. (Ied56c)
- Added new API to
SurfaceControlCompat.Builderto support configuring the parentSurfaceControlfrom anotherSurfaceControlinstance in addition to the existing mechanism from aSurfaceView. (I1d1b6) - More return type nullability of deprecated-hidden functions (Ibf7b0)
- Added
EGL_ANDROID_get_native_client_bufferextension constant to query whether the Android device supports importing ofHardwareBufferinstances intoEGLClientBufferobjects that can be consumed as anEGLImageinstance. (Iad767) - Adding
@JvmDefaultWithCompatibilityannotation (I8f206)
Version 1.0.0-alpha02
November 9, 2022
androidx.graphics:graphics-core:1.0.0-alpha02 is released. Version 1.0.0-alpha02 contains these commits.
API Changes
- Fixed missing
RequiresApiannotation foraddTransactionCommitListenerwhich was introduced in Android S (I0a035) - Updated
onDraw<Front/Double>Buffer callbacks to provide a transform matrix that consumers can pass to their vertex shaders in addition to the current buffer width/height. Consumers are responsible for using these parameters to properly pre-rotate their OpenGL rendering code. (I82f9e)
Bug Fixes
- Improved graphics latency by pre-rotating buffers before issuing
SurfaceControltransactions. - Fixed issue where error logs would show error 300d (EGL_BAD_SURFACE).
- Fixed issue where
GLFrontBufferedRendererwould be invalid after the corresponding Activity it was used within was resumed. - Increased support for emulators and ChromeOS devices.
- Fixed issue where the front buffered layer maybe hidden prematurely.
Version 1.0.0-alpha01
October 24, 2022
androidx.graphics:graphics-core:1.0.0-alpha01 is released. Version 1.0.0-alpha01 contains these commits.
New Features
- Initial release of the graphics core AndroidX library. This includes APIs to support low latency use cases such as stylus input. This also introduces some helper APIs for OpenGL usage.
API Changes
- Introduces
GLFrontBufferedRendererto assist in front and multi-buffered rendering to achieve both low latency and high quality rendering output. - Introduces
GLRendererAPI to assist in OpenGL rendering for various Surface providers such asSurfaceView,TextureViewand others.