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

Feature alpha mask #111

Merged
merged 16 commits into from
Oct 25, 2023
Merged

Feature alpha mask #111

merged 16 commits into from
Oct 25, 2023

Conversation

yslib
Copy link
Member

@yslib yslib commented Oct 25, 2023

Description

Add support for alpha mask and background blur

@yslib yslib force-pushed the feature-alpha-mask branch from 26bc8f5 to 05b8910 Compare October 25, 2023 09:29
auto r = SkRuntimeEffect::MakeForShader(SkString(R"(
uniform shader content;
uniform shader bg;
uniform float2 size;
Copy link
Member

Choose a reason for hiding this comment

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

Some tabs are mixed here.

DEBUG("%s", r.errorText.c_str());
return nullptr;
}
SkRuntimeShaderBuilder builder(std::move(r.effect));
Copy link
Member

Choose a reason for hiding this comment

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

Could this builder be static and be initialized only once?

else if (*blurType == BT_Zoom)
DEBUG("Zoom blur has not been implemeted");
else if (*blurType == BT_Motion)
DEBUG("Zoom blur has not been implemeted");
Copy link
Member

Choose a reason for hiding this comment

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

Should be Motion blur has not been implemented

else if (*blurType == BT_Background)
painter.blurBackgroundEnd();
else if (*blurType == BT_Zoom)
DEBUG("Zoom blur has not been implemeted");
Copy link
Member

Choose a reason for hiding this comment

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

typo. implemented

std::ofstream ofs(*m_skpPath);
if (ofs.is_open())
{
ofs.write((char*)data->data(), data->size());
Copy link
Member

Choose a reason for hiding this comment

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

This may have potential issue with wasm version.

@harry75369 harry75369 merged commit 8ac437b into main Oct 25, 2023
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2023
@yslib yslib deleted the feature-alpha-mask branch October 25, 2023 10:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants