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

Issue 6309007: O2D: Fix graphical artifacting with transparent images caused by using non-pr... (Closed)

Created:
9 years, 11 months ago by Tristan Schmelcher 2
Modified:
9 years, 6 months ago
Reviewers:
zhurunz1, geer, fbarchard, Tim H
CC:
o3d-review_googlegroups.com
Visibility:
Public.

Description

O2D: Fix graphical artifacting with transparent images caused by using non-premultiplied alpha ARGB images as if they were premultiplied alpha ARGB. This caused the transparent parts of images to be too bright (and in some cases fully opaque). Cairo only supports premultiplied alpha, but O3D calls SetRect() with non-premultiplied alpha, so we have to convert. TEST=loaded O2D and verified transparent images look correct now BUG=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72658

Patch Set 1 #

Total comments: 12

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 3

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -40 lines) Patch
M core/cross/cairo/texture_cairo.h View 1 2 3 chunks +1 line, -4 lines 0 comments Download
M core/cross/cairo/texture_cairo.cc View 1 2 3 9 chunks +45 lines, -36 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Tristan Schmelcher 2
9 years, 11 months ago (2011-01-19 20:46:03 UTC) #1
Tristan Schmelcher 2
Ping?
9 years, 11 months ago (2011-01-21 19:02:42 UTC) #2
fbarchard
http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc File core/cross/cairo/texture_cairo.cc (right): http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc#newcode2 core/cross/cairo/texture_cairo.cc:2: * Copyright 2010, Google Inc. 2011 http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc#newcode38 core/cross/cairo/texture_cairo.cc:38: #include ...
9 years, 11 months ago (2011-01-24 19:23:08 UTC) #3
Tristan Schmelcher 2
http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc File core/cross/cairo/texture_cairo.cc (right): http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc#newcode2 core/cross/cairo/texture_cairo.cc:2: * Copyright 2010, Google Inc. On 2011/01/24 19:23:09, fbarchard ...
9 years, 11 months ago (2011-01-24 19:43:37 UTC) #4
fbarchard
http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc File core/cross/cairo/texture_cairo.cc (right): http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc#newcode178 core/cross/cairo/texture_cairo.cc:178: dst_pixel |= (((src_pixel >> 16) & 0xFF) * alpha ...
9 years, 11 months ago (2011-01-24 19:56:19 UTC) #5
Tim H
http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc File core/cross/cairo/texture_cairo.cc (right): http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc#newcode165 core/cross/cairo/texture_cairo.cc:165: for (unsigned i = 0; i < src_height; ++i) ...
9 years, 11 months ago (2011-01-24 19:57:55 UTC) #6
Tristan Schmelcher 2
http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc File core/cross/cairo/texture_cairo.cc (right): http://codereview.chromium.org/6309007/diff/1/core/cross/cairo/texture_cairo.cc#newcode165 core/cross/cairo/texture_cairo.cc:165: for (unsigned i = 0; i < src_height; ++i) ...
9 years, 11 months ago (2011-01-24 20:25:28 UTC) #7
Tristan Schmelcher 2
I've changed it to use byte logic now. The source code and assembly are both ...
9 years, 11 months ago (2011-01-25 22:51:28 UTC) #8
fbarchard
FYI an efficient implementation would look something like this movd xmm0,[esi] punpcklbw xmm1,xmm0 movdqa xmm2,xmm1 ...
9 years, 11 months ago (2011-01-25 23:19:22 UTC) #9
Tristan Schmelcher 2
On 2011/01/25 23:19:22, fbarchard wrote: > FYI an efficient implementation would look something like this ...
9 years, 11 months ago (2011-01-25 23:25:30 UTC) #10
fbarchard
LGTM with nit about comment and some grumbling about efficiency FYI the formula can be ...
9 years, 11 months ago (2011-01-26 00:32:48 UTC) #11
Tristan Schmelcher 2
9 years, 11 months ago (2011-01-26 01:12:01 UTC) #12
http://codereview.chromium.org/6309007/diff/15001/core/cross/cairo/texture_ca...
File core/cross/cairo/texture_cairo.cc (right):

http://codereview.chromium.org/6309007/diff/15001/core/cross/cairo/texture_ca...
core/cross/cairo/texture_cairo.cc:167: // NOTE: This assumes a little-endian
anchitecture (e.g., x86).
On 2011/01/26 00:32:48, fbarchard wrote:
> This works for RGBA or BGRA where alpha is in byte 3

Done.

Powered by Google App Engine
This is Rietveld 408576698