@@ -680,6 +680,7 @@ void MCGContextBegin(MCGContextRef self, bool p_need_layer)
680680 self -> layer = t_new_layer;
681681}
682682
683+ #if 0
683684static MCGIRectangle compute_glow_clip(const MCGGlowEffect& self, const MCGIRectangle& p_shape, const MCGIRectangle& p_clip, const MCGAffineTransform& p_transform)
684685{
685686 MCGSize t_radii;
@@ -716,6 +717,7 @@ static MCGIRectangle compute_shadow_clip(const MCGShadowEffect& self, const MCGI
716717 MCGIRectangleOffset(p_clip, -ceil(t_transformed_offset . width), -ceil(t_transformed_offset . height)))),
717718 ceil(t_transformed_radii . width), ceil(t_transformed_radii . height));
718719}
720+ #endif
719721
720722// The 'shape' parameter is the rectangle in user-space of the area to which the effect
721723// is to be applied.
@@ -806,8 +808,8 @@ void MCGContextBeginWithEffects(MCGContextRef self, MCGRectangle p_shape, const
806808 }
807809
808810 // Next process outer glow.
809- // We expand the shape by the radii.
810- // We then intersect with the device clip to see what is needed .
811+ // We intersect the shape with the clip to determine visible pixels
812+ // We then expand by the radii .
811813 // We then intersect with the device shape to restrict to renderable pixels.
812814 // Finally we add this rectangle to the layer clip (union).
813815 if (p_effects . has_outer_glow)
@@ -819,11 +821,9 @@ void MCGContextBeginWithEffects(MCGContextRef self, MCGRectangle p_shape, const
819821 t_layer_clip,
820822 MCGIRectangleIntersect (
821823 t_device_shape,
822- MCGIRectangleIntersect (
823- t_device_clip,
824- MCGIRectangleExpand (
825- t_device_shape,
826- ceil (t_radii . width), ceil (t_radii . height)))));
824+ MCGIRectangleExpand (
825+ MCGIRectangleIntersect (t_device_shape, t_device_clip),
826+ ceil (t_radii . width), ceil (t_radii . height))));
827827 }
828828
829829 // Next process inner glow.
@@ -844,16 +844,7 @@ void MCGContextBeginWithEffects(MCGContextRef self, MCGRectangle p_shape, const
844844 MCGIRectangleIntersect (t_device_clip, t_device_shape),
845845 ceil (t_radii . width), ceil (t_radii . height))));
846846 }
847-
848- /* if (p_effects . has_drop_shadow)
849- t_layer_clip = MCGIRectangleUnion(t_layer_clip, compute_shadow_clip(p_effects . drop_shadow, t_device_shape, t_device_clip, t_device_transform));
850- if (p_effects . has_inner_shadow)
851- t_layer_clip = MCGIRectangleUnion(t_layer_clip, compute_shadow_clip(p_effects . inner_shadow, t_device_shape, t_device_clip, t_device_transform));
852- if (p_effects . has_outer_glow)
853- t_layer_clip = MCGIRectangleUnion(t_layer_clip, compute_glow_clip(p_effects . outer_glow, t_device_shape, t_device_clip, t_device_transform));
854- if (p_effects . has_inner_glow)
855- t_layer_clip = MCGIRectangleUnion(t_layer_clip, compute_glow_clip(p_effects . inner_glow, t_device_shape, t_device_clip, t_device_transform));*/
856-
847+
857848 t_layer_clip = MCGIRectangleIntersect (t_layer_clip, t_device_shape);
858849
859850 // Create a suitable bitmap.
@@ -1057,7 +1048,7 @@ static void MCGContextRenderEffect(MCGContextRef self, const SkMask& p_mask, MCG
10571048
10581049 // Now blur the mask.
10591050 SkMask t_blurred_mask;
1060- if (!MCGBlurBox (p_mask, t_transformed_radii . width, t_transformed_radii . height, 1.0 , t_blurred_mask))
1051+ if (!MCGBlurBox (p_mask, t_transformed_radii . width, t_transformed_radii . height, p_spread, p_spread , t_blurred_mask))
10611052 return ;
10621053
10631054 // Offset the blur mask appropriately.
@@ -1218,7 +1209,7 @@ static void MCGContextRenderEffects(MCGContextRef self, MCGContextLayerRef p_chi
12181209 t_child_mask,
12191210 MCGSizeMake (p_effects . drop_shadow . size, p_effects . drop_shadow . size),
12201211 MCGSizeMake (p_effects . drop_shadow . x_offset, p_effects . drop_shadow . y_offset),
1221- /* p_effects . outer_glow . spread*/ 0.0 ,
1212+ p_effects . drop_shadow . spread,
12221213 p_effects . drop_shadow . knockout ? kMCGBlurTypeOuter : kMCGBlurTypeNormal ,
12231214 p_effects . drop_shadow . color,
12241215 p_effects . drop_shadow . blend_mode);
@@ -1228,7 +1219,7 @@ static void MCGContextRenderEffects(MCGContextRef self, MCGContextLayerRef p_chi
12281219 t_child_mask,
12291220 MCGSizeMake (p_effects . outer_glow . size, p_effects . outer_glow . size),
12301221 MCGSizeMake (0.0 , 0.0 ),
1231- /* p_effects . outer_glow . spread*/ 0.0 ,
1222+ p_effects . outer_glow . spread,
12321223 kMCGBlurTypeNormal ,
12331224 p_effects . outer_glow . color,
12341225 p_effects . outer_glow . blend_mode);
@@ -1243,7 +1234,7 @@ static void MCGContextRenderEffects(MCGContextRef self, MCGContextLayerRef p_chi
12431234 t_child_mask,
12441235 MCGSizeMake (p_effects . inner_shadow . size, p_effects . inner_shadow . size),
12451236 MCGSizeMake (p_effects . inner_shadow . x_offset, p_effects . inner_shadow . y_offset),
1246- /* p_effects . inner_shadow . spread*/ 0.0 ,
1237+ p_effects . inner_shadow . spread,
12471238 kMCGBlurTypeInvertedInner ,
12481239 p_effects . inner_shadow . color,
12491240 p_effects . inner_shadow . blend_mode);
@@ -1253,7 +1244,7 @@ static void MCGContextRenderEffects(MCGContextRef self, MCGContextLayerRef p_chi
12531244 t_child_mask,
12541245 MCGSizeMake (p_effects . inner_glow . size, p_effects . inner_glow . size),
12551246 MCGSizeMake (0.0 , 0.0 ),
1256- /* p_effects . inner_shadow . spread*/ 0.0 ,
1247+ p_effects . inner_glow . spread,
12571248 p_effects . inner_glow . inverted ? kMCGBlurTypeInvertedInner : kMCGBlurTypeInner ,
12581249 p_effects . inner_glow . color,
12591250 p_effects . inner_glow . blend_mode);
0 commit comments