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

Unified Diff: gm/shadowmaps.cpp

Issue 2224163005: Made shadows blurry (thru implementing variance mapping) (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Moved SkShadowType to SkCanvas 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 | « no previous file | gyp/common_variables.gypi » ('j') | include/core/SkCanvas.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/shadowmaps.cpp
diff --git a/gm/shadowmaps.cpp b/gm/shadowmaps.cpp
index b343d9b142221b60379c52901808e317462838d2..b024bac9cde4ce05985dbaf971183c2d04c21647 100644
--- a/gm/shadowmaps.cpp
+++ b/gm/shadowmaps.cpp
@@ -76,6 +76,11 @@ public:
SkVector3::Make(0.1f, 0.2f, 1.0f)));
builder.add(SkLights::Light(SkColor3f::Make(0.4f, 0.4f, 0.4f)));
fLights = builder.finish();
+
+ fShadowType.fShadowRadius = 4.0f;
+ fShadowType.fBiasingConstant = 0.3f;
+ fShadowType.fMinVariance = 1024;
+ fShadowType.fBlurAlgorithm = SkShadowType::kVariance_BlurAlgorithm;
}
protected:
@@ -95,11 +100,12 @@ protected:
// It's used to generate the depth maps.
sk_sp<SkPicture> pic(make_test_picture(kWidth, kHeight));
canvas->setLights(fLights);
- canvas->drawShadowedPicture(pic, nullptr, nullptr);
+ canvas->drawShadowedPicture(pic, nullptr, nullptr, fShadowType);
}
private:
sk_sp<SkLights> fLights;
+ SkShadowType fShadowType;
typedef GM INHERITED;
};
« no previous file with comments | « no previous file | gyp/common_variables.gypi » ('j') | include/core/SkCanvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698