aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkDraw_vertices.cpp2
-rw-r--r--src/core/SkRasterPipeline.cpp9
-rw-r--r--src/core/SkRasterPipeline.h3
-rw-r--r--src/opts/SkRasterPipeline_opts.h12
-rw-r--r--src/shaders/SkImageShader.cpp2
-rw-r--r--src/shaders/SkShader.cpp2
-rw-r--r--src/shaders/gradients/SkGradientShader.cpp2
7 files changed, 14 insertions, 18 deletions
diff --git a/src/core/SkDraw_vertices.cpp b/src/core/SkDraw_vertices.cpp
index 4c71d65e8d..3e292bb41a 100644
--- a/src/core/SkDraw_vertices.cpp
+++ b/src/core/SkDraw_vertices.cpp
@@ -87,7 +87,7 @@ protected:
return nullptr;
}
bool onAppendStages(const StageRec& rec) const override {
- rec.fPipeline->append_seed_shader();
+ rec.fPipeline->append(SkRasterPipeline::seed_shader);
rec.fPipeline->append(SkRasterPipeline::matrix_4x3, &fM43);
return true;
}
diff --git a/src/core/SkRasterPipeline.cpp b/src/core/SkRasterPipeline.cpp
index c7a0427b1f..8d980da9cf 100644
--- a/src/core/SkRasterPipeline.cpp
+++ b/src/core/SkRasterPipeline.cpp
@@ -22,7 +22,6 @@ void SkRasterPipeline::reset() {
void SkRasterPipeline::append(StockStage stage, void* ctx) {
SkASSERT(stage != uniform_color); // Please use append_constant_color().
- SkASSERT(stage != seed_shader); // Please use append_seed_shader().
this->unchecked_append(stage, ctx);
}
void SkRasterPipeline::unchecked_append(StockStage stage, void* ctx) {
@@ -163,11 +162,3 @@ void SkRasterPipeline::append_matrix(SkArenaAlloc* alloc, const SkMatrix& matrix
}
}
}
-
-void SkRasterPipeline::append_seed_shader() {
- static const float iota[] = {
- 0.5f, 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f, 7.5f,
- 8.5f, 9.5f,10.5f,11.5f,12.5f,13.5f,14.5f,15.5f,
- };
- this->unchecked_append(SkRasterPipeline::seed_shader, const_cast<float*>(iota));
-}
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h
index a37ea44e0c..d5d5900419 100644
--- a/src/core/SkRasterPipeline.h
+++ b/src/core/SkRasterPipeline.h
@@ -149,9 +149,6 @@ public:
this->append_constant_color(alloc, color.vec());
}
- // Helper to append(seed_shader) with the normal {+0.5,+1.5,+2.5,...} argument it expects.
- void append_seed_shader();
-
bool empty() const { return fStages == nullptr; }
private:
diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h
index edc50732f3..56c8fa11d7 100644
--- a/src/opts/SkRasterPipeline_opts.h
+++ b/src/opts/SkRasterPipeline_opts.h
@@ -914,7 +914,11 @@ SI I32 cond_to_mask(I32 cond) { return if_then_else(cond, I32(~0), I32(0)); }
// Now finally, normal Stages!
-STAGE(seed_shader, const float* iota) {
+STAGE(seed_shader, Ctx::None) {
+ static const float iota[] = {
+ 0.5f, 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f, 7.5f,
+ 8.5f, 9.5f,10.5f,11.5f,12.5f,13.5f,14.5f,15.5f,
+ };
// It's important for speed to explicitly cast(dx) and cast(dy),
// which has the effect of splatting them to vectors before converting to floats.
// On Intel this breaks a data dependency on previous loop iterations' registers.
@@ -2591,7 +2595,11 @@ SI F abs_(F x) { return bit_cast<F>( bit_cast<I32>(x) & 0x7fffffff ); }
// ~~~~~~ Basic / misc. stages ~~~~~~ //
-STAGE_GG(seed_shader, const float* iota) {
+STAGE_GG(seed_shader, Ctx::None) {
+ static const float iota[] = {
+ 0.5f, 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f, 7.5f,
+ 8.5f, 9.5f,10.5f,11.5f,12.5f,13.5f,14.5f,15.5f,
+ };
x = cast<F>(I32(dx)) + unaligned_load<F>(iota);
y = cast<F>(I32(dy)) + 0.5f;
}
diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp
index a76edc053c..c3e6931baf 100644
--- a/src/shaders/SkImageShader.cpp
+++ b/src/shaders/SkImageShader.cpp
@@ -341,7 +341,7 @@ bool SkImageShader::onAppendStages(const StageRec& rec) const {
}
}
- p->append_seed_shader();
+ p->append(SkRasterPipeline::seed_shader);
struct MiscCtx {
std::unique_ptr<SkBitmapController::State> state;
diff --git a/src/shaders/SkShader.cpp b/src/shaders/SkShader.cpp
index 17b56a2e27..2dcba94983 100644
--- a/src/shaders/SkShader.cpp
+++ b/src/shaders/SkShader.cpp
@@ -232,7 +232,7 @@ bool SkShaderBase::onAppendStages(const StageRec& rec) const {
};
if (cb->ctx) {
- rec.fPipeline->append_seed_shader();
+ rec.fPipeline->append(SkRasterPipeline::seed_shader);
rec.fPipeline->append(SkRasterPipeline::callback, cb);
return true;
}
diff --git a/src/shaders/gradients/SkGradientShader.cpp b/src/shaders/gradients/SkGradientShader.cpp
index e5f0c7f33c..a6fb4e94bd 100644
--- a/src/shaders/gradients/SkGradientShader.cpp
+++ b/src/shaders/gradients/SkGradientShader.cpp
@@ -289,7 +289,7 @@ bool SkGradientShaderBase::onAppendStages(const StageRec& rec) const {
SkRasterPipeline_<256> postPipeline;
- p->append_seed_shader();
+ p->append(SkRasterPipeline::seed_shader);
p->append_matrix(alloc, matrix);
this->appendGradientStages(alloc, p, &postPipeline);