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

Unified Diff: src/core/SkCanvas.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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 | « src/core/SkBlitter_Sprite.cpp ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 7db8601846915e3ff7f2b564b3cdd5c226c365f4..cf3b5309c48ffe0cab7f0895e77c5eb572fc3af1 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -484,7 +484,7 @@ public:
*/
SkPaint tmp;
tmp.setImageFilter(fPaint->getImageFilter());
- tmp.setXfermode(sk_ref_sp(fPaint->getXfermode()));
+ tmp.setBlendMode(fPaint->getBlendMode());
SkRect storage;
if (rawBounds) {
// Make rawBounds include all paint outsets except for those due to image filters.
@@ -558,7 +558,7 @@ bool AutoDrawLooper::doNext(SkDrawFilter::Type drawType) {
if (fTempLayerForImageFilter) {
paint->setImageFilter(nullptr);
- paint->setXfermode(nullptr);
+ paint->setBlendMode(SkBlendMode::kSrcOver);
}
if (fLooperContext && !fLooperContext->next(fCanvas, paint)) {
@@ -2634,7 +2634,7 @@ void SkCanvas::DrawTextDecorations(const SkDraw& draw, const SkPaint& paint,
// nothing to draw
if (text == nullptr || byteLength == 0 ||
draw.fRC->isEmpty() ||
- (paint.getAlpha() == 0 && paint.getXfermode() == nullptr)) {
+ (paint.getAlpha() == 0 && paint.isSrcOver())) {
return;
}
@@ -2938,26 +2938,21 @@ void SkCanvas::onDrawAnnotation(const SkRect& rect, const char key[], SkData* va
// methods, rather than actually drawing themselves.
//////////////////////////////////////////////////////////////////////////////
-void SkCanvas::drawARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b,
- SkXfermode::Mode mode) {
+void SkCanvas::drawARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b, SkBlendMode mode) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawARGB()");
SkPaint paint;
paint.setARGB(a, r, g, b);
- if (SkXfermode::kSrcOver_Mode != mode) {
- paint.setXfermodeMode(mode);
- }
+ paint.setBlendMode(mode);
this->drawPaint(paint);
}
-void SkCanvas::drawColor(SkColor c, SkXfermode::Mode mode) {
+void SkCanvas::drawColor(SkColor c, SkBlendMode mode) {
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawColor()");
SkPaint paint;
paint.setColor(c);
- if (SkXfermode::kSrcOver_Mode != mode) {
- paint.setXfermodeMode(mode);
- }
+ paint.setBlendMode(mode);
this->drawPaint(paint);
}
« no previous file with comments | « src/core/SkBlitter_Sprite.cpp ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698