Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in Coons Patches + API alignement + Example #164

Merged
merged 38 commits into from
Feb 2, 2022

Conversation

wcandillon
Copy link
Contributor

There was a serious bug in the order of the points we were providing to Skia.
The API has been updated to be more symmetric with the Vertices API.

In terms of the parameters to provide, there are many we could do there and I am up to discussing them.
We can potentially provide support for different input shapes.
The current API requires you to think of a Coons Patch as 4 cornes with 2 cubic Bezier handle per corner.
In the use case of the example (with movable handles), it works seamlessly. There might be some other use cases where an input of a different shape makes sense, (when given curves directly for instance). We could definitely provide some utility functions there.

@wcandillon wcandillon requested a review from chrfalch February 1, 2022 09:50
@wcandillon wcandillon self-assigned this Feb 1, 2022
@@ -3,7 +3,7 @@ import { StyleSheet, View } from "react-native";

import { HomeScreenButton } from "./HomeScreenButton";

export const HomeScreen: React.FC = () => {
export const HomeScreen = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: I like using React.FC in component declarations since they enforce a few extra things like the return value of the function being correct. We'll go without it for now - just wanted to mention it.

Copy link
Contributor

@chrfalch chrfalch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have tested on both iOS/Android and it seems to be working nice.

@@ -122,8 +122,8 @@ namespace RNSkia
// verify size of input uniforms
if (jsiUniformsSize * sizeof(float) != getObject()->uniformSize())
{
jsi::detail::throwJSError(
runtime, "Uniforms size differs from effect's uniform size.");
std::string msg = "Uniforms size differs from effect's uniform size. Received " + std::to_string(jsiUniformsSize) + " expected " + std::to_string(getObject()->uniformSize() / sizeof(float));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long line - should have some line breaks :)

@wcandillon wcandillon merged commit 9912c25 into main Feb 2, 2022
@wcandillon wcandillon deleted the feat/mesh-gradients branch April 7, 2022 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants