Closed GoogleCodeExporter closed 9 years ago
Original comment by magreenb...@gmail.com
on 18 May 2012 at 10:22
Revision 643 improves the cefclient transparency test by adding the ability to
view individual pixel values.
Original comment by magreenb...@gmail.com
on 23 May 2012 at 5:40
Transparent painting in WebKit works as follows:
1. GraphisContext::beginTransparencyLayer creates a new layer (bitmap) for the
transparent region.
2. Painting is done on the new layer using just RGB values.
3. GraphicsContext::endTransparencyLayer is called to paint the new layer onto
the underlying layer and apply the alpha component at the same time.
The call stack for #3 is as follows:
> libcef.dll!S32A_Blend_BlitRow32_SSE2(unsigned int * dst, const unsigned int *
src, int count, unsigned int alpha) Line 233 C++
libcef.dll!Sprite_D32_S32::blitRect(int x, int y, int width, int height) Line 48 + 0x15 bytes C++
libcef.dll!blitrect(SkBlitter * blitter, const SkIRect & r) Line 15 + 0x2e bytes C++
libcef.dll!SkScan::FillIRect(const SkIRect & r, const SkRegion * clip, SkBlitter * blitter) Line 26 + 0xd bytes C++
libcef.dll!SkScan::FillIRect(const SkIRect & r, const SkRasterClip & clip, SkBlitter * blitter) Line 77 + 0x16 bytes C++
libcef.dll!SkDraw::drawSprite(const SkBitmap & bitmap, int x, int y, const SkPaint & origPaint) Line 1248 + 0x17 bytes C++
libcef.dll!SkDevice::drawDevice(const SkDraw & draw, SkDevice * device, int x, int y, const SkPaint & paint) Line 357 C++
libcef.dll!SkCanvas::drawDevice(SkDevice * device, int x, int y, const SkPaint * paint) Line 858 + 0x4e bytes C++
libcef.dll!SkCanvas::internalRestore() Line 799 C++
libcef.dll!SkCanvas::restore() Line 769 C++
libcef.dll!WebCore::GraphicsContext::endPlatformTransparencyLayer() Line 290 + 0x21 bytes C++
libcef.dll!WebCore::GraphicsContext::endTransparencyLayer() Line 346 C++
So, in conclusion, the S32A_Blend_BlitRow32_SSE2 function intentionally applies
alpha blending to all 4 components of the RGBA value.
Original comment by magreenb...@gmail.com
on 24 May 2012 at 6:16
For example, in S32A_Blend_BlitRow32_SSE2:
alpha = 0xbf
src_pixel = 0xffffffffffffffffffffffffffffffff (new/transparent layer)
dst_pixel = 0000000000000000000000000000000000 (underlying layer)
result = 0xbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbf
Original comment by magreenb...@gmail.com
on 24 May 2012 at 6:44
Related skia issue: http://code.google.com/p/skia/issues/detail?id=547
Original comment by magreenb...@gmail.com
on 24 May 2012 at 8:58
Started a thread about this on the skia-discuss mailing list:
http://groups.google.com/group/skia-discuss/browse_thread/thread/b15e9eddda5fe02
1
Original comment by magreenb...@gmail.com
on 24 May 2012 at 9:23
good you found a lead. i suspected that it is nothing that comes from cef
itself. thanks for your dedication in this project :)
Original comment by normanhe...@fotona.de
on 24 May 2012 at 10:50
Skia writes premultpilied alpha. That's the only pixel format you're going to
get out of Chromium.
Original comment by tomhudson@google.com
on 25 May 2012 at 12:19
Revision 648 updates the cefclient example to account for premultiplied alpha
values.
Original comment by magreenb...@gmail.com
on 25 May 2012 at 2:24
Ahh, I was wondering if it was a question of blend functions. Nice clean fix.
Original comment by tomhudson@google.com
on 25 May 2012 at 2:25
The cefclient changes have been merged to all branches in revision 649.
Original comment by magreenb...@gmail.com
on 25 May 2012 at 2:35
Original issue reported on code.google.com by
normanhe...@fotona.de
on 27 Apr 2012 at 12:16Attachments: