Add GPU support for axis-aligned ovals:
- Add drawOval base function to SkDevice, and override in SkGpuDevice
- Move isSimilarityMatrix to SkMatrix (renamed to isSimilarity) and fixed up unit test
- Since both SkGpuDevice::drawOval() and GrContext::drawPath() can try to draw ovals, added GrContext::canDrawOval() and GrContext::internalDrawOval() to avoid duplicate code
- Hooked in axis-aligned oval fill shader
- Enabled GPU stroked circles
- Added stroked circle bench test
Review URL: https://codereview.appspot.com/7137050
git-svn-id: http://skia.googlecode.com/svn/trunk@7304 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 33be2f6..5c32f76 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -226,6 +226,8 @@
const SkPoint[], const SkPaint& paint);
virtual void drawRect(const SkDraw&, const SkRect& r,
const SkPaint& paint);
+ virtual void drawOval(const SkDraw&, const SkRect& oval,
+ const SkPaint& paint);
/**
* If pathIsMutable, then the implementation is allowed to cast path to a
* non-const pointer and modify it in place (as an optimization). Canvas
diff --git a/include/core/SkDrawFilter.h b/include/core/SkDrawFilter.h
index 3944257..6a50ca7 100644
--- a/include/core/SkDrawFilter.h
+++ b/include/core/SkDrawFilter.h
@@ -31,6 +31,7 @@
kLine_Type,
kBitmap_Type,
kRect_Type,
+ kOval_Type,
kPath_Type,
kText_Type,
};
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index f9b72d7..87599d4 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -85,6 +85,11 @@
kPerspective_Mask);
}
+ /** Returns true if the matrix contains only translation, rotation or uniform scale
+ Returns false if other transformation types are included or is degenerate
+ */
+ bool isSimilarity(SkScalar tol = SK_ScalarNearlyZero) const;
+
enum {
kMScaleX,
kMSkewX,