diff options
author | Mike Klein <mtklein@chromium.org> | 2017-04-12 11:51:11 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-12 16:44:31 +0000 |
commit | 994ef97339a085b6d15432ed43f3ecc1776a3852 (patch) | |
tree | 1522e73bcbddcd6b4fc5ce47560ff13b624708b0 /src | |
parent | 8e02684311a25df0c07e4d104022edf4200838b8 (diff) |
make all gather_*() use SkJumper_GatherCtx
SkJumper_GatherCtx is a prefix of SkImageShaderContext, so
this is a no-op. It helps to keep things straight, and I
do want to split apart the GatherCtx from a new SamplingCtx.
Change-Id: I9c5f436b096624c2809e1f810e9bcd6c6b00b883
Reviewed-on: https://skia-review.googlesource.com/13264
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/jumper/SkJumper.h | 2 | ||||
-rw-r--r-- | src/jumper/SkJumper_stages.cpp | 4 | ||||
-rw-r--r-- | src/opts/SkRasterPipeline_opts.h | 17 |
3 files changed, 12 insertions, 11 deletions
diff --git a/src/jumper/SkJumper.h b/src/jumper/SkJumper.h index e41625076e..b440391f38 100644 --- a/src/jumper/SkJumper.h +++ b/src/jumper/SkJumper.h @@ -56,7 +56,7 @@ struct SkJumper_constants { float iota[8]; // 0,1,2,3,4,5,6,7 }; -struct GatherCtx { +struct SkJumper_GatherCtx { const void* pixels; const uint32_t* ctable; int stride; diff --git a/src/jumper/SkJumper_stages.cpp b/src/jumper/SkJumper_stages.cpp index a4f3242ecd..82191c91b8 100644 --- a/src/jumper/SkJumper_stages.cpp +++ b/src/jumper/SkJumper_stages.cpp @@ -279,7 +279,7 @@ SI void from_8888(U32 _8888, F* r, F* g, F* b, F* a) { } template <typename T> -SI U32 ix_and_ptr(T** ptr, const GatherCtx* ctx, F x, F y) { +SI U32 ix_and_ptr(T** ptr, const SkJumper_GatherCtx* ctx, F x, F y) { *ptr = (const T*)ctx->pixels; return trunc_(y)*ctx->stride + trunc_(x); } @@ -678,7 +678,7 @@ STAGE(gather_g8) { } STAGE(gather_i8) { - auto c = (const GatherCtx*)ctx; + auto c = (const SkJumper_GatherCtx*)ctx; const uint8_t* ptr; U32 ix = ix_and_ptr(&ptr, ctx, r,g); ix = expand(gather(ptr, ix)); diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h index 44cbe83618..fd7a9e5b1a 100644 --- a/src/opts/SkRasterPipeline_opts.h +++ b/src/opts/SkRasterPipeline_opts.h @@ -20,6 +20,7 @@ #include "SkRasterPipeline.h" #include "SkShader.h" #include "SkSRGB.h" +#include "../jumper/SkJumper.h" namespace { @@ -975,7 +976,7 @@ STAGE_CTX(bicubic_p3y, SkImageShaderContext*) { bicubic_y<+3>(ctx, &g); } template <typename T> -SI SkNi offset_and_ptr(T** ptr, const SkImageShaderContext* ctx, const SkNf& x, const SkNf& y) { +SI SkNi offset_and_ptr(T** ptr, const SkJumper_GatherCtx* ctx, const SkNf& x, const SkNf& y) { SkNi ix = SkNx_cast<int>(x), iy = SkNx_cast<int>(y); SkNi offset = iy*ctx->stride + ix; @@ -984,47 +985,47 @@ SI SkNi offset_and_ptr(T** ptr, const SkImageShaderContext* ctx, const SkNf& x, return offset; } -STAGE_CTX(gather_a8, const SkImageShaderContext*) { +STAGE_CTX(gather_a8, const SkJumper_GatherCtx*) { const uint8_t* p; SkNi offset = offset_and_ptr(&p, ctx, r, g); r = g = b = 0.0f; a = SkNf_from_byte(gather(tail, p, offset)); } -STAGE_CTX(gather_i8, const SkImageShaderContext*) { +STAGE_CTX(gather_i8, const SkJumper_GatherCtx*) { const uint8_t* p; SkNi offset = offset_and_ptr(&p, ctx, r, g); SkNi ix = SkNx_cast<int>(gather(tail, p, offset)); from_8888(gather(tail, ctx->ctable, ix), &r, &g, &b, &a); } -STAGE_CTX(gather_g8, const SkImageShaderContext*) { +STAGE_CTX(gather_g8, const SkJumper_GatherCtx*) { const uint8_t* p; SkNi offset = offset_and_ptr(&p, ctx, r, g); r = g = b = SkNf_from_byte(gather(tail, p, offset)); a = 1.0f; } -STAGE_CTX(gather_565, const SkImageShaderContext*) { +STAGE_CTX(gather_565, const SkJumper_GatherCtx*) { const uint16_t* p; SkNi offset = offset_and_ptr(&p, ctx, r, g); from_565(gather(tail, p, offset), &r, &g, &b); a = 1.0f; } -STAGE_CTX(gather_4444, const SkImageShaderContext*) { +STAGE_CTX(gather_4444, const SkJumper_GatherCtx*) { const uint16_t* p; SkNi offset = offset_and_ptr(&p, ctx, r, g); from_4444(gather(tail, p, offset), &r, &g, &b, &a); } -STAGE_CTX(gather_8888, const SkImageShaderContext*) { +STAGE_CTX(gather_8888, const SkJumper_GatherCtx*) { const uint32_t* p; SkNi offset = offset_and_ptr(&p, ctx, r, g); from_8888(gather(tail, p, offset), &r, &g, &b, &a); } -STAGE_CTX(gather_f16, const SkImageShaderContext*) { +STAGE_CTX(gather_f16, const SkJumper_GatherCtx*) { const uint64_t* p; SkNi offset = offset_and_ptr(&p, ctx, r, g); |