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

Unified Diff: Source/core/platform/graphics/DrawLooper.cpp

Issue 23581008: Revert r154797: "Move isValid/isCurrentColor from Color to StyleColor" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
Index: Source/core/platform/graphics/DrawLooper.cpp
diff --git a/Source/core/platform/graphics/DrawLooper.cpp b/Source/core/platform/graphics/DrawLooper.cpp
index 609878b0581bb183c0b7767780153ca99d316e76..461db1c02695bd65f84c439fe9d2a967bf5ac038 100644
--- a/Source/core/platform/graphics/DrawLooper.cpp
+++ b/Source/core/platform/graphics/DrawLooper.cpp
@@ -62,10 +62,14 @@ void DrawLooper::addShadow(const FloatSize& offset, float blur, const Color& col
ShadowTransformMode shadowTransformMode, ShadowAlphaMode shadowAlphaMode)
{
// Detect when there's no effective shadow.
- if (!color.alpha())
+ if (!color.isValid() || !color.alpha())
return;
- SkColor skColor = color.rgb();
+ SkColor skColor;
+ if (color.isValid())
+ skColor = color.rgb();
+ else
+ skColor = SkColorSetARGB(0xFF / 3, 0, 0, 0); // "std" apple shadow color.
SkLayerDrawLooper::LayerInfo info;

Powered by Google App Engine
This is Rietveld 408576698