fix the visual difference of raster vs gpu -- inverse_paths
If a path has no verbs, it is empty. If a path has verbs, but both the width and height of the bounds are zero. the path is empty too. This situation happens when you add an empty rect or circle... , say a rect{x, y, width, height} = {100, 100, 0, 0}, to a path.
For 8888 config, drawPath() checked the bounds.
For gpu config, it doesn't.
BUG=skia:2176
R=reed@google.com, bsalomon@google.com, schenney@chromium.org
Author: yunchao.he@intel.com
Review URL: https://codereview.chromium.org/166023002
git-svn-id: http://skia.googlecode.com/svn/trunk@13526 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 80f17cc..d889174 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1787,7 +1787,9 @@
return;
}
}
- if (path.isEmpty()) {
+
+ const SkRect& r = path.getBounds();
+ if (r.width() <= 0 && r.height() <= 0) {
if (path.isInverseFillType()) {
this->internalDrawPaint(paint);
}