@@ -266,10 +266,10 @@ static void _dropShadowFilter(uint32_t* dst, uint32_t* src, int stride, int w, i
266
266
}
267
267
268
268
269
- static void _dropShadowShift (uint32_t * dst, uint32_t * src, int stride , SwBBox& region, SwPoint& offset, uint8_t opacity, bool direct)
269
+ static void _dropShadowShift (uint32_t * dst, uint32_t * src, int dstride, int sstride , SwBBox& region, SwPoint& offset, uint8_t opacity, bool direct)
270
270
{
271
- src += (region.min .y * stride + region.min .x );
272
- dst += (region.min .y * stride + region.min .x );
271
+ src += (region.min .y * sstride + region.min .x );
272
+ dst += (region.min .y * dstride + region.min .x );
273
273
274
274
auto w = region.max .x - region.min .x ;
275
275
auto h = region.max .y - region.min .y ;
@@ -279,14 +279,14 @@ static void _dropShadowShift(uint32_t* dst, uint32_t* src, int stride, SwBBox& r
279
279
if (region.min .x + offset.x < 0 ) src -= offset.x ;
280
280
else dst += offset.x ;
281
281
282
- if (region.min .y + offset.y < 0 ) src -= (offset.y * stride );
283
- else dst += (offset.y * stride );
282
+ if (region.min .y + offset.y < 0 ) src -= (offset.y * sstride );
283
+ else dst += (offset.y * dstride );
284
284
285
285
for (auto y = 0 ; y < h; ++y) {
286
286
if (translucent) rasterTranslucentPixel32 (dst, src, w, opacity);
287
287
else rasterPixel32 (dst, src, w, opacity);
288
- src += stride ;
289
- dst += stride ;
288
+ src += sstride ;
289
+ dst += dstride ;
290
290
}
291
291
}
292
292
@@ -389,14 +389,14 @@ bool effectDropShadow(SwCompositor* cmp, SwSurface* surface[2], const RenderEffe
389
389
390
390
// draw to the main surface directly
391
391
if (direct) {
392
- _dropShadowShift (cmp->recoverSfc ->buf32 , cmp->image .buf32 , stride, bbox, data->offset , opacity, direct);
392
+ _dropShadowShift (cmp->recoverSfc ->buf32 , cmp->image .buf32 , cmp-> recoverSfc -> stride , stride, bbox, data->offset , opacity, direct);
393
393
std::swap (cmp->image .buf32 , buffer[0 ]->buf32 );
394
394
return true ;
395
395
}
396
396
397
397
// draw to the intermediate surface
398
398
rasterClear (surface[1 ], bbox.min .x , bbox.min .y , w, h);
399
- _dropShadowShift (buffer[1 ]->buf32 , cmp->image .buf32 , stride, bbox, data->offset , opacity, direct);
399
+ _dropShadowShift (buffer[1 ]->buf32 , cmp->image .buf32 , stride, stride, bbox, data->offset , opacity, direct);
400
400
std::swap (cmp->image .buf32 , buffer[1 ]->buf32 );
401
401
402
402
// compositing shadow and body
0 commit comments