Chromium Code Reviews| Index: Source/platform/graphics/skia/OpaqueRegionSkia.cpp |
| diff --git a/Source/platform/graphics/skia/OpaqueRegionSkia.cpp b/Source/platform/graphics/skia/OpaqueRegionSkia.cpp |
| index 24c0369d2ee641c597367d4f4541d6d0d6364fa1..58ca5303f433851a299b64028bd6e9fbc4e1dcdb 100644 |
| --- a/Source/platform/graphics/skia/OpaqueRegionSkia.cpp |
| +++ b/Source/platform/graphics/skia/OpaqueRegionSkia.cpp |
| @@ -156,8 +156,10 @@ static inline bool paintIsOpaque(const SkPaint& paint, OpaqueRegionSkia::DrawTyp |
| 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)) |
| @@ -331,7 +333,7 @@ void OpaqueRegionSkia::applyOpaqueRegionFromLayer(const GraphicsContext* context |
| SkRect deviceClipRect; |
| bool deviceClipIsARect = getDeviceClipAsRect(context, deviceClipRect); |
| - if (deviceClipRect.isEmpty()) |
| + if (deviceClipIsARect && deviceClipRect.isEmpty()) |
| return; |
| SkRect sourceOpaqueRect = layerOpaqueRect; |
| @@ -339,11 +341,14 @@ void OpaqueRegionSkia::applyOpaqueRegionFromLayer(const GraphicsContext* context |
| SkRect destinationOpaqueRect = currentTrackingOpaqueRect(); |
| bool outsideSourceOpaqueRectPreservesOpaque = xfermodePreservesOpaque(paint, false); |
| - if (!outsideSourceOpaqueRectPreservesOpaque) |
| + if (!outsideSourceOpaqueRectPreservesOpaque) { |
| + if (!deviceClipIsARect) { |
| + markAllAsNonOpaque(); |
| + return; |
| + } |
| markRectAsNonOpaque(deviceClipRect); |
| + } |
| - if (!deviceClipIsARect) |
|
danakj
2014/07/30 13:31:26
We've lost this early out in some cases now. Can y
sohanjg
2014/07/31 15:44:34
Done.
|
| - return; |
| if (!sourceOpaqueRect.intersect(deviceClipRect)) |
| return; |