Bug 960017 - Make the surfaces big enough. r=Bas, a=sledru
authorMarkus Stange <mstange@themasta.com>
Thu, 13 Feb 2014 12:09:11 +0100
changeset 182878 ce65f2f4ee883118af1a322e7ad389351a6d14b1
parent 182877 f9e624cc108005c9c971f030104320d957ef7ac2
child 182879 6598ee39036bb80eefb687853f3058fa195af1a2
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas, sledru
bugs960017
milestone29.0a2
Bug 960017 - Make the surfaces big enough. r=Bas, a=sledru
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;
   }