aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLightingShader.h
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2016-06-15 14:28:17 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-15 14:28:18 -0700
commit4132de7069b0088665af52ffea3a42b055f51b79 (patch)
tree1fdb5f8f93dcb02779d796fee39de9f5ec1c68c8 /src/core/SkLightingShader.h
parent963632f686cd642344429f64e6a53262fe592828 (diff)
Revert of Refactoring of GPU NormalMap handling out into its own class (patchset #9 id:160001 of https://codereview.chromium.org/2043393002/ )
Reason for revert: break deps roll Original issue's description: > Refactoring of GPU NormalMap handling out into its own class. > > The purpose of this change is to refactor the handling of normal maps out of SkLightingShader, laying the groundwork to eventually allow for multiple normal sources. > > What this CL includes: > > - Created a new 'NormalMapFP', out of the existing normal map reading behavior in LightingFP. > > - Encapsulates this new fragment processor on a new class NormalMapSource. > > - Created a NormalSource abstraction that will interface with SkLightingShader. > > - Adapted SkLightingShader to use the normals from its NormalSource field ON THE GPU SIDE. No changes done to the CPU side yet. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2043393002 > > Committed: https://skia.googlesource.com/skia/+/87b0dd00cf9409c5fc990f5d0bb7c0df837f08da > Committed: https://skia.googlesource.com/skia/+/a7d1e2a57aef2aa4913d4380646d60bbab761318 TBR=reed@google.com,dvonbeck@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2068983005
Diffstat (limited to 'src/core/SkLightingShader.h')
-rw-r--r--src/core/SkLightingShader.h52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/core/SkLightingShader.h b/src/core/SkLightingShader.h
index 6301eeeea1..f25b30342a 100644
--- a/src/core/SkLightingShader.h
+++ b/src/core/SkLightingShader.h
@@ -16,58 +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 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
-
- SK_DEFINE_FLATTENABLE_TYPE(NormalSource)
- };
-
- /** 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).
- */
- class NormalMapSource {
- public:
- static sk_sp<NormalSource> Make(const SkBitmap& normal, const SkVector& invNormRotation,
- const SkMatrix* normLocalM);
-
- 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.