michael@0: /* michael@0: * Copyright 2007 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef SkPixelXorXfermode_DEFINED michael@0: #define SkPixelXorXfermode_DEFINED michael@0: michael@0: #include "SkXfermode.h" michael@0: michael@0: /** SkPixelXorXfermode implements a simple pixel xor (op ^ src ^ dst). michael@0: This transformation does not follow premultiplied conventions, therefore michael@0: this proc *always* returns an opaque color (alpha == 255). Thus it is michael@0: not really usefull for operating on blended colors. michael@0: */ michael@0: class SK_API SkPixelXorXfermode : public SkXfermode { michael@0: public: michael@0: static SkPixelXorXfermode* Create(SkColor opColor) { michael@0: return SkNEW_ARGS(SkPixelXorXfermode, (opColor)); michael@0: } michael@0: michael@0: SK_TO_STRING_OVERRIDE() michael@0: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPixelXorXfermode) michael@0: michael@0: protected: michael@0: SkPixelXorXfermode(SkReadBuffer& rb); michael@0: virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; michael@0: michael@0: // override from SkXfermode michael@0: virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const; michael@0: michael@0: #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS michael@0: public: michael@0: #endif michael@0: SkPixelXorXfermode(SkColor opColor) : fOpColor(opColor) {} michael@0: michael@0: private: michael@0: SkColor fOpColor; michael@0: michael@0: typedef SkXfermode INHERITED; michael@0: }; michael@0: michael@0: #endif