Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: src/core/SkRasterPipeline.cpp

Issue 2146413002: Add SkRasterPipeline blitter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Do not leak the blitter. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRasterPipeline.h ('k') | src/core/SkRasterPipelineBlitter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRasterPipeline.cpp
diff --git a/src/core/SkRasterPipeline.cpp b/src/core/SkRasterPipeline.cpp
index 899142886c0f564240187ce67d790dd08a72d35f..c50383af01055f0c77cf282fdfd748cb434314bd 100644
--- a/src/core/SkRasterPipeline.cpp
+++ b/src/core/SkRasterPipeline.cpp
@@ -22,11 +22,23 @@ void SkRasterPipeline::append(SkRasterPipeline::Fn body_fn, const void* body_ctx
fTail.push_back({ &JustReturn, const_cast<void*>(tail_ctx) });
}
-void SkRasterPipeline::run(size_t n) {
+void SkRasterPipeline::extend(const SkRasterPipeline& src) {
+ SkASSERT(src.fBody.count() == src.fTail.count());
+
+ Fn body_fn = src.fBodyStart,
+ tail_fn = src.fTailStart;
+ for (int i = 0; i < src.fBody.count(); i++) {
+ this->append(body_fn, src.fBody[i].fCtx,
+ tail_fn, src.fTail[i].fCtx);
+ body_fn = src.fBody[i].fNext;
+ tail_fn = src.fTail[i].fNext;
+ }
+}
+
+void SkRasterPipeline::run(size_t x, size_t n) {
// It's fastest to start uninitialized if the compilers all let us. If not, next fastest is 0.
Sk4f v;
- size_t x = 0;
while (n >= 4) {
fBodyStart(fBody.begin(), x, v,v,v,v, v,v,v,v);
x += 4;
« no previous file with comments | « src/core/SkRasterPipeline.h ('k') | src/core/SkRasterPipelineBlitter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698