Chromium Code Reviews| Index: include/core/SkCanvas.h |
| diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h |
| index 35a8d1c7b92193a4d247a4766efe54a2976ce0a6..063a5319bc340bd811cec68c76ebd099f8c5f542 100644 |
| --- a/include/core/SkCanvas.h |
| +++ b/include/core/SkCanvas.h |
| @@ -17,6 +17,7 @@ |
| #include "SkRegion.h" |
| #include "SkSurfaceProps.h" |
| #include "SkXfermode.h" |
| +#include "SkLights.h" |
| class GrContext; |
| class GrDrawContext; |
| @@ -1049,6 +1050,16 @@ public: |
| this->drawPicture(picture.get(), matrix, paint); |
| } |
| + /** |
| + * Draw the picture into this canvas. |
| + * |
| + * However, this time, we will use the passed-in lights to generate shadows! |
| + */ |
| + void drawShadowedPicture(const SkPicture*, const sk_sp<SkLights>); |
| + void drawShadowedPicture(const sk_sp<SkPicture>& picture, const sk_sp<SkLights> lights) { |
|
reed1
2016/07/14 14:25:13
api nit: don't use const on 2nd parameter.
vjiaoblack
2016/07/14 14:42:04
Done.
|
| + this->drawShadowedPicture(picture.get(), lights); |
| + } |
| + |
| enum VertexMode { |
| kTriangles_VertexMode, |
| kTriangleStrip_VertexMode, |
| @@ -1402,6 +1413,7 @@ protected: |
| virtual void onDiscard(); |
| virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*); |
| + virtual void onDrawShadowedPicture(const SkPicture*, const sk_sp<SkLights>); |
| // Returns the canvas to be used by DrawIter. Default implementation |
| // returns this. Subclasses that encapsulate an indirect canvas may |
| @@ -1417,6 +1429,8 @@ protected: |
| const SkImageFilter* imageFilter = NULL); |
| private: |
| + uint32_t curDrawDepth = 0; |
| + |
| static bool BoundsAffectsClip(SaveLayerFlags); |
| static SaveLayerFlags LegacySaveFlagsToSaveLayerFlags(uint32_t legacySaveFlags); |