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

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: Fixed CPU behavior when normal.Z=-1 Created 4 years, 6 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 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()

Powered by Google App Engine
This is Rietveld 408576698