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

Unified Diff: ui/gfx/skbitmap_operations.cc

Issue 1123393007: Fix SkBitmapOperations::CreateDropShadow drawing too large a shadow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/skbitmap_operations.cc
diff --git a/ui/gfx/skbitmap_operations.cc b/ui/gfx/skbitmap_operations.cc
index 76aa763fa43905a6a20a1ecfe74276f4349ed929..7761c72ee1cee98e930baa9f5930867787d44a8c 100644
--- a/ui/gfx/skbitmap_operations.cc
+++ b/ui/gfx/skbitmap_operations.cc
@@ -741,9 +741,9 @@ SkBitmap SkBitmapOperations::CreateDropShadow(
SkBitmap shadow_image = SkBitmapOperations::CreateColorMask(bitmap,
shadow.color());
- skia::RefPtr<SkBlurImageFilter> filter =
- skia::AdoptRef(SkBlurImageFilter::Create(
- SkDoubleToScalar(shadow.blur()), SkDoubleToScalar(shadow.blur())));
+ skia::RefPtr<SkBlurImageFilter> filter = skia::AdoptRef(
+ SkBlurImageFilter::Create(SkDoubleToScalar(shadow.blur() / 2),
Alexei Svitkine (slow) 2015/05/19 15:12:04 It's not clear to me how this ensures that the sha
calamity 2015/05/20 04:26:51 Sorry, I should have explained better. At the begi
Alexei Svitkine (slow) 2015/05/20 20:47:42 Thanks for the explanation, that makes sense. Plea
calamity 2015/05/21 06:54:30 Done.
+ SkDoubleToScalar(shadow.blur() / 2)));
Alexei Svitkine (slow) 2015/05/20 20:47:42 Nit: Since you use SkDoubleToScalar(shadow.blur()
calamity 2015/05/21 06:54:30 Done.
paint.setImageFilter(filter.get());
canvas.saveLayer(0, &paint);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698