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

Unified Diff: src/core/SkNormalSource.h

Issue 2080993002: Added API for Bevel NormalSource. (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-diffuse-api-change
Patch Set: Small init fix 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
Index: src/core/SkNormalSource.h
diff --git a/src/core/SkNormalSource.h b/src/core/SkNormalSource.h
index 7517770800190e7bb851cba8886786ba129be07d..3933deaa90b25232e56f8e61c3721cb70396c893 100644
--- a/src/core/SkNormalSource.h
+++ b/src/core/SkNormalSource.h
@@ -65,6 +65,20 @@ public:
*/
static sk_sp<SkNormalSource> MakeFromNormalMap(sk_sp<SkShader> map, const SkMatrix& ctm);
+ enum class BevelType {
+ kLinear,
+ kRoundedOut,
+ kRoundedIn
+ };
+ /** Returns a normal source that generates a bevel for the given shape. UNIMPLEMENTED: Will
+ return straight-up normals only.
+
+ @param type the type of bevel to add
robertphillips 2016/07/11 19:13:21 Mention what space 'width' and 'height' are in. So
dvonbeck 2016/07/13 14:23:38 Yes. Done.
+ @param width the width of the bevel
+ @param height the height of the plateau
+ */
+ static sk_sp<SkNormalSource> MakeBevel(BevelType, SkScalar width, SkScalar height);
+
SK_DEFINE_FLATTENABLE_TYPE(SkNormalSource)
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
};

Powered by Google App Engine
This is Rietveld 408576698