aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkEmbossMaskFilter.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-12-07 13:41:57 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-07 19:13:32 +0000
commitfd87be8ffadb37a18aa7217dfbafb9500ca11159 (patch)
treed97eb596aa4f393822a5e1ba7171ac090cff1899 /src/effects/SkEmbossMaskFilter.h
parentfc2e7e057d6ae49ba935c2580197bd8f9f316eec (diff)
hide emboss from everyone (except android for now)
BUG=skia: Change-Id: Ibd453b0a63948e3e4950f02459d7bc01a6ed26c5 Reviewed-on: https://skia-review.googlesource.com/5671 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
Diffstat (limited to 'src/effects/SkEmbossMaskFilter.h')
-rw-r--r--src/effects/SkEmbossMaskFilter.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/effects/SkEmbossMaskFilter.h b/src/effects/SkEmbossMaskFilter.h
new file mode 100644
index 0000000000..395657224c
--- /dev/null
+++ b/src/effects/SkEmbossMaskFilter.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2006 The Android Open Source Project
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkEmbossMaskFilter_DEFINED
+#define SkEmbossMaskFilter_DEFINED
+
+#include "SkMaskFilter.h"
+
+/** \class SkEmbossMaskFilter
+
+ This mask filter creates a 3D emboss look, by specifying a light and blur amount.
+*/
+class SK_API SkEmbossMaskFilter : public SkMaskFilter {
+public:
+ struct Light {
+ SkScalar fDirection[3]; // x,y,z
+ uint16_t fPad;
+ uint8_t fAmbient;
+ uint8_t fSpecular; // exponent, 4.4 right now
+ };
+
+ static sk_sp<SkMaskFilter> Make(SkScalar blurSigma, const Light& light);
+
+ // overrides from SkMaskFilter
+ // This method is not exported to java.
+ SkMask::Format getFormat() const override;
+ // This method is not exported to java.
+ bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix&,
+ SkIPoint* margin) const override;
+
+ SK_TO_STRING_OVERRIDE()
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmbossMaskFilter)
+
+protected:
+ SkEmbossMaskFilter(SkScalar blurSigma, const Light& light);
+ void flatten(SkWriteBuffer&) const override;
+
+private:
+ Light fLight;
+ SkScalar fBlurSigma;
+
+ typedef SkMaskFilter INHERITED;
+};
+
+#endif