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

Unified Diff: tools/debugger/SkDrawCommand.cpp

Issue 2224163005: Made shadows blurry (thru implementing variance mapping) (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Trying different include path Created 4 years, 4 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 | « tools/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/debugger/SkDrawCommand.cpp
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp
index 65de258ed2cbc9cbd5f9e4238510f90b2554332d..2a6234c580f41667a1b09f7c84ea09a24de4c650 100644
--- a/tools/debugger/SkDrawCommand.cpp
+++ b/tools/debugger/SkDrawCommand.cpp
@@ -2449,14 +2449,35 @@ void SkEndDrawPictureCommand::execute(SkCanvas* canvas) const {
SkBeginDrawShadowedPictureCommand::SkBeginDrawShadowedPictureCommand(const SkPicture* picture,
const SkMatrix* matrix,
- const SkPaint* paint)
+ const SkPaint* paint,
+ const SkShadowParams& params)
: INHERITED(kBeginDrawShadowedPicture_OpType)
+#ifdef SK_EXPERIMENTAL_SHADOWING
+ , fPicture(SkRef(picture))
+ , fShadowParams(params) {
+#else
, fPicture(SkRef(picture)) {
-
+#endif
SkString* str = new SkString;
- str->appendf("SkPicture: L: %f T: %f R: %f B: %f",
+ str->appendf("SkPicture: L: %f T: %f R: %f B: %f\n",
picture->cullRect().fLeft, picture->cullRect().fTop,
picture->cullRect().fRight, picture->cullRect().fBottom);
+ str->appendf("SkShadowParams: bias:%f, minVariance:%f, shRadius:%f, shType:",
+ params.fBiasingConstant,
+ params.fMinVariance,
+ params.fShadowRadius);
+
+ SkASSERT(SkShadowParams::kShadowTypeCount == 2);
+
+ switch (params.fType) {
+ case SkShadowParams::ShadowType::kNoBlur_ShadowType:
+ str->append("kNoBlur_ShadowType\n");
+ break;
+ case SkShadowParams::ShadowType::kVariance_ShadowType:
+ str->append("kVariance_ShadowType\n");
+ break;
+ }
+
fInfo.push(str);
if (matrix) {
@@ -2492,9 +2513,11 @@ bool SkBeginDrawShadowedPictureCommand::render(SkCanvas* canvas) const {
canvas->save();
xlate_and_scale_to_bounds(canvas, fPicture->cullRect());
-
- canvas->drawPicture(fPicture.get());
-
+#ifdef SK_EXPERIMENTAL_SHADOWING
+ canvas->drawShadowedPicture(fPicture.get(), fMatrix.get(), fPaint.get(), fShadowParams);
+#else
+ canvas->drawPicture(fPicture.get(), fMatrix.get(), fPaint.get());
+#endif
canvas->restore();
return true;
« no previous file with comments | « tools/debugger/SkDrawCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698