aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders/gradients/SkRadialGradient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shaders/gradients/SkRadialGradient.cpp')
-rw-r--r--src/shaders/gradients/SkRadialGradient.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/shaders/gradients/SkRadialGradient.cpp b/src/shaders/gradients/SkRadialGradient.cpp
index 0a6a940b18..658ee55d3a 100644
--- a/src/shaders/gradients/SkRadialGradient.cpp
+++ b/src/shaders/gradients/SkRadialGradient.cpp
@@ -48,7 +48,11 @@ SkShaderBase::Context* SkRadialGradient::onMakeContext(
SkRadialGradient::RadialGradientContext::RadialGradientContext(
const SkRadialGradient& shader, const ContextRec& rec)
- : INHERITED(shader, rec) {}
+ : INHERITED(shader, rec) {
+#ifndef SK_SUPPORT_LEGACY_RADIAL_GRADIENT
+ SkASSERT(shader.getTileMode() == SkShader::kClamp_TileMode);
+#endif
+}
SkShader::GradientType SkRadialGradient::asAGradient(GradientInfo* info) const {
if (info) {
@@ -359,6 +363,15 @@ sk_sp<SkShader> SkRadialGradient::onMakeColorSpace(SkColorSpaceXformer* xformer)
&this->getLocalMatrix());
}
+bool SkRadialGradient::onIsRasterPipelineOnly() const {
+#ifdef SK_SUPPORT_LEGACY_RADIAL_GRADIENT
+ return false;
+#else
+ // We have a clamp fast path; everything else -> RP.
+ return fTileMode != SkShader::kClamp_TileMode;
+#endif
+}
+
bool SkRadialGradient::adjustMatrixAndAppendStages(SkArenaAlloc* alloc,
SkMatrix* matrix,
SkRasterPipeline* p,