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

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: Refactoring, style fixes 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..a58b08c8f54fa5d6b1ad52d8bf12b9dc9badb4eb 100644
--- a/src/core/SkLightingShader.h
+++ b/src/core/SkLightingShader.h
@@ -16,6 +16,30 @@ class SkMatrix;
class SK_API SkLightingShader {
public:
+ class NormalSource : public SkFlattenable {
+ public:
+ virtual ~NormalSource();
+
+#if SK_SUPPORT_GPU
+ virtual sk_sp<GrFragmentProcessor> asFragmentProcessor(
reed1 2016/06/10 19:15:23 use override instead
dvonbeck 2016/06/10 21:00:16 This is not overriding anything, it's the NormalSo
+ GrContext* context,
+ const SkMatrix& viewM,
+ const SkMatrix* localMatrix,
+ SkFilterQuality filterQuality,
+ SkSourceGammaTreatment gammaTreatment) const = 0;
+#endif
+
+ SK_DEFINE_FLATTENABLE_TYPE(NormalSource)
dvonbeck 2016/06/10 18:31:21 FLATTENABLE: Macro
+ };
+
+ class SK_API NormalMapSource {
+ public:
+ static sk_sp<NormalSource> Make(const SkBitmap& normal, const SkVector& invNormRotation,
+ const SkMatrix* normLocalM);
+
+ SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
dvonbeck 2016/06/10 18:31:21 FLATTENABLE: Macro
+ };
+
/** 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