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

Unified Diff: src/core/SkDraw.cpp

Issue 864833002: Remove the need for asCoeff in SkXfermode. (Closed) Base URL: https://skia.googlesource.com/skia.git@moreXferCleanup
Patch Set: Fix build Created 5 years, 11 months 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 | « include/core/SkXfermode.h ('k') | src/core/SkPaintPriv.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index f69137f6b8bb003e1538a5e4c2db45e7c2a3305c..c42d3ef9ed6636e3895e426805d8e0b5ad52ba65 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -936,22 +936,6 @@ static SkScalar fast_len(const SkVector& vec) {
return x + SkScalarHalf(y);
}
-static bool xfermodeSupportsCoverageAsAlpha(SkXfermode* xfer) {
- SkXfermode::Coeff dc;
- if (!SkXfermode::AsCoeff(xfer, NULL, &dc)) {
- return false;
- }
-
- switch (dc) {
- case SkXfermode::kOne_Coeff:
- case SkXfermode::kISA_Coeff:
- case SkXfermode::kISC_Coeff:
- return true;
- default:
- return false;
- }
-}
-
bool SkDrawTreatAAStrokeAsHairline(SkScalar strokeWidth, const SkMatrix& matrix,
SkScalar* coverage) {
SkASSERT(strokeWidth > 0);
@@ -1063,7 +1047,7 @@ void SkDraw::drawPath(const SkPath& origSrcPath, const SkPaint& origPaint,
if (SkDrawTreatAsHairline(origPaint, *matrix, &coverage)) {
if (SK_Scalar1 == coverage) {
paint.writable()->setStrokeWidth(0);
- } else if (xfermodeSupportsCoverageAsAlpha(origPaint.getXfermode())) {
+ } else if (SkXfermode::SupportsCoverageAsAlpha(origPaint.getXfermode())) {
U8CPU newAlpha;
#if 0
newAlpha = SkToU8(SkScalarRoundToInt(coverage *
« no previous file with comments | « include/core/SkXfermode.h ('k') | src/core/SkPaintPriv.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698