Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: include/core/SkDraw.h

Issue 50673005: Revert "Revert "speed up A8 by creating a new entry-point in SkDraw that blits the path's coverage … (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/bench.gypi ('k') | include/core/SkRect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkDraw.h
diff --git a/include/core/SkDraw.h b/include/core/SkDraw.h
index 772e11e00d7a4de2e1cca94e6a75856051835abb..91830946791823b66736e99b8000176314e045ca 100644
--- a/include/core/SkDraw.h
+++ b/include/core/SkDraw.h
@@ -43,8 +43,15 @@ public:
* affect the geometry/rasterization, then the pre matrix can just be
* pre-concated with the current matrix.
*/
- void drawPath(const SkPath& srcPath, const SkPaint&,
- const SkMatrix* prePathMatrix, bool pathIsMutable) const;
+ void drawPath(const SkPath& path, const SkPaint& paint,
+ const SkMatrix* prePathMatrix, bool pathIsMutable) const {
+ this->drawPath(path, paint, prePathMatrix, pathIsMutable, false);
+ }
+
+ void drawPath(const SkPath& path, const SkPaint& paint) const {
+ this->drawPath(path, paint, NULL, false, false);
+ }
+
void drawBitmap(const SkBitmap&, const SkMatrix&, const SkPaint&) const;
void drawSprite(const SkBitmap&, int x, int y, const SkPaint&) const;
void drawText(const char text[], size_t byteLength, SkScalar x,
@@ -65,8 +72,14 @@ public:
const uint16_t indices[], int ptCount,
const SkPaint& paint) const;
- void drawPath(const SkPath& src, const SkPaint& paint) const {
- this->drawPath(src, paint, NULL, false);
+ /**
+ * Overwrite the target with the path's coverage (i.e. its mask).
+ * Will overwrite the entire device, so it need not be zero'd first.
+ *
+ * Only device A8 is supported right now.
+ */
+ void drawPathCoverage(const SkPath& src, const SkPaint& paint) const {
+ this->drawPath(src, paint, NULL, false, true);
}
/** Helper function that creates a mask from a path and an optional maskfilter.
@@ -107,6 +120,9 @@ private:
void drawDevMask(const SkMask& mask, const SkPaint&) const;
void drawBitmapAsMask(const SkBitmap&, const SkPaint&) const;
+ void drawPath(const SkPath&, const SkPaint&, const SkMatrix* preMatrix,
+ bool pathIsMutable, bool drawCoverage) const;
+
/**
* Return the current clip bounds, in local coordinates, with slop to account
* for antialiasing or hairlines (i.e. device-bounds outset by 1, and then
« no previous file with comments | « gyp/bench.gypi ('k') | include/core/SkRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698