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

Unified Diff: src/gpu/GrSWMaskHelper.cpp

Issue 57883006: Revert "speed up A8 by creating a new entry-point in SkDraw that blits the path's coverage directly… (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 | « src/gpu/GrSWMaskHelper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrSWMaskHelper.cpp
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 54fde0f98972839db20b21d7dc31c22a7946ffb1..5fb944bac4bcf20b2fc645079ea8c6a0e8ee00ae 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -73,21 +73,20 @@ void GrSWMaskHelper::draw(const SkPath& path, const SkStrokeRec& stroke, SkRegio
paint.setStrokeWidth(stroke.getWidth());
}
}
+
+ SkXfermode* mode = SkXfermode::Create(op_to_mode(op));
+
+ paint.setXfermode(mode);
paint.setAntiAlias(antiAlias);
+ paint.setColor(SkColorSetARGB(alpha, alpha, alpha, alpha));
- if (SkRegion::kReplace_Op == op && 0xFF == alpha) {
- SkASSERT(0xFF == paint.getAlpha());
- fDraw.drawPathCoverage(path, paint);
- } else {
- paint.setXfermodeMode(op_to_mode(op));
- paint.setColor(SkColorSetARGB(alpha, alpha, alpha, alpha));
- fDraw.drawPath(path, paint);
- }
+ fDraw.drawPath(path, paint);
+
+ SkSafeUnref(mode);
}
bool GrSWMaskHelper::init(const SkIRect& resultBounds,
- const SkMatrix* matrix,
- bool zeroPixels) {
+ const SkMatrix* matrix) {
if (NULL != matrix) {
fMatrix = *matrix;
} else {
@@ -104,9 +103,7 @@ bool GrSWMaskHelper::init(const SkIRect& resultBounds,
if (!fBM.allocPixels()) {
return false;
}
- if (zeroPixels) {
- sk_bzero(fBM.getPixels(), fBM.getSafeSize());
- }
+ sk_bzero(fBM.getPixels(), fBM.getSafeSize());
sk_bzero(&fDraw, sizeof(fDraw));
fRasterClip.setRect(bounds);
@@ -166,7 +163,7 @@ GrTexture* GrSWMaskHelper::DrawPathMaskToTexture(GrContext* context,
GrSWMaskHelper helper(context);
- if (!helper.init(resultBounds, matrix, false)) {
+ if (!helper.init(resultBounds, matrix)) {
return NULL;
}
« no previous file with comments | « src/gpu/GrSWMaskHelper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698