Commit ec10a180 authored by Jeff Muizelaar's avatar Jeff Muizelaar
Browse files

Bug 891650 - Use mTransform instead of GetDTTransform() in Mask(). r=bas, a=bajaj

GetDTTransform includes the device offset. We need to avoid that in order for things to work properly.
parent 4e8aa45a
Loading
Loading
Loading
Loading
+2 −2
Changes for gfx/thebes/gfxContext.cpp: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1427,10 +1427,10 @@ gfxContext::Mask(gfxPattern *pattern)
      if (pattern->IsAzure() || pattern->GetType() == gfxPattern::PATTERN_SURFACE) {
        RefPtr<SourceSurface> mask = pattern->GetAzureSurface();
        Matrix mat = ToMatrix(pattern->GetInverseMatrix());
        Matrix old = GetDTTransform();
        Matrix old = mTransform;
        // add in the inverse of the pattern transform so that when we
        // MaskSurface we are transformed to the place matching the pattern transform
        mat = mat * GetDTTransform();
        mat = mat * mTransform;

        ChangeTransform(mat);
        mDT->MaskSurface(GeneralPattern(this), mask, offset, DrawOptions(1.0f, CurrentState().op, CurrentState().aaMode));
+31 −0
Changes for layout/reftests/svg/mask-img-ref.html: 31 added lines, 0 removed lines.
Original line number Diff line number Diff line
<!DOCTYPE html>
<html>
  <body style="margin:0">
    <img src='data:image/svg+xml,
<!-- vim: set expandtab ts=2 sw=2 tw=80: -->
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  viewBox="0 0 700 130">
  <defs>
    <style type="text/css">
    .fillSpan  {
      fill: lightgrey;
      stroke: black;
    }
    </style>
    <!-- Fade out effect -->
    <mask id="fadeout" maskContentUnits="objectBoundingBox">
      <rect x="-0.05" y="-0.05" width="1.1" height="1.1"
        fill="url(%23fadeoutGrad)"/>
    </mask>
    <linearGradient id="fadeoutGrad">
      <stop offset="0" stop-color="white" stop-opacity="1"/>
      <stop offset="0.35" stop-color="white" stop-opacity="1"/>
      <stop offset="0.9" stop-color="white" stop-opacity="0"/>
    </linearGradient>
  </defs>
  <rect y="50" width="150" height="80" class="fillSpan" mask="url(%23fadeout)"/>
</svg>
    ' border=0 width="700">
  </body>
</html>
+32 −0
Changes for layout/reftests/svg/mask-img.html: 32 added lines, 0 removed lines.
Original line number Diff line number Diff line
<!DOCTYPE html>
<html>
  <body style="margin:0">
    <div style="height:50px"></div>
    <img border=0 src='data:image/svg+xml,
<!-- vim: set expandtab ts=2 sw=2 tw=80: -->
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  viewBox="0 0 700 80">
  <defs>
    <style type="text/css">
    .fillSpan  {
      fill: lightgrey;
      stroke: black;
    }
    </style>
    <!-- Fade out effect -->
    <mask id="fadeout" maskContentUnits="objectBoundingBox">
      <rect x="-0.05" y="-0.05" width="1.1" height="1.1"
        fill="url(%23fadeoutGrad)"/>
    </mask>
    <linearGradient id="fadeoutGrad">
      <stop offset="0" stop-color="white" stop-opacity="1"/>
      <stop offset="0.35" stop-color="white" stop-opacity="1"/>
      <stop offset="0.9" stop-color="white" stop-opacity="0"/>
    </linearGradient>
  </defs>
  <rect width="150" height="80" class="fillSpan" mask="url(%23fadeout)"/>
</svg>
    ' width="700">
  </body>
</html>
+1 −0
Changes for layout/reftests/svg/reftest.list: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -364,3 +364,4 @@ skip-if(B2G) == tspan-xy-anchor-end-01.svg tspan-xy-anchor-end-ref.svg # bug 773
== svg-effects-area-zoomed-in.xhtml svg-effects-area-zoomed-in-ref.xhtml
== svg-effects-area-zoomed-out.xhtml svg-effects-area-zoomed-out-ref.xhtml
== href-attr-change-restyles.svg href-attr-change-restyles-ref.svg
== mask-img.html mask-img-ref.html