From 9208a3c359fda5d00babbd159780a5cf09f98f37 Mon Sep 17 00:00:00 2001 From: Maxwell Metzger Mitchell <60010512+maxmmitchell@users.noreply.github.com> Date: Wed, 15 Jul 2026 18:16:53 +0000 Subject: [PATCH] Upgrade to Ink 1.1.0-alpha05 --- .../viewmodel/DrawingCanvasViewModel.kt | 1 - gradle/libs.versions.toml | 2 +- ink-proto/src/main/proto/brush_family.proto | 76 +++++++++++++++++++ 3 files changed, 77 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/cahier/features/drawing/viewmodel/DrawingCanvasViewModel.kt b/app/src/main/java/com/example/cahier/features/drawing/viewmodel/DrawingCanvasViewModel.kt index efc2b63f..eadeede0 100644 --- a/app/src/main/java/com/example/cahier/features/drawing/viewmodel/DrawingCanvasViewModel.kt +++ b/app/src/main/java/com/example/cahier/features/drawing/viewmodel/DrawingCanvasViewModel.kt @@ -292,7 +292,6 @@ class DrawingCanvasViewModel @Inject constructor( } val strokeRenderer = CanvasStrokeRenderer.create( - forcePathRendering = true, textureStore = textureStore ) strokes.forEach { stroke -> diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 73e6a811..20bf3b11 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ coilCompose = "3.4.0" foundation = "1.10.5" hiltAndroid = "2.59.2" hiltNavigationCompose = "1.3.0" -ink = "1.1.0-alpha04" +ink = "1.1.0-alpha05" kotlin = "2.3.20" coreKtx = "1.18.0" junit = "4.13.2" diff --git a/ink-proto/src/main/proto/brush_family.proto b/ink-proto/src/main/proto/brush_family.proto index 310337e8..9e2e85e2 100644 --- a/ink-proto/src/main/proto/brush_family.proto +++ b/ink-proto/src/main/proto/brush_family.proto @@ -402,6 +402,13 @@ message BrushPaint { BLEND_MODE_XOR = 12 [(ink.proto.enum_value_min_version) = 0]; } + oneof layer { + TilingTexture tiling_texture = 24 + [(ink.proto.field_min_version) = 2147483647]; + StampingTexture stamping_texture = 25 + [(ink.proto.field_min_version) = 2147483647]; + } + // String id that will be used by renderers to retrieve the color texture. optional string client_texture_id = 1 [(ink.proto.field_min_version) = 0]; @@ -467,6 +474,75 @@ message BrushPaint { reserved 23; } + // A texture that will repeat according to a 2D affine transformation of + // vertex positions. Each copy of the texture will have the same size and + // shape, modulo reflections. + message TilingTexture { + option (ink.proto.message_min_version) = 2147483647; + + // String id that will be used by renderers to retrieve the color texture. + optional string client_texture_id = 1 + [(ink.proto.field_min_version) = 2147483647]; + + // The origin point to use for the texture + optional TextureLayer.Origin origin = 2 [ + default = ORIGIN_STROKE_SPACE_ORIGIN, + (ink.proto.field_min_version) = 2147483647 + ]; + + // The unit for size_x and size_y. + optional TextureLayer.SizeUnit size_unit = 3 [ + default = SIZE_UNIT_STROKE_COORDINATES, + (ink.proto.field_min_version) = 2147483647 + ]; + + // How points outside the texture in the x direction are treated for this + // texture layer + optional TextureLayer.Wrap wrap_x = 4 + [default = WRAP_REPEAT, (ink.proto.field_min_version) = 2147483647]; + + // How points outside the texture in the y direction are treated for this + // texture layer + optional TextureLayer.Wrap wrap_y = 5 + [default = WRAP_REPEAT, (ink.proto.field_min_version) = 2147483647]; + + // The x-dimension of size of (one animation frame of) the texture, + // specified in `size_unit`s + optional float size_x = 6 + [default = 1, (ink.proto.field_min_version) = 2147483647]; + + // The y-dimension of size of (one animation frame of) the texture, + // specified in `size_unit`s + optional float size_y = 7 + [default = 1, (ink.proto.field_min_version) = 2147483647]; + + // An x-offset into the texture, specified as fractions of the texture size. + optional float offset_x = 8 [(ink.proto.field_min_version) = 2147483647]; + + // A y-offset into the texture, specified as fractions of the texture size. + optional float offset_y = 9 [(ink.proto.field_min_version) = 2147483647]; + + // Angle in radians specifying the rotation of the texture. The rotation is + // carried out about the center of the texture's first repetition along both + // axes. + optional float rotation_in_radians = 10 + [(ink.proto.field_min_version) = 2147483647]; + } + + // A texture intended for use with particle brush coats (i.e. with a brush tip + // with a nonzero particle gap). A copy of the texture (or one animation frame + // thereof) will be "stamped" onto each particle of the stroke, scaled or + // rotated appropriately to cover the whole particle. + message StampingTexture { + option (ink.proto.message_min_version) = 2147483647; + + // String id that will be used by renderers to retrieve the color texture. + optional string client_texture_id = 1 + [(ink.proto.field_min_version) = 2147483647]; + + reserved 2 to 5; + } + // Specifies how parts of the stroke that intersect itself should be treated // during the rendering process. The simplest example of this is with // translucent, solid-color strokes - such as a highlighter - where a later