Fixing some inconsistencies in blitter selection.

So --skvm and --forceRasterPipeline flags work more correctly.

Change-Id: Ia1c3560a61dda4800785b1e7ad1a0e41fe42594d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509719
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
This commit is contained in:
Julia Lavrova 2022-02-16 10:19:57 -05:00 committed by SkCQ
parent e444402333
commit 7b5b00aaf1
2 changed files with 10 additions and 12 deletions

View File

@ -632,7 +632,7 @@ SkBlitter* SkBlitterClipper::apply(SkBlitter* blitter, const SkRegion* clip,
bool SkBlitter::UseLegacyBlitter(const SkPixmap& device,
const SkPaint& paint,
const SkMatrix& matrix) {
if (gSkForceRasterPipelineBlitter) {
if (gSkForceRasterPipelineBlitter || gUseSkVMBlitter) {
return false;
}
#if defined(SK_FORCE_RASTER_PIPELINE_BLITTER)
@ -734,19 +734,14 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device,
paint.writable()->setDither(false);
}
if (gUseSkVMBlitter) {
if (auto blitter = SkVMBlitter::Make(device, *paint, matrixProvider,
alloc, clipShader)) {
return blitter;
}
}
// Same basic idea used a few times: try SkRP, then try SkVM, then give up with a null-blitter.
// (Setting gUseSkVMBlitter is the only way we prefer SkVM over SkRP at the moment.)
auto create_SkRP_or_SkVMBlitter = [&]() -> SkBlitter* {
if (auto blitter = SkCreateRasterPipelineBlitter(device, *paint, matrixProvider,
alloc, clipShader)) {
return blitter;
if (!gUseSkVMBlitter) {
if (auto blitter = SkCreateRasterPipelineBlitter(
device, *paint, matrixProvider, alloc, clipShader)) {
return blitter;
}
}
if (auto blitter = SkVMBlitter::Make(device, *paint, matrixProvider,
alloc, clipShader)) {

View File

@ -17,6 +17,7 @@
#include "src/core/SkVMBlitter.h"
extern bool gUseSkVMBlitter;
extern bool gSkForceRasterPipelineBlitter;
SkSpriteBlitter::SkSpriteBlitter(const SkPixmap& source)
: fSource(source) {}
@ -199,7 +200,9 @@ SkBlitter* SkBlitter::ChooseSprite(const SkPixmap& dst, const SkPaint& paint,
SkSpriteBlitter* blitter = nullptr;
if (0 == SkColorSpaceXformSteps(source,dst).flags.mask() && !clipShader) {
if (gSkForceRasterPipelineBlitter) {
// Do not use any of these optimized memory blitters
} else if (0 == SkColorSpaceXformSteps(source,dst).flags.mask() && !clipShader) {
if (!blitter && SkSpriteBlitter_Memcpy::Supports(dst, source, paint)) {
blitter = alloc->make<SkSpriteBlitter_Memcpy>(source);
}