michael@0: /* michael@0: * Copyright 2013 Google Inc. 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 SkLerpXfermode_DEFINED michael@0: #define SkLerpXfermode_DEFINED michael@0: michael@0: #include "SkXfermode.h" michael@0: michael@0: class SK_API SkLerpXfermode : public SkXfermode { michael@0: public: michael@0: /** michael@0: * result = scale * src + (1 - scale) * dst michael@0: * michael@0: * When scale == 1, this is the same as kSrc_Mode michael@0: * When scale == 0, this is the same as kDst_Mode michael@0: */ michael@0: static SkXfermode* Create(SkScalar scale); michael@0: michael@0: // overrides from SkXfermode michael@0: virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count, michael@0: const SkAlpha aa[]) const SK_OVERRIDE; michael@0: virtual void xfer16(uint16_t dst[], const SkPMColor src[], int count, michael@0: const SkAlpha aa[]) const SK_OVERRIDE; michael@0: virtual void xferA8(SkAlpha dst[], const SkPMColor src[], int count, michael@0: const SkAlpha aa[]) const SK_OVERRIDE; michael@0: michael@0: SK_TO_STRING_OVERRIDE() michael@0: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLerpXfermode) michael@0: michael@0: protected: michael@0: SkLerpXfermode(SkReadBuffer&); michael@0: virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; michael@0: michael@0: private: michael@0: SkLerpXfermode(unsigned scale256); michael@0: michael@0: unsigned fScale256; // 0..256 michael@0: michael@0: typedef SkXfermode INHERITED; michael@0: }; michael@0: michael@0: #endif