Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1871)

Issue 6653044: S32A_D565_Blend has a bug where it can overflow the final 5/6/5 values. This

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 6 months ago by reed1
Modified:
11 years, 6 months ago
Reviewers:
bsalomon
CC:
skia-review_googlegroups.com, robertphillips, caryclark1, bungeman
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

S32A_D565_Blend has a bug where it can overflow the final 5/6/5 values. This happens because when we try to merge an 8-bit and a 5/6/5-bit value into the same "space", we had been truncing down the 8-bit value. This is wrong... e.g. src 8-bit value: 0xF8 dst 5-bit value: 0x1F If we trunc down, to move everyone into the 5-bit space, we get src: 0x1F dst: 0x1F But now we *think* that our src is fully saturated (which it wasn't.. 0xF8) and subsequently we've violated our premul requirement that all components are <= alpha. The fix is to perform the math in 8-bit space instead, so we promote the 5/6/5 values UP, do the math, and then shift them back down.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -7 lines) Patch
M src/core/SkBlitRow_D16.cpp View 2 chunks +20 lines, -7 lines 0 comments Download

Messages

Total messages: 2
reed1
11 years, 6 months ago (2012-10-11 15:56:56 UTC) #1
bsalomon
11 years, 6 months ago (2012-10-11 16:56:48 UTC) #2
On 2012/10/11 15:56:56, reed1 wrote:

LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b