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
This commit is contained in:
commit-bot@chromium.org 2014-02-21 05:42:57 +00:00
parent 25c7127c90
commit 0b45dc45d6
2 changed files with 6 additions and 1 deletions

View File

@ -81,3 +81,6 @@ downsamplebitmap_text_none_72.00pt
bleed
bitmaprecttest
drawbitmapmatrix
# Added by yunchao.he@intel.com for https://codereview.chromium.org/166023002
inverse_paths

View File

@ -1787,7 +1787,9 @@ void SkCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
return;
}
}
if (path.isEmpty()) {
const SkRect& r = path.getBounds();
if (r.width() <= 0 && r.height() <= 0) {
if (path.isInverseFillType()) {
this->internalDrawPaint(paint);
}