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

Unified Diff: src/core/SkNormalSource.h

Issue 2063793002: API change to allow for NormalSource selection at the user level. (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-normal-factor-out
Patch Set: Addressed remaining patch 8 comments 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/SkLightingShader.cpp ('k') | src/core/SkNormalSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkNormalSource.h
diff --git a/src/core/SkNormalSource.h b/src/core/SkNormalSource.h
index 0d0c672fa33d711ba43eec56126865ff9b68bacd..7517770800190e7bb851cba8886786ba129be07d 100644
--- a/src/core/SkNormalSource.h
+++ b/src/core/SkNormalSource.h
@@ -10,8 +10,7 @@
#include "SkFlattenable.h"
-/** Abstract class that generates or reads in normals for use by SkLightingShader. Not to be
- used as part of the API yet. Used internally by SkLightingShader.
+/** Abstract class that generates or reads in normals for use by SkLightingShader.
*/
class SK_API SkNormalSource : public SkFlattenable {
public:
@@ -49,11 +48,9 @@ public:
virtual size_t providerSize(const SkShader::ContextRec&) const = 0;
/** Returns a normal source that provides normals sourced from the the normal map argument.
- Not to be used as part of the API yet. Used internally by SkLightingShader.
- @param map a shader that outputs the normal map
- @param normRotation rotation applied to the normal map's normals, in the
- [cos a, sin a] form.
+ @param map a shader that outputs the normal map
+ @param ctm the current canvas' total matrix, used to rotate normals when necessary.
nullptr will be returned if 'map' is null
@@ -66,8 +63,7 @@ public:
The +Z axis is thus encoded in RGB as (127, 127, 255) while the -Z axis is
(127, 127, 0).
*/
- static sk_sp<SkNormalSource> MakeFromNormalMap(sk_sp<SkShader> map,
- const SkVector& normRotation);
+ static sk_sp<SkNormalSource> MakeFromNormalMap(sk_sp<SkShader> map, const SkMatrix& ctm);
SK_DEFINE_FLATTENABLE_TYPE(SkNormalSource)
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
« no previous file with comments | « src/core/SkLightingShader.cpp ('k') | src/core/SkNormalSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698