diff options
author | Cary Clark <caryclark@google.com> | 2017-04-12 15:17:14 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-12 19:29:46 +0000 |
commit | 94c34c9934bf93fc68d0ab0bb0c6696ce71b6441 (patch) | |
tree | 4be1f598815377a942735682fe98a7d63c0f27af | |
parent | deadbfb7874ee8627d3a27efcfb965233f0c5cd4 (diff) | |
download | pdfium-94c34c9934bf93fc68d0ab0bb0c6696ce71b6441.tar.xz |
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 <dsinclair@chromium.org>
Commit-Queue: Cary Clark <caryclark@google.com>
-rw-r--r-- | core/fxge/skia/fx_skia_device.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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. |