diff options
author | Mike Reed <reed@google.com> | 2017-08-07 12:36:20 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-07 18:46:40 +0000 |
commit | 8aeec29bec673e7a3585625dc48e00e51897d474 (patch) | |
tree | 6b193d9a300aea3cf08658385e3a88b72cdb026a /src/core/SkBlitter_ARGB32.cpp | |
parent | 0f5505bfa2c5c069b5279745bb64a6e3e9f4d15a (diff) |
simplify shaderbase -- remove shaderproc -- no measurable speed diff
Bug: skia:
Change-Id: Id355e3e480847fe78f904735e59353c4eb3ba2bb
Reviewed-on: https://skia-review.googlesource.com/31560
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkBlitter_ARGB32.cpp')
-rw-r--r-- | src/core/SkBlitter_ARGB32.cpp | 65 |
1 files changed, 18 insertions, 47 deletions
diff --git a/src/core/SkBlitter_ARGB32.cpp b/src/core/SkBlitter_ARGB32.cpp index 1507368e05..ce0b14bb27 100644 --- a/src/core/SkBlitter_ARGB32.cpp +++ b/src/core/SkBlitter_ARGB32.cpp @@ -423,21 +423,11 @@ void SkARGB32_Shader_Blitter::blitRect(int x, int y, int width, int height) { } if (fShadeDirectlyIntoDevice) { - void* ctx; - auto shadeProc = shaderContext->asAShadeProc(&ctx); - if (shadeProc) { - do { - shadeProc(ctx, x, y, device, width); - y += 1; - device = (uint32_t*)((char*)device + deviceRB); - } while (--height > 0); - } else { - do { - shaderContext->shadeSpan(x, y, device, width); - y += 1; - device = (uint32_t*)((char*)device + deviceRB); - } while (--height > 0); - } + do { + shaderContext->shadeSpan(x, y, device, width); + y += 1; + device = (uint32_t*)((char*)device + deviceRB); + } while (--height > 0); } else { SkXfermode* xfer = fXfermode; if (xfer) { @@ -633,39 +623,20 @@ void SkARGB32_Shader_Blitter::blitV(int x, int y, int height, SkAlpha alpha) { } if (fShadeDirectlyIntoDevice) { - void* ctx; - auto shadeProc = shaderContext->asAShadeProc(&ctx); if (255 == alpha) { - if (shadeProc) { - do { - shadeProc(ctx, x, y, device, 1); - y += 1; - device = (uint32_t*)((char*)device + deviceRB); - } while (--height > 0); - } else { - do { - shaderContext->shadeSpan(x, y, device, 1); - y += 1; - device = (uint32_t*)((char*)device + deviceRB); - } while (--height > 0); - } - } else { // alpha < 255 - SkPMColor c; - if (shadeProc) { - do { - shadeProc(ctx, x, y, &c, 1); - *device = SkFourByteInterp(c, *device, alpha); - y += 1; - device = (uint32_t*)((char*)device + deviceRB); - } while (--height > 0); - } else { - do { - shaderContext->shadeSpan(x, y, &c, 1); - *device = SkFourByteInterp(c, *device, alpha); - y += 1; - device = (uint32_t*)((char*)device + deviceRB); - } while (--height > 0); - } + do { + shaderContext->shadeSpan(x, y, device, 1); + y += 1; + device = (uint32_t*)((char*)device + deviceRB); + } while (--height > 0); + } else { + do { + SkPMColor c; + shaderContext->shadeSpan(x, y, &c, 1); + *device = SkFourByteInterp(c, *device, alpha); + y += 1; + device = (uint32_t*)((char*)device + deviceRB); + } while (--height > 0); } } else { SkPMColor* span = fBuffer; |