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

Unified Diff: include/private/SkShadowParams.h

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 | « include/private/SkRecords.h ('k') | samplecode/SampleShadowing.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkShadowParams.h
diff --git a/include/private/SkShadowParams.h b/include/private/SkShadowParams.h
new file mode 100644
index 0000000000000000000000000000000000000000..3df0a442796ac42844293d4a22c1da43506a3736
--- /dev/null
+++ b/include/private/SkShadowParams.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef SkShadowParams_DEFINED
+#define SkShadowParams_DEFINED
+
+/** \struct SkShadowParams
+
+ This struct holds information needed for drawing shadows.
+
+ fShadowRadius - radius of the shadow blur
+
+ fBiasingConstant - A constant used in variance shadow mapping to directly
+ 0.0 - 1.0 reduce light bleeding. Essentially sets all shadows
+ ~.25 below a certain brightness equal to no light, and does
+ a linear step on the rest. Essentially makes shadows
+ darker and more rounded at higher values.
+
+ fMinVariance - Too low of a variance (near the outer edges of blurry
+ ~512, 1024 shadows) will lead to ugly sharp shadow brightness
+ distortions. This enforces a minimum amount of variance
+ in the calculation to smooth out the outside edges of
+ blurry shadows. However, too high of a value for this will
+ cause all shadows to be lighter by visibly different
+ amounts varying on depth.
+
+ fType - Decides which algorithm to use to draw shadows.
+*/
+struct SkShadowParams {
+ SkScalar fShadowRadius;
+ SkScalar fBiasingConstant;
+ SkScalar fMinVariance;
+
+ enum ShadowType {
+ kNoBlur_ShadowType,
+ kVariance_ShadowType,
+
+ kLast_ShadowType = kVariance_ShadowType
+ };
+ static const int kShadowTypeCount = kLast_ShadowType + 1;
+
+ ShadowType fType;
+};
+
+#endif
« no previous file with comments | « include/private/SkRecords.h ('k') | samplecode/SampleShadowing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698