Bug 1066676: Make DrawTargetD2D1::DrawSurface respect the interpolation mode. r=jrmuizel
authorBas Schouten <bschouten@mozilla.com>
Sun, 14 Sep 2014 23:51:35 +0200
changeset 720 b100f11163b6
parent 719 d166b9e0320d
child 721 6fdd21b55fd9
push id274
push userbschouten@mozilla.com
push dateTue, 23 Sep 2014 16:10:56 +0000
reviewersjrmuizel
bugs1066676
Bug 1066676: Make DrawTargetD2D1::DrawSurface respect the interpolation mode. r=jrmuizel
DrawTargetD2D1.cpp
--- a/DrawTargetD2D1.cpp
+++ b/DrawTargetD2D1.cpp
@@ -123,17 +123,21 @@ DrawTargetD2D1::DrawSurface(SourceSurfac
   RefPtr<ID2D1ImageBrush> brush;
 
   // Here we scale the source pattern up to the size and position where we want
   // it to be.
   Matrix transform;
   transform.PreTranslate(aDest.x - aSource.x * xScale, aDest.y - aSource.y * yScale);
   transform.PreScale(xScale, yScale);
 
-  mDC->CreateImageBrush(image, D2D1::ImageBrushProperties(samplingBounds),
+  mDC->CreateImageBrush(image,
+                        D2D1::ImageBrushProperties(samplingBounds,
+                                                   D2D1_EXTEND_MODE_CLAMP,
+                                                   D2D1_EXTEND_MODE_CLAMP,
+                                                   D2DInterpolationMode(aSurfOptions.mFilter)),
                         D2D1::BrushProperties(aOptions.mAlpha, D2DMatrix(transform)),
                         byRef(brush));
   mDC->FillRectangle(D2DRect(aDest), brush);
 
   FinalizeDrawing(aOptions.mCompositionOp, ColorPattern(Color()));
 }
 
 void