Flutter Engine
The Flutter Engine
Functions
SkBlurEngine.cpp File Reference
#include "src/core/SkBlurEngine.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkClipOp.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkM44.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"
#include "include/core/SkSamplingOptions.h"
#include "include/core/SkScalar.h"
#include "include/core/SkTileMode.h"
#include "include/effects/SkRuntimeEffect.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkMath.h"
#include "include/private/base/SkTo.h"
#include "src/core/SkDevice.h"
#include "src/core/SkKnownRuntimeEffects.h"
#include "src/core/SkSpecialImage.h"
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <utility>

Go to the source code of this file.

Functions

static SkKnownRuntimeEffects::StableKey to_stablekey (int kernelWidth, uint32_t baseKey)
 

Function Documentation

◆ to_stablekey()

static SkKnownRuntimeEffects::StableKey to_stablekey ( int  kernelWidth,
uint32_t  baseKey 
)
static

Definition at line 204 of file SkBlurEngine.cpp.

204 {
205 SkASSERT(kernelWidth >= 2 && kernelWidth <= SkShaderBlurAlgorithm::kMaxSamples);
206 switch(kernelWidth) {
207 // Batch on multiples of 4 (skipping width=1, since that can't happen)
208 case 2: [[fallthrough]];
209 case 3: [[fallthrough]];
210 case 4: return static_cast<SkKnownRuntimeEffects::StableKey>(baseKey);
211 case 5: [[fallthrough]];
212 case 6: [[fallthrough]];
213 case 7: [[fallthrough]];
214 case 8: return static_cast<SkKnownRuntimeEffects::StableKey>(baseKey+1);
215 case 9: [[fallthrough]];
216 case 10: [[fallthrough]];
217 case 11: [[fallthrough]];
218 case 12: return static_cast<SkKnownRuntimeEffects::StableKey>(baseKey+2);
219 case 13: [[fallthrough]];
220 case 14: [[fallthrough]];
221 case 15: [[fallthrough]];
222 case 16: return static_cast<SkKnownRuntimeEffects::StableKey>(baseKey+3);
223 case 17: [[fallthrough]];
224 case 18: [[fallthrough]];
225 case 19: [[fallthrough]];
226 // With larger kernels, batch on multiples of eight so up to 7 wasted samples.
227 case 20: return static_cast<SkKnownRuntimeEffects::StableKey>(baseKey+4);
228 case 21: [[fallthrough]];
229 case 22: [[fallthrough]];
230 case 23: [[fallthrough]];
231 case 24: [[fallthrough]];
232 case 25: [[fallthrough]];
233 case 26: [[fallthrough]];
234 case 27: [[fallthrough]];
235 case 28: return static_cast<SkKnownRuntimeEffects::StableKey>(baseKey+5);
236 default:
238 }
239}
#define SkUNREACHABLE
Definition: SkAssert.h:135
#define SkASSERT(cond)
Definition: SkAssert.h:116
static constexpr int kMaxSamples
Definition: SkBlurEngine.h:166