aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkImageFilterPriv.h
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2017-11-03 08:06:09 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-03 13:56:30 +0000
commit60aaeb2b551d5e3e90baacac315e899e26f758f1 (patch)
tree7749aef06d37c83be8776c9355468cfbccaad6c4 /src/core/SkImageFilterPriv.h
parente657dc8ce6cb17136dfd21be905b97a3957e957e (diff)
create imagepriv and name params
Named all parameters and made the names consistent for documentation. Moved SK_IMAGEFILTER_UNFLATTEN_COMMON to private file. TBR=reed@google.com Bug: skia:6898 Change-Id: I1343d2b16d4217088fa3bc9c40f1f4177fa32740 Reviewed-on: https://skia-review.googlesource.com/66521 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'src/core/SkImageFilterPriv.h')
-rw-r--r--src/core/SkImageFilterPriv.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/core/SkImageFilterPriv.h b/src/core/SkImageFilterPriv.h
new file mode 100644
index 0000000000..dff3e0c68a
--- /dev/null
+++ b/src/core/SkImageFilterPriv.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkImageFilterPriv_DEFINED
+#define SkImageFilterPriv_DEFINED
+
+#include "SkImageFilter.h"
+
+/**
+ * Helper to unflatten the common data, and return nullptr if we fail.
+ */
+#define SK_IMAGEFILTER_UNFLATTEN_COMMON(localVar, expectedCount) \
+ Common localVar; \
+ do { \
+ if (!localVar.unflatten(buffer, expectedCount)) { \
+ return nullptr; \
+ } \
+ } while (0)
+
+#endif