Index: src/core/SkNormalBevelSource.h |
diff --git a/src/core/SkNormalBevelSource.h b/src/core/SkNormalBevelSource.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d133738bcee201c407862a1e267a95a18bf63ec7 |
--- /dev/null |
+++ b/src/core/SkNormalBevelSource.h |
@@ -0,0 +1,57 @@ |
+/* |
+ * Copyright 2016 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#ifndef SkNormalBevelSource_DEFINED |
+#define SkNormalBevelSource_DEFINED |
+ |
+#include "SkNormalSource.h" |
+ |
+class SK_API SkNormalBevelSourceImpl : public SkNormalSource { |
+public: |
+ SkNormalBevelSourceImpl(BevelType type, SkScalar width, SkScalar height) |
+ : fType(type) |
+ , fWidth(width) |
+ , fHeight(height) {} |
+ |
+#if SK_SUPPORT_GPU |
+ sk_sp<GrFragmentProcessor> asFragmentProcessor(const SkShader::AsFPArgs&) const override; |
+#endif |
+ |
+ SkNormalSource::Provider* asProvider(const SkShader::ContextRec& rec, |
+ void* storage) const override; |
+ size_t providerSize(const SkShader::ContextRec& rec) const override; |
+ |
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkNormalBevelSourceImpl) |
+ |
+protected: |
+ void flatten(SkWriteBuffer& buf) const override; |
+ |
+private: |
+ class Provider : public SkNormalSource::Provider { |
+ public: |
+ Provider(); |
+ |
+ virtual ~Provider(); |
+ |
+ void fillScanLine(int x, int y, SkPoint3 output[], int count) const override; |
+ |
+ private: |
+ typedef SkNormalSource::Provider INHERITED; |
+ |
+ }; |
+ |
+ SkNormalSource::BevelType fType; |
+ SkScalar fWidth; |
+ SkScalar fHeight; |
+ |
+ friend class SkNormalSource; |
+ |
+ typedef SkNormalSource INHERITED; |
+}; |
+ |
+ |
+#endif |