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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkNormalSource_DEFINED 8 #ifndef SkNormalSource_DEFINED
9 #define SkNormalSource_DEFINED 9 #define SkNormalSource_DEFINED
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 is retrieved by: 58 is retrieved by:
59 N.x = R-127; 59 N.x = R-127;
60 N.y = G-127; 60 N.y = G-127;
61 N.z = B-127; 61 N.z = B-127;
62 N.normalize(); 62 N.normalize();
63 The +Z axis is thus encoded in RGB as (127, 127, 255) while the -Z axis is 63 The +Z axis is thus encoded in RGB as (127, 127, 255) while the -Z axis is
64 (127, 127, 0). 64 (127, 127, 0).
65 */ 65 */
66 static sk_sp<SkNormalSource> MakeFromNormalMap(sk_sp<SkShader> map, const Sk Matrix& ctm); 66 static sk_sp<SkNormalSource> MakeFromNormalMap(sk_sp<SkShader> map, const Sk Matrix& ctm);
67 67
68 enum class BevelType {
69 kLinear,
70 kRoundedOut,
71 kRoundedIn
72 };
73 /** Returns a normal source that generates a bevel for the given shape. UNIM PLEMENTED: Will
74 return straight-up normals only.
75
76 @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.
77 @param width the width of the bevel
78 @param height the height of the plateau
79 */
80 static sk_sp<SkNormalSource> MakeBevel(BevelType, SkScalar width, SkScalar h eight);
81
68 SK_DEFINE_FLATTENABLE_TYPE(SkNormalSource) 82 SK_DEFINE_FLATTENABLE_TYPE(SkNormalSource)
69 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() 83 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
70 }; 84 };
71 85
72 #endif 86 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698