diff options
author | 2015-01-14 12:28:22 -0800 | |
---|---|---|
committer | 2015-01-14 12:28:22 -0800 | |
commit | 26feeba2678e82ada6ee0c5096a95a8ef2a00c60 (patch) | |
tree | 96dbcbac0252b752b348c3946b66c600b2552e34 /src/core/SkBitmapProcState.cpp | |
parent | bd2059a02aea252f5f308d7ca2c6a1cbc0197715 (diff) |
separate out the scaline-choosing to simplify chooseProcs
BUG=skia:
TBR=
Review URL: https://codereview.chromium.org/796063007
Diffstat (limited to 'src/core/SkBitmapProcState.cpp')
-rw-r--r-- | src/core/SkBitmapProcState.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp index ab38b6b2bc..ada974adbf 100644 --- a/src/core/SkBitmapProcState.cpp +++ b/src/core/SkBitmapProcState.cpp @@ -457,9 +457,11 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { } } - // At this point, we know exactly what kind of sampling the per-scanline - // shader will perform. + return this->chooseScanlineProcs(trivialMatrix, clampClamp, paint); +} +bool SkBitmapProcState::chooseScanlineProcs(bool trivialMatrix, bool clampClamp, + const SkPaint& paint) { fMatrixProc = this->chooseMatrixProc(trivialMatrix); // TODO(dominikg): SkASSERT(fMatrixProc) instead? chooseMatrixProc never returns NULL. if (NULL == fMatrixProc) { @@ -518,7 +520,7 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { return false; } - #if !SK_ARM_NEON_IS_ALWAYS +#if !SK_ARM_NEON_IS_ALWAYS static const SampleProc32 gSkBitmapProcStateSample32[] = { S32_opaque_D32_nofilter_DXDY, S32_alpha_D32_nofilter_DXDY, @@ -588,7 +590,7 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { // Don't support A8 -> 565 NULL, NULL, NULL, NULL }; - #endif +#endif fSampleProc32 = SK_ARM_NEON_WRAP(gSkBitmapProcStateSample32)[index]; index >>= 1; // shift away any opaque/alpha distinction @@ -612,10 +614,10 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { fShaderProc32 = this->chooseShaderProc32(); } } - + // see if our platform has any accelerated overrides this->platformProcs(); - + return true; } |