Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Issue 1241683003: Fix buggy blend modes. (Closed)

Created:
5 years, 5 months ago by mtklein_C
Modified:
5 years, 5 months ago
Reviewers:
f(malita), mtklein, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Fix buggy blend modes. The problem turns out to be not over- or underflow like I thought, but that I used different math for x*y/255 for alphas and colors, sometimes resulting in colors where alpha was one less than the maximum color component, which is not a valid SkPMColor. To be safe, I've switched over all four of these similar complex modes to use exact math everywhere. They now match the byte-by-byte code in SkXfermode.cpp exactly. This will slow down Darken and Lighten by about 2x. I plan to follow up with a CL to see if I can eek out some speed there, and another CL to add asserts that Sk4px code always writes valid SkPMColors. BUG=skia:4052 Committed: https://skia.googlesource.com/skia/+/44cf62c79ec06f2d9ba408db593f3da2400d3a43

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -12 lines) Patch
M src/core/Sk4pxXfermode.h View 1 chunk +28 lines, -12 lines 0 comments Download

Messages

Total messages: 11 (4 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1241683003/1
5 years, 5 months ago (2015-07-14 17:57:40 UTC) #2
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 5 months ago (2015-07-14 18:15:38 UTC) #4
mtklein_C
5 years, 5 months ago (2015-07-14 19:18:36 UTC) #6
f(malita)
LGTM These are guarded in Chromium, right?
5 years, 5 months ago (2015-07-14 20:21:47 UTC) #7
mtklein
On 2015/07/14 20:21:47, f(malita) wrote: > LGTM > > These are guarded in Chromium, right? ...
5 years, 5 months ago (2015-07-14 20:37:26 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1241683003/1
5 years, 5 months ago (2015-07-14 20:37:52 UTC) #10
commit-bot: I haz the power
5 years, 5 months ago (2015-07-14 20:38:33 UTC) #11
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://skia.googlesource.com/skia/+/44cf62c79ec06f2d9ba408db593f3da2400d3a43

Powered by Google App Engine
This is Rietveld 408576698