Skip to content

Commit

Permalink
Use newer Skia API for constructing mask blur filters (flutter#4875)
Browse files Browse the repository at this point in the history
Old API is going to be hidden/removed soon
  • Loading branch information
brianosman authored Mar 27, 2018
1 parent 5bfdc8f commit 6473f1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions sky/engine/platform/graphics/DrawLooperBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkDrawLooper.h"
#include "third_party/skia/include/core/SkMaskFilter.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/effects/SkBlurMaskFilter.h"

namespace blink {

Expand Down Expand Up @@ -100,11 +100,9 @@ void DrawLooperBuilder::addShadow(const FloatSize& offset,

if (blur) {
const SkScalar sigma = RadiusToSigma(blur / 2);
uint32_t mfFlags = SkBlurMaskFilter::kHighQuality_BlurFlag;
if (shadowTransformMode == ShadowIgnoresTransforms)
mfFlags |= SkBlurMaskFilter::kIgnoreTransform_BlurFlag;
bool respectCTM = (shadowTransformMode != ShadowIgnoresTransforms);
paint->setMaskFilter(
SkBlurMaskFilter::Make(kNormal_SkBlurStyle, sigma, mfFlags));
SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, sigma, respectCTM));
}

paint->setColorFilter(
Expand Down
2 changes: 1 addition & 1 deletion sky/engine/platform/graphics/GraphicsContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
#include "third_party/skia/include/core/SkAnnotation.h"
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkMaskFilter.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkRRect.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/effects/SkBlurMaskFilter.h"
#include "third_party/skia/include/effects/SkCornerPathEffect.h"
#include "third_party/skia/include/effects/SkLumaColorFilter.h"
#include "third_party/skia/include/effects/SkPictureImageFilter.h"
Expand Down

0 comments on commit 6473f1b

Please sign in to comment.