From 67e78c9e47c38a51816412a24a10f4fe2db142a3 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 17 Oct 2012 13:36:14 +0000 Subject: Use GrCustomStage to implement color matrix. R=robertphillips@google.com Review URL: https://codereview.appspot.com/6716044 git-svn-id: http://skia.googlecode.com/svn/trunk@5975 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/effects/SkColorMatrix.h | 6 ++++++ include/effects/SkColorMatrixFilter.h | 3 +++ 2 files changed, 9 insertions(+) (limited to 'include/effects') diff --git a/include/effects/SkColorMatrix.h b/include/effects/SkColorMatrix.h index ff02d9ddc7..84a3b7c497 100644 --- a/include/effects/SkColorMatrix.h +++ b/include/effects/SkColorMatrix.h @@ -39,6 +39,12 @@ public: void setSaturation(SkScalar sat); void setRGB2YUV(); void setYUV2RGB(); + + bool operator==(const SkColorMatrix& other) const { + return 0 == memcmp(fMat, other.fMat, sizeof(fMat)); + } + + bool operator!=(const SkColorMatrix& other) const { return !((*this) == other); } }; #endif diff --git a/include/effects/SkColorMatrixFilter.h b/include/effects/SkColorMatrixFilter.h index 005781f084..08eef5de88 100644 --- a/include/effects/SkColorMatrixFilter.h +++ b/include/effects/SkColorMatrixFilter.h @@ -21,6 +21,9 @@ public: virtual void filterSpan16(const uint16_t src[], int count, uint16_t[]) SK_OVERRIDE; virtual uint32_t getFlags() SK_OVERRIDE; virtual bool asColorMatrix(SkScalar matrix[20]) SK_OVERRIDE; +#if SK_SUPPORT_GPU + virtual GrCustomStage* asNewCustomStage(GrContext*) const SK_OVERRIDE; +#endif struct State { int32_t fArray[20]; -- cgit v1.2.3