diff options
author | Mike Klein <mtklein@chromium.org> | 2017-05-22 08:28:45 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-22 14:08:06 +0000 |
commit | 1859f69d20e433b86714e5b9002121f2b20a5fc6 (patch) | |
tree | 097f171547166eae0e1d7818c7b313a727d113b2 /src/core/SkRasterPipeline.cpp | |
parent | f94514b0ff8eccb2eaef8c77bee8c5f462b83b90 (diff) |
some basic speed ups for SkRasterPipeline::append()
The new bench demos the speedup:
SkRasterPipelineReuse_…
…full 1x …some 1.8x …none 5.22x
Change-Id: I5e51fb4316ae04558710ce62560850584ccb4aea
Reviewed-on: https://skia-review.googlesource.com/17449
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkRasterPipeline.cpp')
-rw-r--r-- | src/core/SkRasterPipeline.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/SkRasterPipeline.cpp b/src/core/SkRasterPipeline.cpp index d307bdd118..ab404446e0 100644 --- a/src/core/SkRasterPipeline.cpp +++ b/src/core/SkRasterPipeline.cpp @@ -7,7 +7,13 @@ #include "SkRasterPipeline.h" -SkRasterPipeline::SkRasterPipeline() {} +SkRasterPipeline::SkRasterPipeline(int size_hint) { + fStages.reserve(size_hint); +} + +void SkRasterPipeline::rewind() { + fStages.clear(); +} void SkRasterPipeline::append(StockStage stage, void* ctx) { SkASSERT(stage != from_srgb); |