From 94c34c9934bf93fc68d0ab0bb0c6696ce71b6441 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 12 Apr 2017 15:17:14 -0400 Subject: No gradient to draw if clip is empty If a clip with bounds (0, 0, 0, 0) is used to specify the limits of a gradient, the clipping rectangle will be degenerate. Leave the clip empty in this case. R=dsinclair@chromium.org Bug: 705736 Change-Id: I4a5845459c1527f2c643563d6bef4d6dcc6781d3 Reviewed-on: https://pdfium-review.googlesource.com/4071 Reviewed-by: dsinclair Commit-Queue: Cary Clark --- core/fxge/skia/fx_skia_device.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index eacfd69c93..5f117cb4d6 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -522,7 +522,9 @@ void ClipAngledGradient(const SkPoint pts[2], } } ASSERT(minBounds >= 0); - ASSERT(maxBounds != minBounds && maxBounds >= 0); + ASSERT(maxBounds >= 0); + if (minBounds == maxBounds) + return; // construct a clip parallel to the gradient that goes through // rectPts[minBounds] and rectPts[maxBounds] and perpendicular to the // gradient that goes through startEdgePt, endEdgePt. -- cgit v1.2.3