diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkColorFilter.h | 17 | ||||
-rw-r--r-- | include/effects/SkColorCubeFilter.h | 2 | ||||
-rw-r--r-- | include/effects/SkColorMatrixFilter.h | 2 | ||||
-rw-r--r-- | include/effects/SkLumaColorFilter.h | 2 | ||||
-rw-r--r-- | include/effects/SkModeColorFilter.h | 2 |
5 files changed, 16 insertions, 9 deletions
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h index 31a4365a3c..14d33069f0 100644 --- a/include/core/SkColorFilter.h +++ b/include/core/SkColorFilter.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * @@ -6,12 +5,12 @@ * found in the LICENSE file. */ - #ifndef SkColorFilter_DEFINED #define SkColorFilter_DEFINED #include "SkColor.h" #include "SkFlattenable.h" +#include "SkTDArray.h" #include "SkXfermode.h" class SkBitmap; @@ -138,10 +137,18 @@ public: */ static SkColorFilter* CreateComposeFilter(SkColorFilter* outer, SkColorFilter* inner); - /** A subclass may implement this factory function to work with the GPU backend. If the return - is non-NULL then the caller owns a ref on the returned object. + /** + * A subclass may implement this factory function to work with the GPU backend. + * If it returns true, then 1 or more fragment processors will have been appended to the + * array, each of which has been ref'd, so that the caller is responsible for calling unref() + * on them when they are finished. If more than one processor is appended, they will be + * applied in FIFO order. + * + * If the subclass returns false, then it should not modify the array at all. */ - virtual GrFragmentProcessor* asFragmentProcessor(GrContext*) const; + virtual bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*>*) const { + return false; + } SK_TO_STRING_PUREVIRT() diff --git a/include/effects/SkColorCubeFilter.h b/include/effects/SkColorCubeFilter.h index 1d4d0fd17d..4500a0c292 100644 --- a/include/effects/SkColorCubeFilter.h +++ b/include/effects/SkColorCubeFilter.h @@ -25,7 +25,7 @@ public: uint32_t getFlags() const SK_OVERRIDE; #if SK_SUPPORT_GPU - GrFragmentProcessor* asFragmentProcessor(GrContext*) const SK_OVERRIDE; + bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*>*) const SK_OVERRIDE; #endif SK_TO_STRING_OVERRIDE() diff --git a/include/effects/SkColorMatrixFilter.h b/include/effects/SkColorMatrixFilter.h index ff806072a2..58f37ffe4b 100644 --- a/include/effects/SkColorMatrixFilter.h +++ b/include/effects/SkColorMatrixFilter.h @@ -28,7 +28,7 @@ public: SkColorFilter* newComposed(const SkColorFilter*) const SK_OVERRIDE; #if SK_SUPPORT_GPU - GrFragmentProcessor* asFragmentProcessor(GrContext*) const SK_OVERRIDE; + bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*>*) const SK_OVERRIDE; #endif struct State { diff --git a/include/effects/SkLumaColorFilter.h b/include/effects/SkLumaColorFilter.h index c7bb2db8bc..c970e8c115 100644 --- a/include/effects/SkLumaColorFilter.h +++ b/include/effects/SkLumaColorFilter.h @@ -28,7 +28,7 @@ public: void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const SK_OVERRIDE; #if SK_SUPPORT_GPU - GrFragmentProcessor* asFragmentProcessor(GrContext*) const SK_OVERRIDE; + bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*>*) const SK_OVERRIDE; #endif SK_TO_STRING_OVERRIDE() diff --git a/include/effects/SkModeColorFilter.h b/include/effects/SkModeColorFilter.h index 16c6e13359..4bb7a43db4 100644 --- a/include/effects/SkModeColorFilter.h +++ b/include/effects/SkModeColorFilter.h @@ -40,7 +40,7 @@ public: #endif #if SK_SUPPORT_GPU - GrFragmentProcessor* asFragmentProcessor(GrContext*) const SK_OVERRIDE; + bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*>*) const SK_OVERRIDE; #endif SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkModeColorFilter) |