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

Unified Diff: src/effects/SkColorFilters.cpp

Issue 1574023002: move declaration of CreateLightingFilter into SkColorMatrixFilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: don't remove old impl yet 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 | « samplecode/SampleFilterFuzz.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorFilters.cpp
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 4515c0d3fefa52b398f4d312e30008184cb6b7f9..fe39dd980025c3ed4c7e39a5beb42d52b2e04646 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -14,7 +14,6 @@
#include "SkUtils.h"
#include "SkString.h"
#include "SkValidationUtils.h"
-#include "SkColorMatrixFilter.h"
bool SkModeColorFilter::asColorMode(SkColor* color, SkXfermode::Mode* mode) const {
if (color) {
@@ -169,28 +168,3 @@ SkColorFilter* SkColorFilter::CreateModeFilter(SkColor color, SkXfermode::Mode m
return SkModeColorFilter::Create(color, mode);
}
}
-
-///////////////////////////////////////////////////////////////////////////////
-
-static SkScalar byte_to_scale(U8CPU byte) {
- if (0xFF == byte) {
- // want to get this exact
- return 1;
- } else {
- return byte * 0.00392156862745f;
- }
-}
-
-SkColorFilter* SkColorFilter::CreateLightingFilter(SkColor mul, SkColor add) {
- SkColorMatrix matrix;
- matrix.setScale(byte_to_scale(SkColorGetR(mul)),
- byte_to_scale(SkColorGetG(mul)),
- byte_to_scale(SkColorGetB(mul)),
- 1);
- matrix.postTranslate(SkIntToScalar(SkColorGetR(add)),
- SkIntToScalar(SkColorGetG(add)),
- SkIntToScalar(SkColorGetB(add)),
- 0);
- return SkColorMatrixFilter::Create(matrix);
-}
-
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698