[Impeller] let drawImage nine use porter duff optimization.#169611
[Impeller] let drawImage nine use porter duff optimization.#169611auto-submit[bot] merged 6 commits intoflutter:masterfrom
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
gaaclarke
left a comment
There was a problem hiding this comment.
Looking good, just needs cleaned up documentation.
| float16_t output_alpha; | ||
| float tmx; | ||
| float tmy; | ||
| vec4 ai_ao_tmx_tmy; |
| float tmx = frag_info.ai_ao_tmx_tmy.z; | ||
| float tmy = frag_info.ai_ao_tmx_tmy.w; |
There was a problem hiding this comment.
No abbreviations: https://google.github.io/styleguide/cppguide.html#General_Naming_Rules
There was a problem hiding this comment.
This isn't C++ :)
There was a problem hiding this comment.
Oh I forgot, the glsl style guide says abbreviate everything. Nevermind, change everything else then.
There was a problem hiding this comment.
(do you get the joke, I used an abbreviation to respond to you)
There was a problem hiding this comment.
(also yes, I will change this :) )
There was a problem hiding this comment.
Sorry, I was actually talking about the tmx, tmy variables. The packed one was unfortunate but I figured the docstring would help.
- float tmx = frag_info.ai_ao_tmx_tmy.z;
- float tmy = frag_info.ai_ao_tmx_tmy.w;
+ vec2 tileMode = vec2(frag_info.ai_ao_tmx_tmy.z, frag_info.ai_ao_tmx_tmy.w);
engine/src/flutter/impeller/entity/shaders/blending/porter_duff_blend.frag
Show resolved
Hide resolved
|
|
||
| virtual bool ShouldInvertBlendMode() const { return true; } | ||
|
|
||
| virtual std::optional<Rect> GetStrictSrcRect() const { return std::nullopt; } |
There was a problem hiding this comment.
Docstring please, just add a "see also" that points to the definition of strict source rects.
| float tmx = frag_info.ai_ao_tmx_tmy.z; | ||
| float tmy = frag_info.ai_ao_tmx_tmy.w; |
There was a problem hiding this comment.
Sorry, I was actually talking about the tmx, tmy variables. The packed one was unfortunate but I figured the docstring would help.
- float tmx = frag_info.ai_ao_tmx_tmy.z;
- float tmy = frag_info.ai_ao_tmx_tmy.w;
+ vec2 tileMode = vec2(frag_info.ai_ao_tmx_tmy.z, frag_info.ai_ao_tmx_tmy.w);|
|
||
| virtual bool ShouldInvertBlendMode() const { return true; } | ||
|
|
||
| /// @brief the source rect of the draw if a strict source rect should |
There was a problem hiding this comment.
| /// @brief the source rect of the draw if a strict source rect should | |
| /// @brief The source rect of the draw if a strict source rect should |
gaaclarke
left a comment
There was a problem hiding this comment.
LGTM modulo the tilemode abbreviation.
Fixes #169492
Currently we apply a color filter nine times for the drawImageNine calls, which is very expensive. We can do the same porterduff optimization we did for flame for drawImage nine by allowing the porter duff shader to specify a strict src rect.
Before
After