diff options
author | reed <reed@google.com> | 2015-04-15 07:51:15 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-15 07:51:15 -0700 |
commit | 793a6ddd447f9f7c2a388f74252538e36731f199 (patch) | |
tree | f64485d9635d1ff4623bb513c99b2570c14aa42a /src/core/SkBlitter.h | |
parent | 6bd5137e11071116fe279e2f26264f01baeff1aa (diff) |
add blitter api for aa-hairlines
BUG=skia:
TBR=
Review URL: https://codereview.chromium.org/1088143002
Diffstat (limited to 'src/core/SkBlitter.h')
-rw-r--r-- | src/core/SkBlitter.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/core/SkBlitter.h b/src/core/SkBlitter.h index 9447bf1b51..2d4a0defbf 100644 --- a/src/core/SkBlitter.h +++ b/src/core/SkBlitter.h @@ -1,4 +1,3 @@ - /* * Copyright 2006 The Android Open Source Project * @@ -6,7 +5,6 @@ * found in the LICENSE file. */ - #ifndef SkBlitter_DEFINED #define SkBlitter_DEFINED @@ -55,6 +53,35 @@ public: */ virtual const SkBitmap* justAnOpaqueColor(uint32_t* value); + // (x, y), (x + 1, y) + void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { + int16_t runs[3]; + uint8_t aa[2]; + + runs[0] = 1; + runs[1] = 1; + runs[2] = 0; + aa[0] = SkToU8(a0); + aa[1] = SkToU8(a1); + this->blitAntiH(x, y, aa, runs); + } + + // (x, y), (x, y + 1) + void blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { + int16_t runs[2]; + uint8_t aa[1]; + + runs[0] = 1; + runs[1] = 0; + aa[0] = SkToU8(a0); + this->blitAntiH(x, y, aa, runs); + // reset in case the clipping blitter modified runs + runs[0] = 1; + runs[1] = 0; + aa[0] = SkToU8(a1); + this->blitAntiH(x, y + 1, aa, runs); + } + /** * Special method just to identify the null blitter, which is returned * from Choose() if the request cannot be fulfilled. Default impl |