aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkNormalFlatSource.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkNormalFlatSource.h')
-rw-r--r--src/core/SkNormalFlatSource.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/core/SkNormalFlatSource.h b/src/core/SkNormalFlatSource.h
new file mode 100644
index 0000000000..9303ba10af
--- /dev/null
+++ b/src/core/SkNormalFlatSource.h
@@ -0,0 +1,47 @@
+/*
+ * 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 SkNormalFlatSource_DEFINED
+#define SkNormalFlatSource_DEFINED
+
+#include "SkNormalSource.h"
+
+class SK_API SkNormalFlatSourceImpl : public SkNormalSource {
+public:
+ SkNormalFlatSourceImpl(){}
+
+#if SK_SUPPORT_GPU
+ std::unique_ptr<GrFragmentProcessor> asFragmentProcessor(const GrFPArgs& args) const override;
+#endif
+
+ SkNormalSource::Provider* asProvider(const SkShaderBase::ContextRec& rec,
+ SkArenaAlloc* alloc) const override;
+
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkNormalFlatSourceImpl)
+
+protected:
+ void flatten(SkWriteBuffer& buf) const override;
+
+private:
+ class Provider : public SkNormalSource::Provider {
+ public:
+ Provider();
+
+ ~Provider() override;
+
+ void fillScanLine(int x, int y, SkPoint3 output[], int count) const override;
+
+ private:
+ typedef SkNormalSource::Provider INHERITED;
+ };
+
+ friend class SkNormalSource;
+
+ typedef SkNormalSource INHERITED;
+};
+
+#endif