| Index: ui/gfx/skia_util.cc
|
| diff --git a/ui/gfx/skia_util.cc b/ui/gfx/skia_util.cc
|
| index ef07241ba5778efd278d269f626852544574890f..90602f50f228aaaf533d0fa4e6a5a1be26825c85 100644
|
| --- a/ui/gfx/skia_util.cc
|
| +++ b/ui/gfx/skia_util.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "ui/gfx/skia_util.h"
|
|
|
| +#include "base/containers/adapters.h"
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
| #include "third_party/skia/include/core/SkColorFilter.h"
|
| #include "third_party/skia/include/core/SkColorPriv.h"
|
| @@ -126,16 +127,12 @@ skia::RefPtr<SkDrawLooper> CreateShadowDrawLooper(
|
|
|
| SkLayerDrawLooper::Builder looper_builder;
|
|
|
| - looper_builder.addLayer(); // top layer of the original.
|
| -
|
| SkLayerDrawLooper::LayerInfo layer_info;
|
| layer_info.fPaintBits |= SkLayerDrawLooper::kMaskFilter_Bit;
|
| layer_info.fPaintBits |= SkLayerDrawLooper::kColorFilter_Bit;
|
| layer_info.fColorMode = SkXfermode::kSrc_Mode;
|
|
|
| - for (size_t i = 0; i < shadows.size(); ++i) {
|
| - const ShadowValue& shadow = shadows[i];
|
| -
|
| + for (const ShadowValue& shadow : base::Reversed(shadows)) {
|
| layer_info.fOffset.set(SkIntToScalar(shadow.x()),
|
| SkIntToScalar(shadow.y()));
|
|
|
| @@ -149,11 +146,14 @@ skia::RefPtr<SkDrawLooper> CreateShadowDrawLooper(
|
| SkColorFilter::CreateModeFilter(shadow.color(),
|
| SkXfermode::kSrcIn_Mode));
|
|
|
| - SkPaint* paint = looper_builder.addLayer(layer_info);
|
| + SkPaint* paint = looper_builder.addLayerOnTop(layer_info);
|
| paint->setMaskFilter(blur_mask.get());
|
| paint->setColorFilter(color_filter.get());
|
| }
|
|
|
| + // Top layer of the original.
|
| + looper_builder.addLayerOnTop(SkLayerDrawLooper::LayerInfo());
|
| +
|
| return skia::AdoptRef<SkDrawLooper>(looper_builder.detachLooper());
|
| }
|
|
|
|
|