Commit 605964d9 authored by Lee Salzman's avatar Lee Salzman
Browse files

Bug 1825293 - Treat alpha textures as luminance for bitmap data. r=aosmond

For cases where bitmaps are compressed down to alpha textures, the underlying
assumption is that these were supposed to be treated as luminance data as well
in the shader, or rather, the alpha represents both the opacity and intensity.
We weren't properly swizzling in the shader to accomplish this. This fixes that.

Differential Revision: https://phabricator.services.mozilla.com/D176986
parent 2f2f3fd7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2306,8 +2306,7 @@ bool DrawTargetWebgl::SharedContext::DrawRectAccel(
                        : aMaskColor.valueOr(DeviceColor(1, 1, 1, 1)),
                    aOptions.mAlpha);
      float colorData[4] = {color.b, color.g, color.r, color.a};
      float swizzleData =
          aMaskColor && format == SurfaceFormat::A8 ? 1.0f : 0.0f;
      float swizzleData = format == SurfaceFormat::A8 ? 1.0f : 0.0f;
      Matrix xform(aRect.width, 0.0f, 0.0f, aRect.height, aRect.x, aRect.y);
      if (aTransformed) {
        xform *= currentTransform;