Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: src/core/SkColorMatrixFilterRowMajor255.h

Issue 1648933002: Move SkColorMatrixFilter implementation to core. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add back newComposed override Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/effects/SkColorMatrixFilter.h ('k') | src/core/SkColorMatrixFilterRowMajor255.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorMatrixFilterRowMajor255.h
diff --git a/include/effects/SkColorMatrixFilter.h b/src/core/SkColorMatrixFilterRowMajor255.h
similarity index 51%
copy from include/effects/SkColorMatrixFilter.h
copy to src/core/SkColorMatrixFilterRowMajor255.h
index 3edf791f06bd263198f14a8d24825dc25b11c4dc..453dd41bff5d168250fb45fb9e2568db53a368e4 100644
--- a/include/effects/SkColorMatrixFilter.h
+++ b/src/core/SkColorMatrixFilterRowMajor255.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2007 The Android Open Source Project
+ * Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
@@ -9,24 +9,10 @@
#define SkColorMatrixFilter_DEFINED
#include "SkColorFilter.h"
-#include "SkColorMatrix.h"
-class SK_API SkColorMatrixFilter : public SkColorFilter {
+class SK_API SkColorMatrixFilterRowMajor255 : public SkColorFilter {
public:
- static SkColorFilter* Create(const SkColorMatrix& cm) {
- return new SkColorMatrixFilter(cm);
- }
- static SkColorFilter* Create(const SkScalar array[20]) {
- return new SkColorMatrixFilter(array);
- }
-
- /**
- * Create a colorfilter that multiplies the RGB channels by one color, and
- * then adds a second color, pinning the result for each component to
- * [0..255]. The alpha components of the mul and add arguments
- * are ignored.
- */
- static SkColorFilter* CreateLightingFilter(SkColor mul, SkColor add);
+ explicit SkColorMatrixFilterRowMajor255(const SkScalar array[20]);
void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const override;
void filterSpan4f(const SkPM4f src[], int count, SkPM4f[]) const override;
@@ -43,13 +29,11 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorMatrixFilter)
protected:
- explicit SkColorMatrixFilter(const SkColorMatrix&);
- explicit SkColorMatrixFilter(const SkScalar array[20]);
void flatten(SkWriteBuffer&) const override;
private:
- SkColorMatrix fMatrix;
- float fTranspose[SkColorMatrix::kCount]; // for Sk4s
+ SkScalar fMatrix[20];
+ float fTranspose[20]; // for Sk4s
uint32_t fFlags;
void initState(const SkScalar array[20]);
« no previous file with comments | « include/effects/SkColorMatrixFilter.h ('k') | src/core/SkColorMatrixFilterRowMajor255.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698