aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-03-24 05:18:09 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-24 05:18:09 -0700
commit92b47c49016749249ff8521e424c4373b4a74241 (patch)
tree610773be56816c44489f9736875195066309e211 /include
parentb67eb2f9b9ec097aa963245a85be13daec09d2cc (diff)
Revert of remove colorfilter native-565 support. complicating w/ no real value. (patchset #2 id:20001 of https://codereview.chromium.org/1015533011/)
Reason for revert: skia/ext/benchmarking_canvas.cc references HasFilter16 :( Original issue's description: > remove colorfilter native-565 support. complicating w/ no real value. > > BUG=skia: > TBR= > > Committed: https://skia.googlesource.com/skia/+/2151353d161fe389cdc0db62cfe1932c7680f710 TBR=reed@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1022673007
Diffstat (limited to 'include')
-rw-r--r--include/core/SkColorFilter.h22
-rw-r--r--include/effects/SkColorMatrixFilter.h2
-rw-r--r--include/effects/SkModeColorFilter.h2
3 files changed, 23 insertions, 3 deletions
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index ea314811ba..fe151a2533 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -68,15 +68,31 @@ public:
@param count the number of entries in the src[] and result[] arrays
@param result written by the filter
*/
- virtual void filterSpan(const SkPMColor src[], int count, SkPMColor result[]) const = 0;
+ virtual void filterSpan(const SkPMColor src[], int count,
+ SkPMColor result[]) const = 0;
+ /** Called with a scanline of colors, as if there was a shader installed.
+ The implementation writes out its filtered version into result[].
+ Note: shader and result may be the same buffer.
+ @param src array of colors, possibly generated by a shader
+ @param count the number of entries in the src[] and result[] arrays
+ @param result written by the filter
+ */
+ virtual void filterSpan16(const uint16_t shader[], int count,
+ uint16_t result[]) const;
enum Flags {
- /** If set the filter methods will not change the alpha channel of the colors.
+ /** If set the filter methods will not change the alpha channel of the
+ colors.
*/
kAlphaUnchanged_Flag = 0x01,
+ /** If set, this subclass implements filterSpan16(). If this flag is
+ set, then kAlphaUnchanged_Flag must also be set.
+ */
+ kHasFilter16_Flag = 0x02
};
- /** Returns the flags for this filter. Override in subclasses to return custom flags.
+ /** Returns the flags for this filter. Override in subclasses to return
+ custom flags.
*/
virtual uint32_t getFlags() const { return 0; }
diff --git a/include/effects/SkColorMatrixFilter.h b/include/effects/SkColorMatrixFilter.h
index 4cb24bad5d..7ec0a6f65c 100644
--- a/include/effects/SkColorMatrixFilter.h
+++ b/include/effects/SkColorMatrixFilter.h
@@ -20,7 +20,9 @@ public:
return SkNEW_ARGS(SkColorMatrixFilter, (array));
}
+ // overrides from SkColorFilter
void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const SK_OVERRIDE;
+ void filterSpan16(const uint16_t src[], int count, uint16_t[]) const SK_OVERRIDE;
uint32_t getFlags() const SK_OVERRIDE;
bool asColorMatrix(SkScalar matrix[20]) const SK_OVERRIDE;
SkColorFilter* newComposed(const SkColorFilter*) const SK_OVERRIDE;
diff --git a/include/effects/SkModeColorFilter.h b/include/effects/SkModeColorFilter.h
index 6d0d3ccaa0..4bb7a43db4 100644
--- a/include/effects/SkModeColorFilter.h
+++ b/include/effects/SkModeColorFilter.h
@@ -28,6 +28,7 @@ public:
bool asColorMode(SkColor*, SkXfermode::Mode*) const SK_OVERRIDE;
uint32_t getFlags() const SK_OVERRIDE;
void filterSpan(const SkPMColor shader[], int count, SkPMColor result[]) const SK_OVERRIDE;
+ void filterSpan16(const uint16_t shader[], int count, uint16_t result[]) const SK_OVERRIDE;
#ifndef SK_IGNORE_TO_STRING
void toString(SkString* str) const SK_OVERRIDE {
@@ -52,6 +53,7 @@ private:
// cache
SkPMColor fPMColor;
SkXfermodeProc fProc;
+ SkXfermodeProc16 fProc16;
void updateCache();