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

Unified Diff: src/core/SkLightingShader.h

Issue 2050773002: Refactoring of CPU NormalMap handling out into its own class (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-normals-gpu-cl
Patch Set: Updated Flattenable_type enum name 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
« no previous file with comments | « include/core/SkFlattenable.h ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLightingShader.h
diff --git a/src/core/SkLightingShader.h b/src/core/SkLightingShader.h
index c2b65472b924f35d5d757ca751d1aae6fdf0b9ed..f25b30342a70699506cc03a5ffbc786e1e620207 100644
--- a/src/core/SkLightingShader.h
+++ b/src/core/SkLightingShader.h
@@ -16,55 +16,6 @@ class SkMatrix;
class SK_API SkLightingShader {
public:
- /** Abstract class that generates or reads in normals for use by SkLightingShader. Currently
- implements the GPU side only. Not to be used as part of the API yet. Used internally by
- SkLightingShader.
- */
- class SK_API NormalSource : public SkFlattenable {
- public:
- virtual ~NormalSource();
-
-#if SK_SUPPORT_GPU
- /** Returns a fragment processor that takes no input and outputs a normal (already rotated)
- as its output color. To be used as a child fragment processor.
- */
- virtual sk_sp<GrFragmentProcessor> asFragmentProcessor(
- GrContext* context,
- const SkMatrix& viewM,
- const SkMatrix* localMatrix,
- SkFilterQuality filterQuality,
- SkSourceGammaTreatment gammaTreatment) const = 0;
-#endif
-
- /** 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 normal the normal map
- @param invNormRotation rotation applied to the normal map's normals
- @param normLocalM the local matrix for the normal map
-
- nullptr will be returned if
- 'normal' is empty
- 'normal' too big (> 65535 on either side)
-
- The normal map is currently assumed to be an 8888 image where the normal at a texel
- is retrieved by:
- N.x = R-127;
- N.y = G-127;
- N.z = B-127;
- N.normalize();
- The +Z axis is thus encoded in RGB as (127, 127, 255) while the -Z axis is
- (127, 127, 0).
- */
- static sk_sp<NormalSource> MakeMap(const SkBitmap& normal, const SkVector& invNormRotation,
reed1 2016/06/20 15:00:39 0. Should we have a variant that takes SkImage? Sk
dvonbeck 2016/06/20 20:03:58 0. I could make it take in a shader instead of a b
- const SkMatrix* normLocalM);
-
- SK_DEFINE_FLATTENABLE_TYPE(NormalSource)
- 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.
« no previous file with comments | « include/core/SkFlattenable.h ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698