diff options
author | mtklein <mtklein@google.com> | 2015-04-27 14:51:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-27 14:51:16 -0700 |
commit | 641c3ff7c680ef7935d47d2e68f8301acc79e3de (patch) | |
tree | 0739bd83543af31c22ef25e1b352cedb56a4ee77 /src/core/SkBlitter_ARGB32.cpp | |
parent | d65dc0cedd5b50dd407b6ff8fdc39123f11511cc (diff) |
Revert of De-proc Color32 (patchset #5 id:80001 of https://codereview.chromium.org/1104183004/)
Reason for revert:
duh
Original issue's description:
> De-proc Color32
>
> Also strips SK_SUPPORT_LEGACY_COLOR32_MATH,
> which is no longer needed.
>
> Seems handy to have SkTypes include the relevant intrinsics when
> we know we've got them, but I'm not married to it.
>
> Locally this looks like a pointlessly small perf win, but I'm mostly
> keen to get all the code together.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/376e9bc206b69d9190f38dfebb132a8769bbd72b
>
> Committed: https://skia.googlesource.com/skia/+/d65dc0cedd5b50dd407b6ff8fdc39123f11511cc
TBR=reed@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1102363006
Diffstat (limited to 'src/core/SkBlitter_ARGB32.cpp')
-rw-r--r-- | src/core/SkBlitter_ARGB32.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/SkBlitter_ARGB32.cpp b/src/core/SkBlitter_ARGB32.cpp index f2de82a2e9..96280b7baa 100644 --- a/src/core/SkBlitter_ARGB32.cpp +++ b/src/core/SkBlitter_ARGB32.cpp @@ -52,6 +52,7 @@ SkARGB32_Blitter::SkARGB32_Blitter(const SkBitmap& device, const SkPaint& paint) fSrcB = SkAlphaMul(SkColorGetB(color), scale); fPMColor = SkPackARGB32(fSrcA, fSrcR, fSrcG, fSrcB); + fColor32Proc = SkBlitRow::ColorProcFactory(); } const SkBitmap* SkARGB32_Blitter::justAnOpaqueColor(uint32_t* value) { @@ -71,7 +72,7 @@ void SkARGB32_Blitter::blitH(int x, int y, int width) { SkASSERT(x >= 0 && y >= 0 && x + width <= fDevice.width()); uint32_t* device = fDevice.getAddr32(x, y); - SkBlitRow::Color32(device, device, width, fPMColor); + fColor32Proc(device, device, width, fPMColor); } void SkARGB32_Blitter::blitAntiH(int x, int y, const SkAlpha antialias[], @@ -96,7 +97,7 @@ void SkARGB32_Blitter::blitAntiH(int x, int y, const SkAlpha antialias[], sk_memset32(device, color, count); } else { uint32_t sc = SkAlphaMulQ(color, SkAlpha255To256(aa)); - SkBlitRow::Color32(device, device, count, sc); + fColor32Proc(device, device, count, sc); } } runs += count; @@ -108,7 +109,7 @@ void SkARGB32_Blitter::blitAntiH(int x, int y, const SkAlpha antialias[], void SkARGB32_Blitter::blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { uint32_t* device = fDevice.getAddr32(x, y); SkDEBUGCODE((void)fDevice.getAddr32(x + 1, y);) - + device[0] = SkBlendARGB32(fPMColor, device[0], a0); device[1] = SkBlendARGB32(fPMColor, device[1], a1); } @@ -116,7 +117,7 @@ void SkARGB32_Blitter::blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { void SkARGB32_Blitter::blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { uint32_t* device = fDevice.getAddr32(x, y); SkDEBUGCODE((void)fDevice.getAddr32(x, y + 1);) - + device[0] = SkBlendARGB32(fPMColor, device[0], a0); device = (uint32_t*)((char*)device + fDevice.rowBytes()); device[0] = SkBlendARGB32(fPMColor, device[0], a1); @@ -247,7 +248,7 @@ void SkARGB32_Blitter::blitRect(int x, int y, int width, int height) { size_t rowBytes = fDevice.rowBytes(); while (--height >= 0) { - SkBlitRow::Color32(device, device, width, color); + fColor32Proc(device, device, width, color); device = (uint32_t*)((char*)device + rowBytes); } } @@ -300,7 +301,7 @@ void SkARGB32_Black_Blitter::blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { void SkARGB32_Black_Blitter::blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { uint32_t* device = fDevice.getAddr32(x, y); SkDEBUGCODE((void)fDevice.getAddr32(x, y + 1);) - + device[0] = (a0 << SK_A32_SHIFT) + SkAlphaMulQ(device[0], 256 - a0); device = (uint32_t*)((char*)device + fDevice.rowBytes()); device[0] = (a1 << SK_A32_SHIFT) + SkAlphaMulQ(device[0], 256 - a1); |