Chromium Code Reviews| Index: Source/platform/graphics/RegionTracker.cpp |
| diff --git a/Source/platform/graphics/RegionTracker.cpp b/Source/platform/graphics/RegionTracker.cpp |
| index 3e7a8c7eee0285a1f5569becffa92a8a47830dd1..ffa93458d626837346313e6da6950fbb38f59537 100644 |
| --- a/Source/platform/graphics/RegionTracker.cpp |
| +++ b/Source/platform/graphics/RegionTracker.cpp |
| @@ -173,8 +173,10 @@ static inline bool paintIsOpaque(const SkPaint& paint, RegionTracker::DrawType d |
| static inline bool getDeviceClipAsRect(const GraphicsContext* context, SkRect& deviceClipRect) |
| { |
| // Get the current clip in device coordinate space. |
| - if (!context->canvas()->isClipRect()) |
| + if (!context->canvas()->isClipRect()) { |
| + deviceClipRect.setEmpty(); |
| return false; |
| + } |
| SkIRect deviceClipIRect; |
| if (context->canvas()->getClipDeviceBounds(&deviceClipIRect)) |
| @@ -353,7 +355,7 @@ void RegionTracker::applyOpaqueRegionFromLayer(const GraphicsContext* context, c |
| SkRect deviceClipRect; |
| bool deviceClipIsARect = getDeviceClipAsRect(context, deviceClipRect); |
| - if (deviceClipRect.isEmpty()) |
| + if (deviceClipIsARect && deviceClipRect.isEmpty()) |
| return; |
| SkRect sourceOpaqueRect = layerOpaqueRect; |
| @@ -361,11 +363,14 @@ void RegionTracker::applyOpaqueRegionFromLayer(const GraphicsContext* context, c |
| SkRect destinationOpaqueRect = currentTrackingOpaqueRect(); |
| bool outsideSourceOpaqueRectPreservesOpaque = xfermodePreservesOpaque(paint, false); |
| - if (!outsideSourceOpaqueRectPreservesOpaque) |
| + if (!outsideSourceOpaqueRectPreservesOpaque) { |
| + if (!deviceClipIsARect) { |
| + markAllAsNonOpaque(); |
| + return; |
| + } |
| markRectAsNonOpaque(deviceClipRect); |
| + } |
| - if (!deviceClipIsARect) |
|
danakj
2014/08/05 13:54:15
What if !deviceClipIsARect but outsideSourceOpaque
sohanjg
2014/08/05 15:23:21
Done.
added a test too.
|
| - return; |
| if (!sourceOpaqueRect.intersect(deviceClipRect)) |
| return; |