[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] Fwd: [2D-Dev] Review Request: JDK-8015070: Antialiased text on translucent backgrou
From:       Torgeir Veimo <torgeir.veimo () gmail ! com>
Date:       2016-03-17 11:19:54
Message-ID: CAG5Tc=WQ1mEvw-rgb3WXYMaGujnSk49j0n=0cmobK9=G0Pe-9A () mail ! gmail ! com
[Download RAW message or body]

Hi, has this technique also been tested with the new subpixel antialiasing
font rendering on OSX, that is currently disabled by default for
translucent surfaces?

http://cr.openjdk.java.net/~bae/8023794/9/webrev.10/

On 17 March 2016 at 20:00, Prahalad Kumar Narayanan <
prahalad.kumar.narayanan@oracle.com> wrote:

> Hello Everyone on Java2D Group
>
>
>
> Good day to you.
>
>
>
> Herewith, I 'm sharing the webrev for two identical Java2D Bugs.
>
> Bug ID : JDK-8015070
>
>        Title     : Antialiased text on translucent backgrounds gets bright
> artifacts
>
>        Link      : https://bugs.openjdk.java.net/browse/JDK-8015070
>
>
>
> Bug ID : JDK-8013564 ( currently closed as duplicate )
>
>        Title     : Font rendering anti-aliasing in translucent
> BufferedImages broken
>
>        Link      : https://bugs.openjdk.java.net/browse/JDK-8013564
>
>
>
> Webrev Link :
> http://cr.openjdk.java.net/~psadhukhan/prahlad/8015070/webrev.00/
>
>
>
> Quick Summary on Bugs :
>
> ````````````````````````````````````````````````
>
> 1.  Artifacts appear on Edges of text characters when anti-aliased text is
> drawn on Translucent background
>
> 2.  The issue is reproducible on all platforms - windows, linux and mac os.
>
> 3.  Besides, the issue is reproduced with the commonly used pixel format-
> 4ByteArgb.
>
>
>
> Root Cause & Solution :
>
> ````````````````````````````````````````````````
>
> 1.  The Macro: GlyphListAABlend4ByteArgb in File: LoopMacros.h uses the
> standard blending algorithm
>
>         dstColor = [ srcColor * glyphAlpha + dstColor * (1 - glyphAlpha) ]
> / dstAlpha
>
> 2.  The above equation works only when the srcColor and dstColor are
> Opaque.
>
>
>
> 3.  When srcColor and dstColor are Translucent, their alphaComponent will
> influence the visibility of the color, and visibility of the color below.
>
> 4.  The new set of calculations for blending Translucent source and
> destination colors is given as
>
>         resAlpha = 1 - ((1 - srcAlpha) * (1 - dstAlpha))
>
>         resColor = [ srcColor * srcAlpha + dstColor * dstAlpha * (1 -
> srcAlpha) ] / resAlpha
>
> 5.  Reference text for the equation:
> https://en.wikipedia.org/wiki/Alpha_compositing
>
> 6.  With the above modification to the blending logic, the artifacts do
> not appear and issues are fixed.
>
>
>
> Jtreg & Jprt Results :
>
> ````````````````````````````````````````````````
>
> 1.  A simple test-file: AADrawStringArtifact.java has been created to be a
> part of jtreg test cases.
>
>          The test file is well commented to explain - nature of artifact
> and how the test tries to identify them.
>
>          As required, the test case fails with Jdk 7, Jdk 8 and succeeds
> with Jdk 9-internal (built with changes for the bug fix)
>
>
>
> 2.  The changes to blending logic lies within
> java.desktop/src/share/native/...
>
>          Henceforth, JPRT was used to ensure successful build across all
> supported platforms
>
>          Jprt Job Link :
> http://scaaa637.us.oracle.com//archive/2016/03/2016-03-17-072001.prahnara-linux.client
>
>          The build succeeds on all platforms.
>
>
>
> Kindly review the webrev link and provide your views and suggestions.
>
> Webrev Link :
> http://cr.openjdk.java.net/~psadhukhan/prahlad/8015070/webrev.00/
>
>
>
> If the changes look good, we could take up the changes for source checkin.
>
>
>
> Thank you for your time in review
>
> Have a good day
>
>
>
> Prahalad N.
>



-- 
-Tor



-- 
-Tor

[Attachment #3 (text/html)]

<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hi, has this technique also \
been tested with the new subpixel antialiasing font rendering on OSX, that is \
currently disabled by default for translucent surfaces?<div><br><a \
href="http://cr.openjdk.java.net/~bae/8023794/9/webrev.10/" \
target="_blank">http://cr.openjdk.java.net/~bae/8023794/9/webrev.10/</a></div></div><div \
class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On 17 March \
2016 at 20:00, Prahalad Kumar Narayanan <span dir="ltr">&lt;<a \
href="mailto:prahalad.kumar.narayanan@oracle.com" \
target="_blank">prahalad.kumar.narayanan@oracle.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div><p \
class="MsoNormal">Hello Everyone on Java2D Group<u></u><u></u></p><p \
class="MsoNormal"><u></u>  <u></u></p><p class="MsoNormal">Good day to \
you.<u></u><u></u></p><p class="MsoNormal"><u></u>  <u></u></p><p \
class="MsoNormal">Herewith, I &#39;m sharing the webrev for two identical Java2D \
Bugs.<u></u><u></u></p><p class="MsoNormal">Bug ID : JDK-8015070<u></u><u></u></p><p \
class="MsoNormal">             Title         : Antialiased text on translucent \
backgrounds gets bright artifacts<u></u><u></u></p><p class="MsoNormal">             \
Link           : <a href="https://bugs.openjdk.java.net/browse/JDK-8015070" \
target="_blank">https://bugs.openjdk.java.net/browse/JDK-8015070</a><u></u><u></u></p><p \
class="MsoNormal"><u></u>  <u></u></p><p class="MsoNormal"> Bug ID : JDK-8013564 ( \
currently closed as duplicate )<u></u><u></u></p><p class="MsoNormal">             \
Title         : Font rendering anti-aliasing in translucent BufferedImages \
broken<u></u><u></u></p><p class="MsoNormal">             Link           : <a \
href="https://bugs.openjdk.java.net/browse/JDK-8013564" \
target="_blank">https://bugs.openjdk.java.net/browse/JDK-8013564</a><u></u><u></u></p><p \
class="MsoNormal"><u></u>  <u></u></p><p class="MsoNormal">Webrev Link : <a \
href="http://cr.openjdk.java.net/~psadhukhan/prahlad/8015070/webrev.00/" \
target="_blank">http://cr.openjdk.java.net/~psadhukhan/prahlad/8015070/webrev.00/</a><u></u><u></u></p><p \
class="MsoNormal"><u></u>  <u></u></p><p class="MsoNormal">Quick Summary on Bugs \
:<u></u><u></u></p><p \
class="MsoNormal">````````````````````````````````````````````````<u></u><u></u></p><p \
class="MsoNormal">1.   Artifacts appear on Edges of text characters when anti-aliased \
text is drawn on Translucent background<u></u><u></u></p><p class="MsoNormal">2.   \
The issue is reproducible on all platforms - windows, linux and mac \
os.<u></u><u></u></p><p class="MsoNormal">3.   Besides, the issue is reproduced with \
the commonly used pixel format- 4ByteArgb.<u></u><u></u></p><p \
class="MsoNormal"><u></u>  <u></u></p><p class="MsoNormal">Root Cause &amp; Solution \
:<u></u><u></u></p><p \
class="MsoNormal">````````````````````````````````````````````````<u></u><u></u></p><p \
class="MsoNormal">1.   The Macro: GlyphListAABlend4ByteArgb in File: LoopMacros.h \
uses the standard blending algorithm<u></u><u></u></p><p class="MsoNormal">           \
dstColor = [ srcColor * glyphAlpha + dstColor * (1 - glyphAlpha) ] / \
dstAlpha<u></u><u></u></p><p class="MsoNormal">2.   The above equation works only \
when the srcColor and dstColor are Opaque.<u></u><u></u></p><p \
class="MsoNormal"><u></u>  <u></u></p><p class="MsoNormal">3.   When srcColor and \
dstColor are Translucent, their alphaComponent will influence the visibility of the \
color, and visibility of the color below.<u></u><u></u></p><p class="MsoNormal">4.   \
The new set of calculations for blending Translucent source and destination colors is \
given as<u></u><u></u></p><p class="MsoNormal">               resAlpha = 1 - ((1 - \
srcAlpha) * (1 - dstAlpha))<u></u><u></u></p><p class="MsoNormal">               \
resColor = [ srcColor * srcAlpha + dstColor * dstAlpha * (1 - srcAlpha) ] / \
resAlpha<u></u><u></u></p><p class="MsoNormal">5.   Reference text for the equation: \
<a href="https://en.wikipedia.org/wiki/Alpha_compositing" \
target="_blank">https://en.wikipedia.org/wiki/Alpha_compositing</a><u></u><u></u></p><p \
class="MsoNormal">6.   With the above modification to the blending logic, the \
artifacts do not appear and issues are fixed.<u></u><u></u></p><p \
class="MsoNormal"><u></u>  <u></u></p><p class="MsoNormal">Jtreg &amp; Jprt Results \
:<u></u><u></u></p><p \
class="MsoNormal">````````````````````````````````````````````````<u></u><u></u></p><p \
class="MsoNormal">1.   A simple test-file: AADrawStringArtifact.java has been created \
to be a part of jtreg test cases.<u></u><u></u></p><p class="MsoNormal">              \
The test file is well commented to explain - nature of artifact and how the test \
tries to identify them.<u></u><u></u></p><p class="MsoNormal">                 As \
required, the test case fails with Jdk 7, Jdk 8 and succeeds with Jdk 9-internal \
(built with changes for the bug fix)<u></u><u></u></p><p class="MsoNormal"><u></u>  \
<u></u></p><p class="MsoNormal">2.   The changes to blending logic lies within \
java.desktop/src/share/native/... <u></u><u></u></p><p class="MsoNormal">             \
Henceforth, JPRT was used to ensure successful build across all supported \
platforms<u></u><u></u></p><p class="MsoNormal">                 Jprt Job Link : <a \
href="http://scaaa637.us.oracle.com//archive/2016/03/2016-03-17-072001.prahnara-linux.client" \
target="_blank">http://scaaa637.us.oracle.com//archive/2016/03/2016-03-17-072001.prahnara-linux.client</a><u></u><u></u></p><p \
class="MsoNormal">                 The build succeeds on all \
platforms.<u></u><u></u></p><p class="MsoNormal"><u></u>  <u></u></p><p \
class="MsoNormal">Kindly review the webrev link and provide your views and \
suggestions.<u></u><u></u></p><p class="MsoNormal">Webrev Link : <a \
href="http://cr.openjdk.java.net/~psadhukhan/prahlad/8015070/webrev.00/" \
target="_blank">http://cr.openjdk.java.net/~psadhukhan/prahlad/8015070/webrev.00/</a><u></u><u></u></p><p \
class="MsoNormal"><u></u>  <u></u></p><p class="MsoNormal">If the changes look good, \
we could take up the changes for source checkin.<u></u><u></u></p><p \
class="MsoNormal"><u></u>  <u></u></p><p class="MsoNormal">Thank you for your time in \
review<u></u><u></u></p><p class="MsoNormal">Have a good day<u></u><u></u></p><p \
class="MsoNormal"><u></u>  <u></u></p><p class="MsoNormal">Prahalad \
N.<u></u><u></u></p></div></div></blockquote></div><br><br \
clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- \
<br><div>-Tor</div> </font></span></div>
</div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature">-Tor</div> </div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic