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 205260 c2d31eaa9ccc95ae2f99e6034f422007b9d2b0b8
parent 205259 7237499de5d9b834ebbf4614466d07bb7a924ad7
child 205261 b1fa2ac5a78006879f3988f01259780d6d8d9813
push id49118
push userbschouten@mozilla.com
push dateSun, 14 Sep 2014 21:53:14 +0000
treeherdermozilla-inbound@8e28464849fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1066676
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1066676: Make DrawTargetD2D1::DrawSurface respect the interpolation mode. r=jrmuizel
gfx/2d/DrawTargetD2D1.cpp
--- a/gfx/2d/DrawTargetD2D1.cpp
+++ b/gfx/2d/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