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

Unified Diff: ui/gfx/skia_util.cc

Issue 177343005: Use SkLayerDrawLooper::Builder to construct SkLayerDrawLooper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/skia_util.cc
diff --git a/ui/gfx/skia_util.cc b/ui/gfx/skia_util.cc
index bb7cde7b4baa5e32788367629c13507b1073ad05..114591088c6dd464c39202e1810ce7eca75b9b6b 100644
--- a/ui/gfx/skia_util.cc
+++ b/ui/gfx/skia_util.cc
@@ -104,10 +104,9 @@ skia::RefPtr<SkDrawLooper> CreateShadowDrawLooper(
if (shadows.empty())
return skia::RefPtr<SkDrawLooper>();
- skia::RefPtr<SkLayerDrawLooper> looper =
- skia::AdoptRef(new SkLayerDrawLooper);
+ SkLayerDrawLooper::Builder looperBuilder;
danakj 2014/02/24 18:05:33 looper_builder
Dominik Grewe 2014/02/24 18:18:12 Done.
- looper->addLayer(); // top layer of the original.
+ looperBuilder.addLayer(); // top layer of the original.
SkLayerDrawLooper::LayerInfo layer_info;
layer_info.fPaintBits |= SkLayerDrawLooper::kMaskFilter_Bit;
@@ -130,12 +129,12 @@ skia::RefPtr<SkDrawLooper> CreateShadowDrawLooper(
SkColorFilter::CreateModeFilter(shadow.color(),
SkXfermode::kSrcIn_Mode));
- SkPaint* paint = looper->addLayer(layer_info);
+ SkPaint* paint = looperBuilder.addLayer(layer_info);
paint->setMaskFilter(blur_mask.get());
paint->setColorFilter(color_filter.get());
}
- return looper;
+ return skia::AdoptRef<SkDrawLooper>(looperBuilder.detachLooper());
}
bool BitmapsAreEqual(const SkBitmap& bitmap1, const SkBitmap& bitmap2) {
« 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