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

Unified Diff: include/effects/SkLumaXfermode.h

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 | « gm/lumamode.cpp ('k') | src/effects/SkLumaXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkLumaXfermode.h
===================================================================
--- include/effects/SkLumaXfermode.h (revision 11192)
+++ include/effects/SkLumaXfermode.h (working copy)
@@ -16,7 +16,7 @@
* http://www.w3.org/TR/css-masking/#MaskValues
*
* The luminance-to-alpha function is applied before performing a standard
- * SrcIn/DstIn xfer:
+ * SrcIn/DstIn/SrcOver xfer:
*
* luma(C) = (0.2125 * C.r + 0.7154 * C.g + 0.0721 * C.b) * C.a
*
@@ -26,7 +26,7 @@
public:
/** Return an SkLumaMaskXfermode object for the specified submode.
*
- * Only kSrcIn_Mode and kDstIn_Mode are supported - for everything else,
+ * Only kSrcIn_Mode, kDstIn_Mode kSrcOver_Mode are supported - for everything else,
* the factory returns NULL.
*/
static SkXfermode* Create(SkXfermode::Mode);
@@ -47,12 +47,14 @@
SkLumaMaskXfermode(SkFlattenableReadBuffer&);
virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
-private:
SkLumaMaskXfermode(SkXfermode::Mode);
+private:
const SkXfermode::Mode fMode;
typedef SkXfermode INHERITED;
+
+ virtual SkPMColor lumaProc(const SkPMColor a, const SkPMColor b) const;
};
#endif
« no previous file with comments | « gm/lumamode.cpp ('k') | src/effects/SkLumaXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698