Skip to content

Conversation

@jason-simmons
Copy link
Member

Fixes #10424

@jason-simmons
Copy link
Member Author

@abarth @Hixie

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is completely correct. We pass the offset to pushShaderMask as well, which is redundant with the rect that we pass now. I'd look at how the other functions (e.g., clip) handle this case. I thought we always passed the rects before applying the offset.

I guess the tricky issue here is the shader callback?

Copy link
Member Author

Choose a reason for hiding this comment

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

The offset is passed to pushShaderMask so it can be passed onward to the painter() callback.

pushClipRect() internally applies the offset to the clipRect and uses the result to construct the ClipRectLayer.

We could do something similar here - call _shaderCallback(offset & size) in RenderShaderMask.paint to build the shader. Then, in pushShaderMask, use maskRect.shift(offset) as the maskRect when constructing the ShaderMaskLayer.

Would that be more consistent?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think so.

@abarth
Copy link
Contributor

abarth commented Jun 2, 2017

Also missing a test.

@jason-simmons
Copy link
Member Author

Done - PTAL

@abarth
Copy link
Contributor

abarth commented Jun 2, 2017

LGTM

@jason-simmons jason-simmons merged commit 0727540 into flutter:master Jun 2, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
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.

ShaderMask is broken by the shifting done by Align

3 participants