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

Unified Diff: gm/lumamode.cpp

Issue 24078006: In order to use CSS luminance masking, we need to be able to create an instance of SkLumaXfermode w… (Closed) Base URL: http://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
===================================================================
--- gm/lumamode.cpp (revision 11192)
+++ gm/lumamode.cpp (working copy)
@@ -76,6 +76,7 @@
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 @@
}
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 @@
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 @@
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