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

Unified Diff: Source/platform/graphics/DrawLooperBuilder.cpp

Issue 1008173003: Move SkPaint mangement for 2D canvas into CanvasRenderingContext2DState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: applied review comments Created 5 years, 9 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 | « Source/core/html/canvas/CanvasStyle.cpp ('k') | Source/platform/graphics/GraphicsTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/DrawLooperBuilder.cpp
diff --git a/Source/platform/graphics/DrawLooperBuilder.cpp b/Source/platform/graphics/DrawLooperBuilder.cpp
index 3b0a8f45ae0f94efb0a724f92aa75483c59f84f7..1b30b6767fbf6cbb01c36da4f8f302ee4259d7aa 100644
--- a/Source/platform/graphics/DrawLooperBuilder.cpp
+++ b/Source/platform/graphics/DrawLooperBuilder.cpp
@@ -33,6 +33,7 @@
#include "platform/geometry/FloatSize.h"
#include "platform/graphics/Color.h"
+#include "platform/graphics/skia/SkiaUtils.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkDrawLooper.h"
@@ -63,13 +64,6 @@ void DrawLooperBuilder::addUnmodifiedContent()
m_skDrawLooperBuilder.addLayerOnTop(info);
}
-// This replicates the old skia behavior when it used to take radius for blur. Now it takes sigma.
-static SkScalar RadiusToSigma(SkScalar radius)
-{
- SkASSERT(radius > 0);
- return 0.57735f * radius + 0.5f;
-}
-
void DrawLooperBuilder::addShadow(const FloatSize& offset, float blur, const Color& color,
ShadowTransformMode shadowTransformMode, ShadowAlphaMode shadowAlphaMode)
{
@@ -101,7 +95,7 @@ void DrawLooperBuilder::addShadow(const FloatSize& offset, float blur, const Col
SkPaint* paint = m_skDrawLooperBuilder.addLayerOnTop(info);
if (blur) {
- const SkScalar sigma = RadiusToSigma(blur / 2);
+ const SkScalar sigma = skBlurRadiusToSigma(blur);
uint32_t mfFlags = SkBlurMaskFilter::kHighQuality_BlurFlag;
if (shadowTransformMode == ShadowIgnoresTransforms)
mfFlags |= SkBlurMaskFilter::kIgnoreTransform_BlurFlag;
« no previous file with comments | « Source/core/html/canvas/CanvasStyle.cpp ('k') | Source/platform/graphics/GraphicsTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698