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

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: looperBuilder -> looper_builder 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..943f51edc1f7af353ae58af37a4eafe37940a93d 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 looper_builder;
- looper->addLayer(); // top layer of the original.
+ looper_builder.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 = looper_builder.addLayer(layer_info);
paint->setMaskFilter(blur_mask.get());
paint->setColorFilter(color_filter.get());
}
- return looper;
+ return skia::AdoptRef<SkDrawLooper>(looper_builder.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