diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBlitter.cpp | 1 | ||||
-rw-r--r-- | src/core/SkColorFilter.cpp | 3 | ||||
-rw-r--r-- | src/core/SkFilterShader.h | 42 | ||||
-rw-r--r-- | src/effects/SkTableColorFilter.cpp | 1 |
4 files changed, 45 insertions, 2 deletions
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index 8acdeb1112..fda8d41ada 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -11,6 +11,7 @@ #include "SkAntiRun.h" #include "SkColor.h" #include "SkColorFilter.h" +#include "SkFilterShader.h" #include "SkMask.h" #include "SkMaskFilter.h" #include "SkTemplatesPriv.h" diff --git a/src/core/SkColorFilter.cpp b/src/core/SkColorFilter.cpp index 74e1db1f4c..e781350023 100644 --- a/src/core/SkColorFilter.cpp +++ b/src/core/SkColorFilter.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * @@ -6,8 +5,8 @@ * found in the LICENSE file. */ - #include "SkColorFilter.h" +#include "SkFilterShader.h" #include "SkShader.h" #include "SkUnPreMultiply.h" diff --git a/src/core/SkFilterShader.h b/src/core/SkFilterShader.h new file mode 100644 index 0000000000..f637584718 --- /dev/null +++ b/src/core/SkFilterShader.h @@ -0,0 +1,42 @@ +/* + * Copyright 2012 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkFilterShader_DEFINED +#define SkFilterShader_DEFINED + +#include "SkShader.h" + +class SkColorFilter; + +class SkFilterShader : public SkShader { +public: + SkFilterShader(SkShader* shader, SkColorFilter* filter); + virtual ~SkFilterShader(); + + // override + virtual uint32_t getFlags(); + virtual bool setContext(const SkBitmap& device, const SkPaint& paint, + const SkMatrix& matrix); + virtual void shadeSpan(int x, int y, SkPMColor result[], int count); + virtual void shadeSpan16(int x, int y, uint16_t result[], int count); + virtual void beginSession(); + virtual void endSession(); + + SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkFilterShader) + +protected: + SkFilterShader(SkFlattenableReadBuffer& ); + virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; + +private: + SkShader* fShader; + SkColorFilter* fFilter; + + typedef SkShader INHERITED; +}; + +#endif diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp index d6cbb5e2d5..769a40d27f 100644 --- a/src/effects/SkTableColorFilter.cpp +++ b/src/effects/SkTableColorFilter.cpp @@ -1,3 +1,4 @@ +#include "SkBitmap.h" #include "SkColorPriv.h" #include "SkTableColorFilter.h" #include "SkUnPreMultiply.h" |