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

Unified Diff: src/core/SkLightingShader.h

Issue 2043393002: Refactoring of GPU NormalMap handling out into its own class (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Rebased, unified headers, NormalSource is now serialized, addressed patch 1 comments 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/SkLightingShader.h
diff --git a/src/core/SkLightingShader.h b/src/core/SkLightingShader.h
index f25b30342a70699506cc03a5ffbc786e1e620207..7f66aa9ee74e3f7eecc4ebc1f7f2265e25cf1b99 100644
--- a/src/core/SkLightingShader.h
+++ b/src/core/SkLightingShader.h
@@ -16,6 +16,34 @@ class SkMatrix;
class SK_API SkLightingShader {
public:
+ // TODO does this need to be tagged with SK_API?
+ class NormalSource : public SkFlattenable {
egdaniel 2016/06/10 14:23:28 For SK_API, it is believed that having it on the o
dvonbeck 2016/06/10 15:22:29 The problem with the approach you suggested is tha
dvonbeck 2016/06/10 18:31:21 Done.
+
egdaniel 2016/06/10 14:23:28 remove \n between class and public
dvonbeck 2016/06/10 15:22:29 Done.
+ public:
+
+ virtual ~NormalSource();
+
+ virtual sk_sp<GrFragmentProcessor> asFragmentProcessor(
+ GrContext* context,
+ const SkMatrix& viewM,
+ const SkMatrix* localMatrix,
+ SkFilterQuality filterQuality,
+ SkSourceGammaTreatment gammaTreatment) const = 0;
+
+
+ // SK_TO_STRING_VIRT() // TODO do I need this one? just copied from SkShader
+ SK_DEFINE_FLATTENABLE_TYPE(NormalSource)
egdaniel 2016/06/10 14:23:28 These macros just declare/define various flattenab
dvonbeck 2016/06/10 15:22:29 Acknowledged.
+ };
+
+ class NormalMapSource {
+ public:
+ static sk_sp<NormalSource> Make(const SkBitmap& normal, const SkVector& invNormRotation,
+ const SkMatrix* normLocalM);
+
+ // TODO Why? Shouldn't the impls be registered?
+ SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
+ };
+
/** Returns a shader that lights the diffuse and normal maps with a set of lights.
It returns a shader with a reference count of 1.

Powered by Google App Engine
This is Rietveld 408576698