diff options
author | 2017-08-28 11:30:48 -0400 | |
---|---|---|
committer | 2017-08-28 15:56:06 +0000 | |
commit | e6befa5ac8e00400a7baa1813d323cdb834a22e5 (patch) | |
tree | 0d83878158c080a458b8cfe01140cd728aee8431 /src/core/SkRasterPipelineBlitter.cpp | |
parent | c172f9b894455f2d262a5b1edf067764d70b1b62 (diff) |
add 'a8' config for nanobench, specialize blitV for raster-pipeline
Motivated by wanting to speed-up A8 blits in general (and at the moment, aarect blits). More to come in these areas.
Bug: skia:
Change-Id: I45e8ef951b8e89a825af72b1918049be10920137
Reviewed-on: https://skia-review.googlesource.com/39401
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkRasterPipelineBlitter.cpp')
-rw-r--r-- | src/core/SkRasterPipelineBlitter.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/SkRasterPipelineBlitter.cpp b/src/core/SkRasterPipelineBlitter.cpp index 4c484a0439..863fb92fad 100644 --- a/src/core/SkRasterPipelineBlitter.cpp +++ b/src/core/SkRasterPipelineBlitter.cpp @@ -44,6 +44,7 @@ public: void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) override; void blitMask (const SkMask&, const SkIRect& clip) override; void blitRect (int x, int y, int width, int height) override; + void blitV (int x, int y, int height, SkAlpha alpha) override; // TODO: The default implementations of the other blits look fine, // but some of them like blitV could probably benefit from custom @@ -389,6 +390,18 @@ void SkRasterPipelineBlitter::blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { this->blitMask(mask, clip); } +void SkRasterPipelineBlitter::blitV(int x, int y, int height, SkAlpha alpha) { + SkIRect clip = {x,y, x+1,y+height}; + + SkMask mask; + mask.fImage = α + mask.fBounds = clip; + mask.fRowBytes = 0; // so we reuse the 1 "row" for all of height + mask.fFormat = SkMask::kA8_Format; + + this->blitMask(mask, clip); +} + void SkRasterPipelineBlitter::blitMask(const SkMask& mask, const SkIRect& clip) { if (mask.fFormat == SkMask::kBW_Format) { // TODO: native BW masks? |