History log of /external/skia/gm/blend.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
33d2055e594177b27360f84e0631b26d74a55a9b 22-Mar-2017 Mike Klein <mtklein@chromium.org> GM: some header cleanup

gm.h includes sk_tool_utils.h but does not use it.

The bulk of this CL makes each gm that uses sk_tool_utils include it.

sk_tool_utils.h also provided SkRandom and SkTDArray,
so a couple GMs add those headers too.

Change-Id: Ieb2a7c542f0ca89c3223f744fc11b0ff37af36c1
Reviewed-on: https://skia-review.googlesource.com/10014
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
/external/skia/gm/blend.cpp
40254c2c2dc28a34f96294d5a1ad94a99b0be8a6 05-Aug-2016 lsalzman <lsalzman@mozilla.com> SkBlendARGB32 and S32[A]_Blend_BlitRow32 are currently formulated as: SkAlphaMulQ(src, src_scale) + SkAlphaMulQ(dst, dst_scale), which boils down to ((src*src_scale)>>8) + ((dst*dst_scale)>>8). In particular, note that the intermediate precision is discarded before the two parts are added together, causing the final result to possibly inaccurate.

In Firefox, we use SkCanvas::saveLayer in combination with a backdrop that initializes the layer to the background. When this is blended back onto background using transparency, where the source and destination pixel colors are the same, the resulting color after the blend is not preserved due to the lost precision mentioned above. In cases where this operation is repeatedly performed, this causes substantially noticeable differences in color as evidenced in this downstream Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1200684

In the test-case in the downstream report, essentially it does blend(src=0xFF2E3338, dst=0xFF2E3338, scale=217), which gives the result 0xFF2E3237, while we would expect to get back 0xFF2E3338.

This problem goes away if the blend is instead reformulated to effectively do (src*src_scale + dst*dst_scale)>>8, which keeps the intermediate precision during the addition before shifting it off.

This modifies the blending operations thusly. The performance should remain mostly unchanged, or possibly improve slightly, so there should be no real downside to doing this, with the benefit of making the results more accurate. Without this, it is currently unsafe for Firefox to blend a layer back onto itself that was initialized with a copy of its background.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2097883002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

[mtklein adds...]
No public API changes.
TBR=reed@google.com

Review-Url: https://codereview.chromium.org/2097883002
/external/skia/gm/blend.cpp
3d72c099c7341291e869099ef6c6600856ff24f8 06-Apr-2016 mtklein <mtklein@chromium.org> Remove conditional flavor text on blend GM.

This was breaking replay modes for no good reason.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1864253002

Review URL: https://codereview.chromium.org/1864253002
/external/skia/gm/blend.cpp
6ceeebd37a43d879c120b6ba100ae1febdd67a18 09-Mar-2016 reed <reed@google.com> unify peekPixels around pixmap parameter

requires this chrome CL to land first
https://codereview.chromium.org/1775393003/

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1784563002

Review URL: https://codereview.chromium.org/1784563002
/external/skia/gm/blend.cpp
96fcdcc219d2a0d3579719b84b28bede76efba64 27-Aug-2015 halcanary <halcanary@google.com> Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
/external/skia/gm/blend.cpp
125960152dfd7f2aba4c2239131bdf75d9ac2705 29-Jul-2015 caryclark <caryclark@google.com> make tests portable by using 565 compatible colors

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1262703002
/external/skia/gm/blend.cpp
4afe21e864bebab22ff83aeaa04b5e11fe5698a2 17-Apr-2015 mtklein <mtklein@chromium.org> add a GM to demo the blend bug

BUG=skia:3739

Review URL: https://codereview.chromium.org/1094863003
/external/skia/gm/blend.cpp
350b4d50ea4a9a151d8049ad1d3f411bb2f2602f 01-Aug-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove SkBlendImageFilter, and all tests. Its functionality has been subsumed by SkXfermodeImageFilter.

R=robertphillips@google.com

Review URL: https://codereview.chromium.org/21404002

git-svn-id: http://skia.googlecode.com/svn/trunk@10482 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/blend.cpp
ba3a3c93b255639f7841b973294a938b103491f3 01-Feb-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> revert name changes to SkBlendImageFilter. It (correctly) named its enum kMultiply_Mode,
and handled that itself internally, rather than calling SkXfermode. This CL removes
the kModulate_Mode alias from its list.



git-svn-id: http://skia.googlecode.com/svn/trunk@7509 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/blend.cpp
8d3cd7a170c810e3816bf00220cbef51e7b16795 30-Jan-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> clone of https://codereview.appspot.com/7208043/
Review URL: https://codereview.appspot.com/7232062

git-svn-id: http://skia.googlecode.com/svn/trunk@7476 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/blend.cpp
ff06af20fde68aa737b540dc6e42924532873b22 14-Jan-2013 junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Changing imageFilter GM tests to use drawBitmap instead of drawSprite

The motivation is be able to test the filters with scaled SkPicture playback in isolation from the issues that surround usage of drawSprite
Review URL: https://codereview.appspot.com/7060071

git-svn-id: http://skia.googlecode.com/svn/trunk@7152 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/blend.cpp
94acc70312d8fe6605dea99f27f62b180bf22284 06-Sep-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fixed Windows compiler complaints (esp. in debugger)

https://codereview.appspot.com/6497090/



git-svn-id: http://skia.googlecode.com/svn/trunk@5419 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/blend.cpp
ae933ce0ea5fd9d21cb6ef2cee7e729d32690aac 23-Aug-2012 rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)

This CL is part III of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6475053

git-svn-id: http://skia.googlecode.com/svn/trunk@5264 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/blend.cpp
b2ee33c535720d066dd0d51f38686517efa34f2a 22-Aug-2012 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implements the non-Porter-Duff compositing modes required for SVG's feBlend
element. This filter has two inputs, since normal blending can't be used. The
GPU side uses two filter stages to accomplish this: one to sample the
background, and one to sample the foreground and blend it.

Review URL: https://codereview.appspot.com/6463081/



git-svn-id: http://skia.googlecode.com/svn/trunk@5231 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/blend.cpp