The FP factory would apply optimizations based on the mode, and return
one of the passed-in FPs. We use 'nullptr' as the 'src' FP when
constructing the blender's FP in make_effect_fp. This means that we get
back 'nullptr' from a src-mode blender. Later, we interpret that as
src-over (the default for an unset blender). Oops.
The new test variant would previously fail, before the fix to the FP.
The tweak to the FP technically eliminates an optimization, but it's one
that only applies to blending happening in the shader (eg, compose
shader, or runtime effects using a blender), and only when the blender
is one of the trivial modes. The resulting shader will still optimize
down, it just involves a bit of extra work before that happens. This
shouldn't have any long-term performance impact, particularly on
important scenarios.
Change-Id: Id5c6a6ca8a263b35c2dca3c41171748cffd41adb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/556599
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
I keep bumping into the need for this
Change-Id: I69384f7d590c163fd6244bdc64cc5e48450fecd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540171
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I238d29ba0250224fa593845ae65192653f58faff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528156
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is a reland of 0b62a05d9a
Original change's description:
> Add unit test confirming Runtime Blends match native blends.
>
> We perform the same draw operation twice--once with a `setBlendMode`
> based blend, and then once more with `setBlender` and passing SkSL which
> is equivalent to the native blend op. If this test fails, it would
> indicate that Runtime Blends aren't being applied appropriately (or
> perhaps that a GPU's built-in blending modes are cutting corners?).
>
> Change-Id: I4ca1f9ed600d9ec733687cc6de7d3e2eb6e765c9
> Bug: skia:12080
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428318
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Bug: skia:12080
Change-Id: Idf4297314b133e5bce689a25d53063bff8469fac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428676
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This reverts commit 0b62a05d9a.
Reason for revert: GetRuntimeBlendForBlendMode not found in google3
Does the new file that contains that not appear in google3's build?
Original change's description:
> Add unit test confirming Runtime Blends match native blends.
>
> We perform the same draw operation twice--once with a `setBlendMode`
> based blend, and then once more with `setBlender` and passing SkSL which
> is equivalent to the native blend op. If this test fails, it would
> indicate that Runtime Blends aren't being applied appropriately (or
> perhaps that a GPU's built-in blending modes are cutting corners?).
>
> Change-Id: I4ca1f9ed600d9ec733687cc6de7d3e2eb6e765c9
> Bug: skia:12080
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428318
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
TBR=brianosman@google.com,reed@google.com,johnstiles@google.com
Change-Id: Idd5ca97cfc4b642d3f97fdbd1fe9bd108b56e3a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428617
Reviewed-by: Mike Reed <reed@google.com>
We perform the same draw operation twice--once with a `setBlendMode`
based blend, and then once more with `setBlender` and passing SkSL which
is equivalent to the native blend op. If this test fails, it would
indicate that Runtime Blends aren't being applied appropriately (or
perhaps that a GPU's built-in blending modes are cutting corners?).
Change-Id: I4ca1f9ed600d9ec733687cc6de7d3e2eb6e765c9
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428318
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>