From: reed@google.com Date: Fri, 1 Feb 2013 14:35:09 +0000 (+0000) Subject: revert name changes to SkBlendImageFilter. It (correctly) named its enum kMultiply_Mode, X-Git-Tag: submit/tizen/20180928.044319~13582 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba3a3c93b255639f7841b973294a938b103491f3;p=platform%2Fupstream%2FlibSkiaSharp.git revert name changes to SkBlendImageFilter. It (correctly) named its enum kMultiply_Mode, and handled that itself internally, rather than calling SkXfermode. This CL removes the kModulate_Mode alias from its list. git-svn-id: http://skia.googlecode.com/svn/trunk@7509 2bbb7eff-a529-9590-31e7-b0007b416f81 --- diff --git a/gm/blend.cpp b/gm/blend.cpp index 5b4ff987f8..452eb4945c 100644 --- a/gm/blend.cpp +++ b/gm/blend.cpp @@ -82,7 +82,7 @@ protected: SkAutoTUnref background(SkNEW_ARGS(SkBitmapSource, (fCheckerboard))); paint.setImageFilter(SkNEW_ARGS(SkBlendImageFilter, (SkBlendImageFilter::kNormal_Mode, background)))->unref(); drawClippedBitmap(canvas, paint, 0); - paint.setImageFilter(SkNEW_ARGS(SkBlendImageFilter, (SkBlendImageFilter::kModulate_Mode, background)))->unref(); + paint.setImageFilter(SkNEW_ARGS(SkBlendImageFilter, (SkBlendImageFilter::kMultiply_Mode, background)))->unref(); drawClippedBitmap(canvas, paint, 100); paint.setImageFilter(SkNEW_ARGS(SkBlendImageFilter, (SkBlendImageFilter::kScreen_Mode, background)))->unref(); drawClippedBitmap(canvas, paint, 200); diff --git a/include/effects/SkBlendImageFilter.h b/include/effects/SkBlendImageFilter.h index 2264273ed7..a2dc847494 100644 --- a/include/effects/SkBlendImageFilter.h +++ b/include/effects/SkBlendImageFilter.h @@ -15,8 +15,7 @@ class SK_API SkBlendImageFilter : public SkImageFilter { public: enum Mode { kNormal_Mode, - kModulate_Mode, // TODO: replace this with the (soon to be) SkXfermode version of kMultiply_Mode - kMultiply_Mode = kModulate_Mode, + kMultiply_Mode, kScreen_Mode, kDarken_Mode, kLighten_Mode, diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp index 46f25648fa..3f6d3c575f 100644 --- a/src/effects/SkBlendImageFilter.cpp +++ b/src/effects/SkBlendImageFilter.cpp @@ -24,7 +24,7 @@ SkXfermode::Mode modeToXfermode(SkBlendImageFilter::Mode mode) switch (mode) { case SkBlendImageFilter::kNormal_Mode: return SkXfermode::kSrcOver_Mode; - case SkBlendImageFilter::kModulate_Mode: + case SkBlendImageFilter::kMultiply_Mode: return SkXfermode::kModulate_Mode; case SkBlendImageFilter::kScreen_Mode: return SkXfermode::kScreen_Mode; @@ -100,7 +100,7 @@ bool SkBlendImageFilter::onFilterImage(Proxy* proxy, // FEBlend's multiply mode is (1 - Sa) * Da + (1 - Da) * Sc + Sc * Dc // Skia's is just Sc * Dc. So we use a custom proc to implement FEBlend's // version. - if (fMode == SkBlendImageFilter::kModulate_Mode) { + if (fMode == SkBlendImageFilter::kMultiply_Mode) { paint.setXfermode(new SkProcXfermode(multiply_proc))->unref(); } else { paint.setXfermodeMode(modeToXfermode(fMode)); @@ -283,7 +283,7 @@ void GrGLBlendEffect::emitCode(GrGLShaderBuilder* builder, case SkBlendImageFilter::kNormal_Mode: code->appendf("\t\t%s.rgb = (1.0 - %s.a) * %s.rgb + %s.rgb;\n", outputColor, fgColor, bgColor, fgColor); break; - case SkBlendImageFilter::kModulate_Mode: + case SkBlendImageFilter::kMultiply_Mode: code->appendf("\t\t%s.rgb = (1.0 - %s.a) * %s.rgb + (1.0 - %s.a) * %s.rgb + %s.rgb * %s.rgb;\n", outputColor, fgColor, bgColor, bgColor, fgColor, fgColor, bgColor); break; case SkBlendImageFilter::kScreen_Mode: