diff options
-rw-r--r-- | bench/SkRasterPipelineBench.cpp | 10 | ||||
-rw-r--r-- | dm/DMSrcSink.cpp | 2 | ||||
-rw-r--r-- | src/codec/SkWebpCodec.cpp | 2 | ||||
-rw-r--r-- | src/core/SkColorFilter.cpp | 2 | ||||
-rw-r--r-- | src/core/SkColorSpaceXform.cpp | 2 | ||||
-rw-r--r-- | src/core/SkColorSpaceXform_A2B.cpp | 2 | ||||
-rw-r--r-- | src/core/SkConvertPixels.cpp | 2 | ||||
-rw-r--r-- | src/core/SkPM4fPriv.h | 2 | ||||
-rw-r--r-- | src/core/SkRasterPipeline.h | 4 | ||||
-rw-r--r-- | src/core/SkRasterPipelineBlitter.cpp | 20 | ||||
-rw-r--r-- | src/images/SkImageEncoderFns.h | 14 | ||||
-rw-r--r-- | src/jumper/SkJumper.cpp | 8 | ||||
-rw-r--r-- | src/shaders/SkColorFilterShader.cpp | 2 | ||||
-rw-r--r-- | tests/F16StagesTest.cpp | 4 | ||||
-rw-r--r-- | tests/ParametricStageTest.cpp | 2 | ||||
-rw-r--r-- | tests/SRGBTest.cpp | 4 | ||||
-rw-r--r-- | tests/SkRasterPipelineTest.cpp | 14 |
17 files changed, 48 insertions, 48 deletions
diff --git a/bench/SkRasterPipelineBench.cpp b/bench/SkRasterPipelineBench.cpp index df130183b8..39e7c910da 100644 --- a/bench/SkRasterPipelineBench.cpp +++ b/bench/SkRasterPipelineBench.cpp @@ -59,7 +59,7 @@ public: } while (loops --> 0) { - p.run(0,N); + p.run(0,0,N); } } }; @@ -89,11 +89,11 @@ public: if (fCompile) { auto fn = p.compile(); while (loops --> 0) { - fn(0,N); + fn(0,0,N); } } else { while (loops --> 0) { - p.run(0,N); + p.run(0,0,N); } } } @@ -132,7 +132,7 @@ public: p.append(SkRasterPipeline::parametric_b, & to_2dot2); while (loops --> 0) { - p.run(0,N); + p.run(0,0,N); } } }; @@ -150,7 +150,7 @@ public: p.append(SkRasterPipeline::to_srgb); while (loops --> 0) { - p.run(0,N); + p.run(0,0,N); } } }; diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index 1985b1d0ce..2105350abb 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -333,7 +333,7 @@ static void premultiply_if_necessary(SkBitmap& bitmap) { p.append(SkRasterPipeline::load_f16, &row); p.append(SkRasterPipeline::premul); p.append(SkRasterPipeline::store_f16, &row); - p.run(0, bitmap.width()); + p.run(0,y, bitmap.width()); } break; case kN32_SkColorType: diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp index 829ebb8b73..700178ae9f 100644 --- a/src/codec/SkWebpCodec.cpp +++ b/src/codec/SkWebpCodec.cpp @@ -377,7 +377,7 @@ static void blend_line(SkColorType dstCT, void* dst, } p.append(store_dst, dst); - p.run(0, width); + p.run(0,0, width); } SkCodec::Result SkWebpCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t rowBytes, diff --git a/src/core/SkColorFilter.cpp b/src/core/SkColorFilter.cpp index 65b5c45308..a0b03c4210 100644 --- a/src/core/SkColorFilter.cpp +++ b/src/core/SkColorFilter.cpp @@ -65,7 +65,7 @@ SkColor4f SkColorFilter::filterColor4f(const SkColor4f& c) const { this->onAppendStages(&pipeline, nullptr, &alloc, c.fA == 1); SkPM4f* dstPtr = &dst; pipeline.append(SkRasterPipeline::store_f32, &dstPtr); - pipeline.run(0,1); + pipeline.run(0,0, 1); return dst.unpremul(); } diff --git a/src/core/SkColorSpaceXform.cpp b/src/core/SkColorSpaceXform.cpp index 0749aa40e6..8887bc279f 100644 --- a/src/core/SkColorSpaceXform.cpp +++ b/src/core/SkColorSpaceXform.cpp @@ -1313,7 +1313,7 @@ bool SkColorSpaceXform_XYZ<kCSM> return false; } - pipeline.run(0, len); + pipeline.run(0,0, len); return true; } diff --git a/src/core/SkColorSpaceXform_A2B.cpp b/src/core/SkColorSpaceXform_A2B.cpp index 1cbf411784..2e710f5cca 100644 --- a/src/core/SkColorSpaceXform_A2B.cpp +++ b/src/core/SkColorSpaceXform_A2B.cpp @@ -75,7 +75,7 @@ bool SkColorSpaceXform_A2B::onApply(ColorFormat dstFormat, void* dst, ColorForma default: return false; } - pipeline.run(0,count); + pipeline.run(0,0, count); return true; } diff --git a/src/core/SkConvertPixels.cpp b/src/core/SkConvertPixels.cpp index 1c201a704e..2ada61f14e 100644 --- a/src/core/SkConvertPixels.cpp +++ b/src/core/SkConvertPixels.cpp @@ -397,7 +397,7 @@ static void convert_with_pipeline(const SkImageInfo& dstInfo, void* dstRow, size auto run = pipeline.compile(); // This y is declared above when handling dither (which needs to know y). for (y = 0; y < srcInfo.height(); ++y) { - run(0,srcInfo.width()); + run(0,y, srcInfo.width()); // The pipeline has pointers to srcRow and dstRow, so we just need to update them in the // loop to move between rows of src/dst. dstRow = SkTAddOffset<void>(dstRow, dstRB); diff --git a/src/core/SkPM4fPriv.h b/src/core/SkPM4fPriv.h index 26f15579ea..700e1280da 100644 --- a/src/core/SkPM4fPriv.h +++ b/src/core/SkPM4fPriv.h @@ -157,7 +157,7 @@ static inline SkColor4f to_colorspace(const SkColor4f& c, SkColorSpace* src, SkC append_gamut_transform(&p, scratch_matrix_3x4, src, dst, kUnpremul_SkAlphaType); p.append(SkRasterPipeline::store_f32, &color4f_ptr); - p.run(0,1); + p.run(0,0,1); } return color4f; } diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h index 0769f701ef..39a2f1f8e6 100644 --- a/src/core/SkRasterPipeline.h +++ b/src/core/SkRasterPipeline.h @@ -135,10 +135,10 @@ public: void extend(const SkRasterPipeline&); // Runs the pipeline walking x through [x,x+n). - void run(size_t x, size_t n) const; + void run(size_t x, size_t y, size_t n) const; // Allocates a thunk which amortizes run() setup cost in alloc. - std::function<void(size_t, size_t)> compile() const; + std::function<void(size_t, size_t, size_t)> compile() const; void dump() const; diff --git a/src/core/SkRasterPipelineBlitter.cpp b/src/core/SkRasterPipelineBlitter.cpp index a34609ff80..2f28eec78c 100644 --- a/src/core/SkRasterPipelineBlitter.cpp +++ b/src/core/SkRasterPipelineBlitter.cpp @@ -67,10 +67,10 @@ private: uint64_t fMemsetColor = 0; // Big enough for largest dst format, F16. // Built lazily on first use. - std::function<void(size_t, size_t)> fBlitH, - fBlitAntiH, - fBlitMaskA8, - fBlitMaskLCD16; + std::function<void(size_t, size_t, size_t)> fBlitH, + fBlitAntiH, + fBlitMaskA8, + fBlitMaskLCD16; // These values are pointed to by the blit pipelines above, // which allows us to adjust them from call to call. @@ -211,7 +211,7 @@ SkBlitter* SkRasterPipelineBlitter::Create(const SkPixmap& dst, if (is_constant) { auto constantColor = alloc->make<SkPM4f>(); colorPipeline->append(SkRasterPipeline::store_f32, &constantColor); - colorPipeline->run(0,1); + colorPipeline->run(0,0,1); colorPipeline->reset(); colorPipeline->append(SkRasterPipeline::constant_color, constantColor); @@ -232,7 +232,7 @@ SkBlitter* SkRasterPipelineBlitter::Create(const SkPixmap& dst, p.extend(*colorPipeline); blitter->fDstPtr = &blitter->fMemsetColor; blitter->append_store(&p); - p.run(0,1); + p.run(0,0,1); blitter->fCanMemsetInBlitH = true; } @@ -336,7 +336,7 @@ void SkRasterPipelineBlitter::blitH(int x, int y, int w) { fBlitH = p.compile(); } this->maybe_shade(x,y,w); - fBlitH(x,w); + fBlitH(x,y,w); } void SkRasterPipelineBlitter::blitAntiH(int x, int y, const SkAlpha aa[], const int16_t runs[]) { @@ -366,7 +366,7 @@ void SkRasterPipelineBlitter::blitAntiH(int x, int y, const SkAlpha aa[], const default: this->maybe_shade(x,y,run); fCurrentCoverage = *aa * (1/255.0f); - fBlitAntiH(x,run); + fBlitAntiH(x,y,run); } x += run; runs += run; @@ -417,11 +417,11 @@ void SkRasterPipelineBlitter::blitMask(const SkMask& mask, const SkIRect& clip) switch (mask.fFormat) { case SkMask::kA8_Format: fMaskPtr = mask.getAddr8(x,y)-x; - fBlitMaskA8(x,clip.width()); + fBlitMaskA8(x,y,clip.width()); break; case SkMask::kLCD16_Format: fMaskPtr = mask.getAddrLCD16(x,y)-x; - fBlitMaskLCD16(x,clip.width()); + fBlitMaskLCD16(x,y,clip.width()); break; default: // TODO diff --git a/src/images/SkImageEncoderFns.h b/src/images/SkImageEncoderFns.h index dfe5001578..f5a33e5d67 100644 --- a/src/images/SkImageEncoderFns.h +++ b/src/images/SkImageEncoderFns.h @@ -162,7 +162,7 @@ static inline void transform_scanline_unpremultiply_sRGB(void* dst, const void* p.append(SkRasterPipeline::unpremul); p.append(SkRasterPipeline::to_srgb); p.append(SkRasterPipeline::store_8888, &dst); - p.run(0, width); + p.run(0,0, width); } /** @@ -186,7 +186,7 @@ static inline void transform_scanline_to_premul_linear(char* SK_RESTRICT dst, p.append(SkRasterPipeline::premul); p.append(SkRasterPipeline::to_srgb); p.append(SkRasterPipeline::store_8888, (void**) &dst); - p.run(0, width); + p.run(0,0, width); } /** @@ -258,7 +258,7 @@ static inline void transform_scanline_F16(char* SK_RESTRICT dst, const char* SK_ p.append(SkRasterPipeline::load_f16, (const void**) &src); p.append(SkRasterPipeline::to_srgb); p.append(SkRasterPipeline::store_u16_be, (void**) &dst); - p.run(0, width); + p.run(0,0, width); } /** @@ -271,7 +271,7 @@ static inline void transform_scanline_F16_premul(char* SK_RESTRICT dst, const ch p.append(SkRasterPipeline::unpremul); p.append(SkRasterPipeline::to_srgb); p.append(SkRasterPipeline::store_u16_be, (void**) &dst); - p.run(0, width); + p.run(0,0, width); } /** @@ -284,7 +284,7 @@ static inline void transform_scanline_F16_to_8888(char* SK_RESTRICT dst, p.append(SkRasterPipeline::load_f16, (const void**) &src); p.append(SkRasterPipeline::to_srgb); p.append(SkRasterPipeline::store_8888, (void**) &dst); - p.run(0, width); + p.run(0,0, width); } /** @@ -298,7 +298,7 @@ static inline void transform_scanline_F16_premul_to_8888(char* SK_RESTRICT dst, p.append(SkRasterPipeline::unpremul); p.append(SkRasterPipeline::to_srgb); p.append(SkRasterPipeline::store_8888, (void**) &dst); - p.run(0, width); + p.run(0,0, width); } /** @@ -311,7 +311,7 @@ static inline void transform_scanline_F16_to_premul_8888(char* SK_RESTRICT dst, p.append(SkRasterPipeline::premul); p.append(SkRasterPipeline::to_srgb); p.append(SkRasterPipeline::store_8888, (void**) &dst); - p.run(0, width); + p.run(0,0, width); } static inline sk_sp<SkData> icc_from_color_space(const SkColorSpace& cs) { diff --git a/src/jumper/SkJumper.cpp b/src/jumper/SkJumper.cpp index 795483fd9e..6593888d78 100644 --- a/src/jumper/SkJumper.cpp +++ b/src/jumper/SkJumper.cpp @@ -184,7 +184,7 @@ void SkRasterPipeline::BuildPipeline(const StageList* st, } } -void SkRasterPipeline::run(size_t x, size_t n) const { +void SkRasterPipeline::run(size_t x, size_t y, size_t n) const { if (this->empty()) { return; } @@ -198,16 +198,16 @@ void SkRasterPipeline::run(size_t x, size_t n) const { gEngine.start_pipeline(x, program.get(), &kConstants, limit); } -std::function<void(size_t, size_t)> SkRasterPipeline::compile() const { +std::function<void(size_t, size_t, size_t)> SkRasterPipeline::compile() const { if (this->empty()) { - return [](size_t, size_t) {}; + return [](size_t, size_t, size_t) {}; } gChooseEngineOnce([]{ gEngine = choose_engine(); }); void** program = fAlloc->makeArray<void*>(fSlotsNeeded); BuildPipeline(fStages, gEngine, program + fSlotsNeeded); - return [=](size_t x, size_t n) { + return [=](size_t x, size_t y, size_t n) { const size_t limit = x+n; gEngine.start_pipeline(x, program, &kConstants, limit); }; diff --git a/src/shaders/SkColorFilterShader.cpp b/src/shaders/SkColorFilterShader.cpp index 549f396b5a..b7d6b15da2 100644 --- a/src/shaders/SkColorFilterShader.cpp +++ b/src/shaders/SkColorFilterShader.cpp @@ -110,7 +110,7 @@ void SkColorFilterShader::FilterShaderContext::shadeSpan4f(int x, int y, SkPM4f filterShader.fFilter->appendStages(&pipeline, nullptr, &alloc, filterShader.isOpaque()); SkPM4f* dst = result; pipeline.append(SkRasterPipeline::store_f32, &dst); - pipeline.run(0, count); + pipeline.run(0,y, count); } #if SK_SUPPORT_GPU diff --git a/tests/F16StagesTest.cpp b/tests/F16StagesTest.cpp index cdf2daf09a..51cb861c89 100644 --- a/tests/F16StagesTest.cpp +++ b/tests/F16StagesTest.cpp @@ -25,7 +25,7 @@ DEF_TEST(F16Stages, r) { SkRasterPipeline_<256> p; p.append(SkRasterPipeline:: load_f32, &f32); p.append(SkRasterPipeline::store_f16, &f16); - p.run(0,16/4); + p.run(0,0,16/4); } REPORTER_ASSERT(r, f16[0] == 0x0000); REPORTER_ASSERT(r, f16[1] == 0x3400); @@ -40,7 +40,7 @@ DEF_TEST(F16Stages, r) { SkRasterPipeline_<256> p; p.append(SkRasterPipeline:: load_f16, &f16); p.append(SkRasterPipeline::store_f32, &f32); - p.run(0,16/4); + p.run(0,0,16/4); } REPORTER_ASSERT(r, f32[0] == 0.00f); REPORTER_ASSERT(r, f32[1] == 0.25f); diff --git a/tests/ParametricStageTest.cpp b/tests/ParametricStageTest.cpp index 6edb9d9473..5b34e166c9 100644 --- a/tests/ParametricStageTest.cpp +++ b/tests/ParametricStageTest.cpp @@ -27,7 +27,7 @@ static void check_error(skiatest::Reporter* r, float limit, SkColorSpaceTransfer p.append(SkRasterPipeline::parametric_a, &fn); p.append(SkRasterPipeline::store_f32, &op); - p.run(0, 256/4); + p.run(0,0, 256/4); for (int i = 0; i < 256; i++) { diff --git a/tests/SRGBTest.cpp b/tests/SRGBTest.cpp index b1e4570f50..4a519ca55b 100644 --- a/tests/SRGBTest.cpp +++ b/tests/SRGBTest.cpp @@ -54,7 +54,7 @@ DEF_TEST(sk_pipeline_srgb_roundtrip, r) { p.append(SkRasterPipeline::to_srgb); p.append(SkRasterPipeline::store_8888, &ptr); - p.run(0,256); + p.run(0,0,256); for (int i = 0; i < 256; i++) { if (reds[i] != (uint32_t)i) { @@ -73,7 +73,7 @@ DEF_TEST(sk_pipeline_srgb_edge_cases, r) { p.append(SkRasterPipeline::constant_color, &color); p.append(SkRasterPipeline::to_srgb); p.append(SkRasterPipeline::store_f32, &dst); - p.run(0,4); + p.run(0,0,4); if (color.r() != 0.0f) { ERRORF(r, "expected to_srgb() to map 0.0f to 0.0f, got %f", color.r()); diff --git a/tests/SkRasterPipelineTest.cpp b/tests/SkRasterPipelineTest.cpp index 1af40fd5f6..f65a2c9868 100644 --- a/tests/SkRasterPipelineTest.cpp +++ b/tests/SkRasterPipelineTest.cpp @@ -27,7 +27,7 @@ DEF_TEST(SkRasterPipeline, r) { p.append(SkRasterPipeline::swap); p.append(SkRasterPipeline::srcover); p.append(SkRasterPipeline::store_f16, &store_ctx); - p.run(0,1); + p.run(0,0,1); // We should see half-intensity magenta. REPORTER_ASSERT(r, ((result >> 0) & 0xffff) == 0x3800); @@ -39,7 +39,7 @@ DEF_TEST(SkRasterPipeline, r) { DEF_TEST(SkRasterPipeline_empty, r) { // No asserts... just a test that this is safe to run. SkRasterPipeline_<256> p; - p.run(0,20); + p.run(0,0,20); } DEF_TEST(SkRasterPipeline_nonsense, r) { @@ -47,7 +47,7 @@ DEF_TEST(SkRasterPipeline_nonsense, r) { // srcover() calls st->next(); this makes sure we've always got something there to call. SkRasterPipeline_<256> p; p.append(SkRasterPipeline::srcover); - p.run(0,20); + p.run(0,0,20); } DEF_TEST(SkRasterPipeline_JIT, r) { @@ -69,7 +69,7 @@ DEF_TEST(SkRasterPipeline_JIT, r) { SkRasterPipeline_<256> p; p.append(SkRasterPipeline:: load_8888, &src); p.append(SkRasterPipeline::store_8888, &dst); - p.run(15, 20); + p.run(15,0, 20); for (int i = 0; i < 36; i++) { if (i < 15 || i == 35) { @@ -120,7 +120,7 @@ DEF_TEST(SkRasterPipeline_tail, r) { SkRasterPipeline_<256> p; p.append(SkRasterPipeline::load_f32, &src); p.append(SkRasterPipeline::store_f32, &dst); - p.run(0, i); + p.run(0,0, i); for (unsigned j = 0; j < i; j++) { for (unsigned k = 0; k < 4; k++) { if (buffer[j][k] != data[j][k]) { @@ -152,7 +152,7 @@ DEF_TEST(SkRasterPipeline_tail, r) { SkRasterPipeline_<256> p; p.append(SkRasterPipeline::load_f16, &src); p.append(SkRasterPipeline::store_f16, &dst); - p.run(0, i); + p.run(0,0, i); for (unsigned j = 0; j < i; j++) { REPORTER_ASSERT(r, !memcmp(&data[j][0], &buffer[j][0], sizeof(buffer[j]))); @@ -189,7 +189,7 @@ DEF_TEST(SkRasterPipeline_tail, r) { SkRasterPipeline_<256> p; p.append(SkRasterPipeline::load_rgb_u16_be, &src); p.append(SkRasterPipeline::store_f32, &dst); - p.run(0, i); + p.run(0,0, i); for (unsigned j = 0; j < i; j++) { for (unsigned k = 0; k < 4; k++) { if (buffer[j][k] != answer[j][k]) { |