Bug 960017 - Make the surfaces big enough. r=Bas
authorMarkus Stange <mstange@themasta.com>
Thu, 13 Feb 2014 12:09:11 +0100
changeset 168572 0fce0bb33afbe84f7f7f1c07baf2092f65c07d5d
parent 168571 9e44f7c6661a483461aac3f3d1809a7358553b1a
child 168573 32dbaf8222136b462caa345740cc2f5a9a1530af
push id26210
push userkwierso@gmail.com
push dateFri, 14 Feb 2014 00:52:58 +0000
treeherdermozilla-central@0f18070eb5d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs960017
milestone30.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 960017 - Make the surfaces big enough. r=Bas
gfx/2d/FilterNodeSoftware.cpp
--- a/gfx/2d/FilterNodeSoftware.cpp
+++ b/gfx/2d/FilterNodeSoftware.cpp
@@ -2255,16 +2255,21 @@ FilterNodeConvolveMatrixSoftware::DoRend
   if (mKernelSize.width <= 0 || mKernelSize.height <= 0 ||
       mKernelMatrix.size() != uint32_t(mKernelSize.width * mKernelSize.height) ||
       !IntRect(IntPoint(0, 0), mKernelSize).Contains(mTarget) ||
       mDivisor == 0) {
     return Factory::CreateDataSourceSurface(aRect.Size(), SurfaceFormat::B8G8R8A8);
   }
 
   IntRect srcRect = InflatedSourceRect(aRect);
+
+  // Inflate the source rect by another pixel because the bilinear filtering in
+  // ColorComponentAtPoint may want to access the margins.
+  srcRect.Inflate(1);
+
   RefPtr<DataSourceSurface> input =
     GetInputDataSourceSurface(IN_CONVOLVE_MATRIX_IN, srcRect, NEED_COLOR_CHANNELS, mEdgeMode, &mSourceRect);
 
   if (!input) {
     return nullptr;
   }
 
   DebugOnlyAutoColorSamplingAccessControl accessControl(input);
@@ -3255,16 +3260,21 @@ TemporaryRef<DataSourceSurface>
 FilterNodeLightingSoftware<LightType, LightingType>::DoRender(const IntRect& aRect,
                                                               CoordType aKernelUnitLengthX,
                                                               CoordType aKernelUnitLengthY)
 {
   IntRect srcRect = aRect;
   IntSize size = aRect.Size();
   srcRect.Inflate(ceil(float(aKernelUnitLengthX)),
                   ceil(float(aKernelUnitLengthY)));
+
+  // Inflate the source rect by another pixel because the bilinear filtering in
+  // ColorComponentAtPoint may want to access the margins.
+  srcRect.Inflate(1);
+
   RefPtr<DataSourceSurface> input =
     GetInputDataSourceSurface(IN_LIGHTING_IN, srcRect, CAN_HANDLE_A8,
                               EDGE_MODE_DUPLICATE);
 
   if (!input) {
     return nullptr;
   }