Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ class DrawingCanvasViewModel @Inject constructor(
}

val strokeRenderer = CanvasStrokeRenderer.create(
forcePathRendering = true,
textureStore = textureStore
)
strokes.forEach { stroke ->
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
76 changes: 76 additions & 0 deletions ink-proto/src/main/proto/brush_family.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down Expand Up @@ -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
Expand Down
Loading