[Webkit-unassigned] [Bug 65365] New: Alpha value of 0.5 results in fully transparent pixel in ARGB1555 format

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 29 03:53:36 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=65365

           Summary: Alpha value of 0.5 results in fully transparent pixel
                    in ARGB1555 format
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Minor
          Priority: P3
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: dok at directfb.org


The following code shows a canvas with a rectangle filled using 0.5 for alpha.

The CSS Parser converts 0.5 to 127 which leads to a fully transparent pixel on ARGB1555 surfaces,
while one would expect that everything >= 0.5 would result in fully opaque pixel.

To fix this the static translation in CSSParser.cpp needs to be changed.



<html>
<head>
<title>HTML5 Test</title>

<script type="text/javascript">
  function draw() {  
    var canvas = document.getElementById("can");

    var style = canvas.style;
    style.left = 200;
    style.top = 200;

    if (canvas.getContext) {  
      var context = canvas.getContext("2d");  
      context.fillStyle = "rgb(255,0,0)";  
      context.fillRect (0,0,50,50);  
      context.fillStyle = "rgba(0,200,200,0.5)";
      //context.fillStyle = "rgb(0,200,200)";
      context.fillRect (25,25,75,75);
      context.fillStyle = "rgb(0,0,0)";
      context.fillRect (0,75,50,25);
    }  
  }
</script>

<style type="text/css">  
#can { 
  border: 1px solid white;
  position: absolute;
}
</style>


</head>
<body bgcolor="#1a1a1a" onload="draw();">
<p>
<span style="color:#a717a1; font-size:30px">
HTML5 Canvas Over Video Test
</span>
</p>
<div id="vid_div" style="border:1px solid white;width:400;height:400;" >
<video id="1" src="" width=400 height=400 controls>
</video>
</div>

<div id="d">
<canvas id="can" width="100" height="100">
</canvas>
</div>
</body>
</html>

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list