aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkHighContrastFilter.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-26 14:59:12 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-26 20:26:20 +0000
commitde5c50268c3ff0af507c0a9b47ab58809b89867c (patch)
tree9753695ccab4221b4c171006754e1c7c22b3ae3d /src/effects/SkHighContrastFilter.cpp
parent9d7a73527a6df7d3523e93a6a1f964df08b94510 (diff)
move checkLE functionality directly onto readbuffer
Bug: skia: Change-Id: I549717f04e2e4cafc41ccbe13009805f47943d5d Reviewed-on: https://skia-review.googlesource.com/99703 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/effects/SkHighContrastFilter.cpp')
-rw-r--r--src/effects/SkHighContrastFilter.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/effects/SkHighContrastFilter.cpp b/src/effects/SkHighContrastFilter.cpp
index 69cbcd7a9c..d6299f90c4 100644
--- a/src/effects/SkHighContrastFilter.cpp
+++ b/src/effects/SkHighContrastFilter.cpp
@@ -9,7 +9,6 @@
#include "SkPM4f.h"
#include "SkArenaAlloc.h"
#include "SkRasterPipeline.h"
-#include "SkSafeRange.h"
#include "SkReadBuffer.h"
#include "SkString.h"
#include "SkWriteBuffer.h"
@@ -142,24 +141,19 @@ void SkHighContrast_Filter::flatten(SkWriteBuffer& buffer) const {
}
sk_sp<SkFlattenable> SkHighContrast_Filter::CreateProc(SkReadBuffer& buffer) {
- SkSafeRange safe;
-
SkHighContrastConfig config;
config.fGrayscale = buffer.readBool();
- config.fInvertStyle = safe.checkLE<InvertStyle>(buffer.readInt(), InvertStyle::kLast);
+ config.fInvertStyle = buffer.read32LE(InvertStyle::kLast);
config.fContrast = buffer.readScalar();
- if (!buffer.validate(safe)) {
- return nullptr;
- }
-
return SkHighContrastFilter::Make(config);
}
sk_sp<SkColorFilter> SkHighContrastFilter::Make(
const SkHighContrastConfig& config) {
- if (!config.isValid())
+ if (!config.isValid()) {
return nullptr;
+ }
return sk_make_sp<SkHighContrast_Filter>(config);
}