Browse Source

Pixels with a=0 should have 0 for RGB; pixels with a=255 should have rgb for RGB.

v1.x
Zach Bjornson 10 years ago
parent
commit
43c94e43bf
  1. 7
      src/CanvasRenderingContext2d.cc

7
src/CanvasRenderingContext2d.cc

@ -645,7 +645,12 @@ NAN_METHOD(Context2d::PutImageData) {
// argb // argb
// performance optimization: fully transparent/opaque pixels can be // performance optimization: fully transparent/opaque pixels can be
// processed more efficiently. // processed more efficiently.
if (a == 0 || a == 255) { if (a == 0) {
*dstRow++ = 0;
*dstRow++ = 0;
*dstRow++ = 0;
*dstRow++ = 0;
} else if (a == 255) {
*dstRow++ = b; *dstRow++ = b;
*dstRow++ = g; *dstRow++ = g;
*dstRow++ = r; *dstRow++ = r;

Loading…
Cancel
Save