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

Unified Diff: gm/lumamode.cpp

Issue 23710053: [External patch] Source-over support for SkLumaXfermode. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | « bench/XfermodeBench.cpp ('k') | include/effects/SkLumaXfermode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/lumamode.cpp
diff --git a/gm/lumamode.cpp b/gm/lumamode.cpp
index e6aed18bb4ba046e8acb348ba46733278f0cc301..51f2e5d295cbe21efa919585c5027f9cfd90cc11 100644
--- a/gm/lumamode.cpp
+++ b/gm/lumamode.cpp
@@ -76,6 +76,7 @@ public:
LumaXfermodeGM() {
fSrcInXfer.reset(SkLumaMaskXfermode::Create(SkXfermode::kSrcIn_Mode));
fDstInXfer.reset(SkLumaMaskXfermode::Create(SkXfermode::kDstIn_Mode));
+ fSrcOverXfer.reset(SkLumaMaskXfermode::Create(SkXfermode::kSrcOver_Mode));
SkColor g1Colors[] = { kColor1, SkColorSetA(kColor1, 0x20) };
SkColor g2Colors[] = { kColor2, SkColorSetA(kColor2, 0x20) };
@@ -105,7 +106,7 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkXfermode* modes[] = { NULL, fSrcInXfer, fDstInXfer };
+ SkXfermode* modes[] = { NULL, fSrcInXfer, fDstInXfer, fSrcOverXfer };
struct {
SkShader* fShader1;
SkShader* fShader2;
@@ -120,6 +121,7 @@ protected:
draw_label(canvas, "SrcOver", SkPoint::Make(gridStep, 20));
draw_label(canvas, "SrcInLuma", SkPoint::Make(gridStep * 3, 20));
draw_label(canvas, "DstInLuma", SkPoint::Make(gridStep * 5, 20));
+ draw_label(canvas, "SrcOverLuma", SkPoint::Make(gridStep * 7, 20));
for (size_t i = 0; i < SK_ARRAY_COUNT(shaders); ++i) {
canvas->save();
canvas->translate(kInset, gridStep * i + 30);
@@ -137,7 +139,7 @@ protected:
private:
SkAutoTUnref<SkShader> fGr1, fGr2;
- SkAutoTUnref<SkXfermode> fSrcInXfer, fDstInXfer;
+ SkAutoTUnref<SkXfermode> fSrcInXfer, fDstInXfer, fSrcOverXfer;
typedef skiagm::GM INHERITED;
};
« no previous file with comments | « bench/XfermodeBench.cpp ('k') | include/effects/SkLumaXfermode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698