-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69f34b0
commit b9faa62
Showing
44 changed files
with
1,100 additions
and
849 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
...ain/kotlin/io/github/alexzhirkevich/compottie/internal/platform/PlatformShader.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.github.alexzhirkevich.compottie.internal.platform | ||
|
||
import androidx.compose.ui.geometry.Offset | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.LinearGradientShader | ||
import androidx.compose.ui.graphics.Matrix | ||
import androidx.compose.ui.graphics.RadialGradientShader | ||
import androidx.compose.ui.graphics.TileMode | ||
import androidx.compose.ui.graphics.setFrom | ||
import androidx.compose.ui.graphics.toArgb | ||
|
||
|
||
private val tempMatrix = android.graphics.Matrix() | ||
|
||
actual fun MakeLinearGradient( | ||
from : Offset, | ||
to : Offset, | ||
colors : List<Color>, | ||
colorStops: List<Float>, | ||
tileMode: TileMode, | ||
matrix: Matrix | ||
) = LinearGradientShader( | ||
from = from, | ||
to = to, | ||
colorStops = colorStops, | ||
tileMode = tileMode, | ||
colors = colors | ||
).apply { | ||
tempMatrix.setValues(matrix.values) | ||
setLocalMatrix(tempMatrix) | ||
} | ||
|
||
actual fun MakeRadialGradient( | ||
center : Offset, | ||
radius : Float, | ||
colors : List<Color>, | ||
colorStops: List<Float>, | ||
tileMode: TileMode, | ||
matrix: Matrix | ||
) = RadialGradientShader( | ||
center = center, | ||
radius = radius, | ||
colorStops = colorStops, | ||
tileMode = tileMode, | ||
colors = colors | ||
).apply { | ||
tempMatrix.setValues(matrix.values) | ||
setLocalMatrix(tempMatrix) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...nMain/kotlin/io/github/alexzhirkevich/compottie/internal/content/PathAndDrawingContext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.github.alexzhirkevich.compottie.internal.content | ||
|
||
internal interface PathAndDrawingContext : DrawingContent, PathContent { | ||
} |
5 changes: 2 additions & 3 deletions
5
.../src/commonMain/kotlin/io/github/alexzhirkevich/compottie/internal/content/PathContent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
package io.github.alexzhirkevich.compottie.internal.content | ||
|
||
import androidx.compose.ui.graphics.Path | ||
import io.github.alexzhirkevich.compottie.internal.content.Content | ||
|
||
interface PathContent : Content { | ||
fun getPath(time: Int) : Path | ||
internal interface PathContent : Content { | ||
fun getPath(frame: Int) : Path | ||
} |
20 changes: 0 additions & 20 deletions
20
.../commonMain/kotlin/io/github/alexzhirkevich/compottie/internal/graphics/ShapeLayerDraw.kt
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
.../commonMain/kotlin/io/github/alexzhirkevich/compottie/internal/platform/PlatformShader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.github.alexzhirkevich.compottie.internal.platform | ||
|
||
import androidx.compose.ui.geometry.Offset | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.Matrix | ||
import androidx.compose.ui.graphics.Shader | ||
import androidx.compose.ui.graphics.TileMode | ||
|
||
|
||
expect fun MakeLinearGradient( | ||
from : Offset, | ||
to : Offset, | ||
colors : List<Color>, | ||
colorStops: List<Float>, | ||
tileMode: TileMode = TileMode.Clamp, | ||
matrix: Matrix | ||
) : Shader | ||
|
||
|
||
expect fun MakeRadialGradient( | ||
center : Offset, | ||
radius : Float, | ||
colors : List<Color>, | ||
colorStops: List<Float>, | ||
tileMode: TileMode = TileMode.Clamp, | ||
matrix: Matrix | ||
) : Shader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.