Index: src/core/SkLightingShader.h |
diff --git a/src/core/SkLightingShader.h b/src/core/SkLightingShader.h |
index 6301eeeea13595919e5626829ac36134e93ccbe3..75a7738755865704972e22bc1c7232bb93764adf 100644 |
--- a/src/core/SkLightingShader.h |
+++ b/src/core/SkLightingShader.h |
@@ -16,9 +16,8 @@ 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. |
+ /** 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. |
*/ |
class NormalSource : public SkFlattenable { |
public: |
@@ -37,6 +36,30 @@ public: |
SkSourceGammaTreatment gammaTreatment) const = 0; |
#endif |
+ class Provider { |
+ public: |
+ virtual ~Provider(){}; |
egdaniel
2016/06/16 13:48:10
nit: space between () and {}
dvonbeck
2016/06/16 22:05:40
Done.
|
+ |
+ /** Called for each span of the object being drawn on the CPU. Your subclass should set |
+ the appropriate normals that correspond to the specified device coordinates. |
+ */ |
+ virtual void fillScanLine(int x, int y, SkPoint3 output[], int count) const = 0; |
+ |
+ /** Returns the maximum count that can be passed into 'fillScanLine' for an output |
+ buffer of size 'count'. |
+ */ |
+ virtual int maxCountForFillScanLine(int count) const = 0; |
+ }; |
+ |
+ /** Returns an instance of 'Provider' that provides normals for the CPU pipeline. The |
+ necessary data will be initialized in place at 'storage'. |
+ */ |
+ virtual Provider* asProvider(const SkShader::ContextRec& rec, void* storage) const = 0; |
+ |
+ /** Amount of memory needed to store a provider object and its dependencies. |
+ */ |
+ virtual size_t providerSize() const = 0; |
+ |
SK_DEFINE_FLATTENABLE_TYPE(NormalSource) |
}; |