Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: src/core/SkNormalFlatSource.h

Issue 2080993002: Added API for Bevel NormalSource. (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-diffuse-api-change
Patch Set: fixed unused field Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkNormalBevelSource.cpp ('k') | src/core/SkNormalFlatSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkNormalFlatSource.h
diff --git a/src/core/SkNormalFlatSource.h b/src/core/SkNormalFlatSource.h
new file mode 100644
index 0000000000000000000000000000000000000000..e1295596b93d9eb7d35bbbf67d92df49f6c35173
--- /dev/null
+++ b/src/core/SkNormalFlatSource.h
@@ -0,0 +1,48 @@
+/*
+ * 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
+ 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(SkNormalFlatSourceImpl)
+
+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;
+ };
+
+ friend class SkNormalSource;
+
+ typedef SkNormalSource INHERITED;
+};
+
+#endif
« no previous file with comments | « src/core/SkNormalBevelSource.cpp ('k') | src/core/SkNormalFlatSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698