aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDraw_vertices.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-06-01 14:43:51 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-01 19:23:10 +0000
commit5df94d508ecfb62d54b757961dba611a00ff563c (patch)
tree3c1d188883c341bc22f712ed5e1508fb52e85224 /src/core/SkDraw_vertices.cpp
parente0f7e164eed88912ee708de57da25ad05933366f (diff)
have shaders that need seed_shader call it themselves
This ought to make compose shader and our sprite blitter a bit more efficient. Compose shader can simply re-seed instead of saving the xy values off to a buffer. The sprite blitter doesn't need xy at all. Change-Id: Ib4b3509288810f74a4c8e2978ce2ca14d8644980 Reviewed-on: https://skia-review.googlesource.com/18405 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkDraw_vertices.cpp')
-rw-r--r--src/core/SkDraw_vertices.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/SkDraw_vertices.cpp b/src/core/SkDraw_vertices.cpp
index 6b6ba9c555..662a6ff187 100644
--- a/src/core/SkDraw_vertices.cpp
+++ b/src/core/SkDraw_vertices.cpp
@@ -86,15 +86,16 @@ protected:
Context* onMakeContext(const ContextRec& rec, SkArenaAlloc* alloc) const override {
return nullptr;
}
- bool onAppendStages(SkRasterPipeline* pipeine, SkColorSpace* dstCS, SkArenaAlloc* alloc,
+ bool onAppendStages(SkRasterPipeline* pipeline, SkColorSpace* dstCS, SkArenaAlloc* alloc,
const SkMatrix&, const SkPaint&, const SkMatrix*) const override {
- pipeine->append(SkRasterPipeline::matrix_4x3, &fM43);
+ pipeline->append(SkRasterPipeline::seed_shader);
+ pipeline->append(SkRasterPipeline::matrix_4x3, &fM43);
// In theory we should never need to clamp. However, either due to imprecision in our
// matrix43, or the scan converter passing us pixel centers that in fact are not within
// the triangle, we do see occasional (slightly) out-of-range values, so we add these
// clamp stages. It would be nice to find a way to detect when these are not needed.
- pipeine->append(SkRasterPipeline::clamp_0);
- pipeine->append(SkRasterPipeline::clamp_a);
+ pipeline->append(SkRasterPipeline::clamp_0);
+ pipeline->append(SkRasterPipeline::clamp_a);
return true;
}