diff options
author | Florin Malita <fmalita@chromium.org> | 2017-05-31 14:20:12 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-31 14:52:12 +0000 |
commit | bb3f5621a9058e97e6361c9a71867580428864e2 (patch) | |
tree | e4cb5cae11e603d6756280814acd684d5b0784d2 /src | |
parent | 0cc507d22566bb7e28e5fe21e4b3fc7b682d86a2 (diff) |
Revert "Revert "Delete SkGaussianEdgeShader""
This reverts commit 9d14f936cc09de2a37c05c7af2cf60aa31f74722.
Reason for revert: Android fix merged.
Original change's description:
> Revert "Delete SkGaussianEdgeShader"
>
> This reverts commit 64790a3714467300848971aa153aca8cea91cf7b.
>
> Reason for revert: pending Android fix merge.
>
> Original change's description:
> > Delete SkGaussianEdgeShader
> >
> > No longer used.
> >
> > Change-Id: I65a61696060ca19f528066ea587e140798450e36
> > Reviewed-on: https://skia-review.googlesource.com/18132
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> >
>
> TBR=jvanverth@google.com,fmalita@chromium.org,reed@google.com
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
>
> Change-Id: I88a428e942c78b1fc8e70501ba7fdda5727b2ab2
> Reviewed-on: https://skia-review.googlesource.com/18156
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
>
TBR=mtklein@google.com,jvanverth@google.com,reviews@skia.org,fmalita@chromium.org,reed@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Ia6c97a79a6425a28fab49984691505bf89ac9736
Reviewed-on: https://skia-review.googlesource.com/18227
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/SkGaussianEdgeShader.cpp | 95 | ||||
-rw-r--r-- | src/effects/SkGaussianEdgeShader.h | 27 | ||||
-rw-r--r-- | src/ports/SkGlobalInitialization_default.cpp | 2 |
3 files changed, 0 insertions, 124 deletions
diff --git a/src/effects/SkGaussianEdgeShader.cpp b/src/effects/SkGaussianEdgeShader.cpp deleted file mode 100644 index c710b949d3..0000000000 --- a/src/effects/SkGaussianEdgeShader.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2016 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "SkGaussianEdgeShader.h" -#include "SkReadBuffer.h" -#include "SkWriteBuffer.h" - -class SkArenaAlloc; - - /** \class SkGaussianEdgeShaderImpl - This subclass of shader applies a Gaussian to shadow edge - - If the primitive supports an implicit distance to the edge, the radius of the blur is specified - by r & g values of the color in 14.2 fixed point. For spot shadows, we increase the stroke width - to set the shadow against the shape. This pad is specified by b, also in 6.2 fixed point. - - When not using implicit distance, then b in the input color represents the input to the - blur function. - */ -class SkGaussianEdgeShaderImpl : public SkShaderBase { -public: - SkGaussianEdgeShaderImpl() {} - - bool isOpaque() const override; - -#if SK_SUPPORT_GPU - sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const override; -#endif - - SK_TO_STRING_OVERRIDE() - SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkGaussianEdgeShaderImpl) - -protected: - void flatten(SkWriteBuffer&) const override; - Context* onMakeContext(const ContextRec& rec, SkArenaAlloc* storage) const override { - return nullptr; - } -private: - friend class SkGaussianEdgeShader; - - typedef SkShaderBase INHERITED; -}; - -//////////////////////////////////////////////////////////////////////////// - -#if SK_SUPPORT_GPU - -#include "effects/GrBlurredEdgeFragmentProcessor.h" - -//////////////////////////////////////////////////////////////////////////// - -sk_sp<GrFragmentProcessor> SkGaussianEdgeShaderImpl::asFragmentProcessor(const AsFPArgs&) const { - return GrBlurredEdgeFP::Make(GrBlurredEdgeFP::kGaussian_Mode); -} - -#endif - -//////////////////////////////////////////////////////////////////////////// - -bool SkGaussianEdgeShaderImpl::isOpaque() const { - return false; -} - -//////////////////////////////////////////////////////////////////////////// - -#ifndef SK_IGNORE_TO_STRING -void SkGaussianEdgeShaderImpl::toString(SkString* str) const { - str->appendf("GaussianEdgeShader: ()"); -} -#endif - -sk_sp<SkFlattenable> SkGaussianEdgeShaderImpl::CreateProc(SkReadBuffer& buf) { - return sk_make_sp<SkGaussianEdgeShaderImpl>(); -} - -void SkGaussianEdgeShaderImpl::flatten(SkWriteBuffer& buf) const { -} - -/////////////////////////////////////////////////////////////////////////////// - -sk_sp<SkShader> SkGaussianEdgeShader::Make() { - return sk_make_sp<SkGaussianEdgeShaderImpl>(); -} - -/////////////////////////////////////////////////////////////////////////////// - -SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkGaussianEdgeShader) -SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkGaussianEdgeShaderImpl) -SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END - -/////////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/SkGaussianEdgeShader.h b/src/effects/SkGaussianEdgeShader.h deleted file mode 100644 index f0554dd0a7..0000000000 --- a/src/effects/SkGaussianEdgeShader.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2016 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef SkGaussianEdgeShader_DEFINED -#define SkGaussianEdgeShader_DEFINED - -#include "SkShaderBase.h" - -class SK_API SkGaussianEdgeShader { -public: - /** Returns a shader that applies a Gaussian blur depending on distance to the edge - * Currently this is only useable with Circle and RRect shapes on the GPU backend. - * Raster will draw nothing. - */ - static sk_sp<SkShader> Make(); - - SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() - -private: - SkGaussianEdgeShader(); // can't be instantiated -}; - -#endif diff --git a/src/ports/SkGlobalInitialization_default.cpp b/src/ports/SkGlobalInitialization_default.cpp index 8052417ca8..de9b61ae9c 100644 --- a/src/ports/SkGlobalInitialization_default.cpp +++ b/src/ports/SkGlobalInitialization_default.cpp @@ -22,7 +22,6 @@ #include "SkDisplacementMapEffect.h" #include "SkDropShadowImageFilter.h" #include "../../src/effects/SkEmbossMaskFilter.h" -#include "../../src/effects/SkGaussianEdgeShader.h" #include "SkGradientShader.h" #include "SkHighContrastFilter.h" #include "SkImageSource.h" @@ -92,7 +91,6 @@ void SkFlattenable::PrivateInitializer::InitEffects() { SkGradientShader::InitializeFlattenables(); SkLightingShader::InitializeFlattenables(); SkNormalSource::InitializeFlattenables(); - SkGaussianEdgeShader::InitializeFlattenables(); // PathEffect SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArcToPathEffect) |