Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit b58fbf6

Browse files
committed
[[ GraphicsPerformance ]] Fix gcontext invalidation when drawing effect with a zero-sized clip
1 parent c1b9334 commit b58fbf6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libgraphics/src/context.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,13 @@ void MCGContextBeginWithEffects(MCGContextRef self, MCGRectangle p_shape, const
755755

756756
t_layer_clip = MCGIRectangleIntersect(t_layer_clip, t_device_shape);
757757

758+
// IM-2014-06-24: [[ GraphicsPerformance ]] If the clip is empty then don't try to create a new layer
759+
if ((t_layer_clip.left >= t_layer_clip.right) || (t_layer_clip.top >= t_layer_clip.bottom))
760+
{
761+
self -> layer -> nesting += 1;
762+
return;
763+
}
764+
758765
// Create a suitable bitmap.
759766
SkBitmap t_new_bitmap;
760767
t_new_bitmap . setConfig(SkBitmap::kARGB_8888_Config, t_layer_clip . right - t_layer_clip . left, t_layer_clip . bottom - t_layer_clip . top);

0 commit comments

Comments
 (0)