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

Unified Diff: include/core/SkCanvas.h

Issue 2146073003: Creating framework for drawShadowedPicture (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Fixed 'const sk_sp<SkLights>', also fixed some crumbs from merging Created 4 years, 5 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 | « no previous file | include/core/SkLights.h » ('j') | src/core/SkLightingShader.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 35a8d1c7b92193a4d247a4766efe54a2976ce0a6..971c108b91c425381530dfe783cb6bb91eea1679 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!
jvanverth1 2016/07/14 17:27:09 This is a little too vague. Suggestion: Will use t
vjiaoblack 2016/07/14 20:38:17 Done.
+ */
+ void drawShadowedPicture(const SkPicture*, sk_sp<SkLights>);
jvanverth1 2016/07/14 17:27:09 Do we not need a matrix or paint?
vjiaoblack 2016/07/14 20:38:18 I originally thought the proposed function didn't,
+ void drawShadowedPicture(const sk_sp<SkPicture>& picture, sk_sp<SkLights> lights) {
+ 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*, sk_sp<SkLights>);
// Returns the canvas to be used by DrawIter. Default implementation
// returns this. Subclasses that encapsulate an indirect canvas may
« no previous file with comments | « no previous file | include/core/SkLights.h » ('j') | src/core/SkLightingShader.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698