diff options
-rw-r--r-- | bench/nanobench.cpp | 2 | ||||
-rw-r--r-- | src/core/SkRasterPipelineBlitter.cpp | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index ab7c689309..95977c53cb 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -475,6 +475,8 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c CPU_CONFIG(nonrendering, kNonRendering_Backend, kUnknown_SkColorType, kUnpremul_SkAlphaType, nullptr) + CPU_CONFIG(a8, kRaster_Backend, + kAlpha_8_SkColorType, kPremul_SkAlphaType, nullptr) CPU_CONFIG(8888, kRaster_Backend, kN32_SkColorType, kPremul_SkAlphaType, nullptr) CPU_CONFIG(565, kRaster_Backend, 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? |