separate out the scaline-choosing to simplify chooseProcs
BUG=skia:
TBR=
Review URL: https://codereview.chromium.org/796063007
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index ab38b6b..ada974a 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -457,9 +457,11 @@
}
}
- // 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 @@
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 @@
// 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 @@
fShaderProc32 = this->chooseShaderProc32();
}
}
-
+
// see if our platform has any accelerated overrides
this->platformProcs();
-
+
return true;
}
diff --git a/src/core/SkBitmapProcState.h b/src/core/SkBitmapProcState.h
index add5bf4..fa934dc 100644
--- a/src/core/SkBitmapProcState.h
+++ b/src/core/SkBitmapProcState.h
@@ -135,6 +135,7 @@
MatrixProc chooseMatrixProc(bool trivial_matrix);
bool chooseProcs(const SkMatrix& inv, const SkPaint&);
+ bool chooseScanlineProcs(bool trivialMatrix, bool clampClamp, const SkPaint& paint);
ShaderProc32 chooseShaderProc32();
// returns false if we did not try to scale the image. In that case, we