aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDraw_vertices.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-08-29 14:58:19 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-29 20:10:31 +0000
commit1d8c42eb903b66035ecf4d45b03dfeb1ad07b957 (patch)
treebddb7925865421ff762ae7e458ae3c24b6be477e /src/core/SkDraw_vertices.cpp
parent8b0f265f70703fa96c6d9011b1d8440e60d63632 (diff)
fold params into StageRec
pre-CL before trying to add a hint-rect field to allow shaders to "optimize" their stages for a given restriction in device space - e.g. if the shader's intrinsic domain is contained, it won't need to tile/clamp Bug: skia: Change-Id: Ia2da557691da25f31e4b9e3f53c3bc6709b89083 Reviewed-on: https://skia-review.googlesource.com/40224 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkDraw_vertices.cpp')
-rw-r--r--src/core/SkDraw_vertices.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/SkDraw_vertices.cpp b/src/core/SkDraw_vertices.cpp
index 8df9946b2b..c7d439d123 100644
--- a/src/core/SkDraw_vertices.cpp
+++ b/src/core/SkDraw_vertices.cpp
@@ -86,16 +86,15 @@ protected:
Context* onMakeContext(const ContextRec& rec, SkArenaAlloc* alloc) const override {
return nullptr;
}
- bool onAppendStages(SkRasterPipeline* pipeline, SkColorSpace* dstCS, SkArenaAlloc* alloc,
- const SkMatrix&, const SkPaint&, const SkMatrix*) const override {
- pipeline->append(SkRasterPipeline::seed_shader);
- pipeline->append(SkRasterPipeline::matrix_4x3, &fM43);
+ bool onAppendStages(const StageRec& rec) const override {
+ rec.fPipeline->append(SkRasterPipeline::seed_shader);
+ rec.fPipeline->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.
- pipeline->append(SkRasterPipeline::clamp_0);
- pipeline->append(SkRasterPipeline::clamp_a);
+ rec.fPipeline->append(SkRasterPipeline::clamp_0);
+ rec.fPipeline->append(SkRasterPipeline::clamp_a);
return true;
}