1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/effects/SkLerpXfermode.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +/* 1.5 + * Copyright 2013 Google Inc. 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license that can be 1.8 + * found in the LICENSE file. 1.9 + */ 1.10 + 1.11 +#ifndef SkLerpXfermode_DEFINED 1.12 +#define SkLerpXfermode_DEFINED 1.13 + 1.14 +#include "SkXfermode.h" 1.15 + 1.16 +class SK_API SkLerpXfermode : public SkXfermode { 1.17 +public: 1.18 + /** 1.19 + * result = scale * src + (1 - scale) * dst 1.20 + * 1.21 + * When scale == 1, this is the same as kSrc_Mode 1.22 + * When scale == 0, this is the same as kDst_Mode 1.23 + */ 1.24 + static SkXfermode* Create(SkScalar scale); 1.25 + 1.26 + // overrides from SkXfermode 1.27 + virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count, 1.28 + const SkAlpha aa[]) const SK_OVERRIDE; 1.29 + virtual void xfer16(uint16_t dst[], const SkPMColor src[], int count, 1.30 + const SkAlpha aa[]) const SK_OVERRIDE; 1.31 + virtual void xferA8(SkAlpha dst[], const SkPMColor src[], int count, 1.32 + const SkAlpha aa[]) const SK_OVERRIDE; 1.33 + 1.34 + SK_TO_STRING_OVERRIDE() 1.35 + SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLerpXfermode) 1.36 + 1.37 +protected: 1.38 + SkLerpXfermode(SkReadBuffer&); 1.39 + virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 1.40 + 1.41 +private: 1.42 + SkLerpXfermode(unsigned scale256); 1.43 + 1.44 + unsigned fScale256; // 0..256 1.45 + 1.46 + typedef SkXfermode INHERITED; 1.47 +}; 1.48 + 1.49 +#endif