Revert "simplify GrFPArgs, isolating localmatrix"

This reverts commit b76c717025.

Reason for revert: try to unblock android roller

Original change's description:
> simplify GrFPArgs, isolating localmatrix
> 
> Bug: skia:
> Change-Id: Icee24e0a355a7d1bae29b7721b4d95db8023ca77
> Reviewed-on: https://skia-review.googlesource.com/97063
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=bsalomon@google.com,reed@google.com

Change-Id: Ic7a2288844cde57922b2cc74b855eb517ade48be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/97580
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2018-01-20 14:48:56 +00:00 committed by Skia Commit-Bot
parent faca00d993
commit 3d628fe00a
6 changed files with 15 additions and 21 deletions

View File

@ -303,7 +303,6 @@ SkMaskFilter::filterRectsToNine(const SkRect[], int count, const SkMatrix&,
#if SK_SUPPORT_GPU
std::unique_ptr<GrFragmentProcessor> SkMaskFilter::asFragmentProcessor(const GrFPArgs& args) const {
SkASSERT(args.fLocalMatrix == nullptr);
auto fp = this->onAsFragmentProcessor(args);
if (fp) {
SkASSERT(this->hasFragmentProcessor());

View File

@ -15,6 +15,7 @@ class GrContext;
class GrColorSpaceInfo;
struct GrFPArgs {
GrFPArgs() {}
GrFPArgs(GrContext* context,
const SkMatrix* viewMatrix,
const SkMatrix* localMatrix,
@ -26,16 +27,6 @@ struct GrFPArgs {
, fFilterQuality(filterQuality)
, fDstColorSpaceInfo(dstColorSpaceInfo) {}
GrFPArgs(GrContext* context,
const SkMatrix* viewMatrix,
SkFilterQuality filterQuality,
const GrColorSpaceInfo* dstColorSpaceInfo)
: fContext(context)
, fViewMatrix(viewMatrix)
, fLocalMatrix(nullptr)
, fFilterQuality(filterQuality)
, fDstColorSpaceInfo(dstColorSpaceInfo) {}
GrContext* fContext;
const SkMatrix* fViewMatrix;
const SkMatrix* fLocalMatrix;

View File

@ -334,13 +334,17 @@ sk_sp<GrColorSpaceXform> TestColorXform(SkRandom* random) {
return gXforms[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gXforms)))];
}
TestAsFPArgs::TestAsFPArgs(GrProcessorTestData* d)
: fViewMatrixStorage(TestMatrix(d->fRandom))
, fColorSpaceInfoStorage(skstd::make_unique<GrColorSpaceInfo>(TestColorSpace(d->fRandom),
kRGBA_8888_GrPixelConfig))
, fArgs(d->context(), &fViewMatrixStorage, nullptr, kNone_SkFilterQuality,
fColorSpaceInfoStorage.get())
{}
TestAsFPArgs::TestAsFPArgs(GrProcessorTestData* d) {
fViewMatrixStorage = TestMatrix(d->fRandom);
fColorSpaceInfoStorage = skstd::make_unique<GrColorSpaceInfo>(TestColorSpace(d->fRandom),
kRGBA_8888_GrPixelConfig);
fArgs.fContext = d->context();
fArgs.fViewMatrix = &fViewMatrixStorage;
fArgs.fLocalMatrix = nullptr;
fArgs.fFilterQuality = kNone_SkFilterQuality;
fArgs.fDstColorSpaceInfo = fColorSpaceInfoStorage.get();
}
TestAsFPArgs::~TestAsFPArgs() {}

View File

@ -58,9 +58,9 @@ public:
const GrFPArgs& args() const { return fArgs; }
private:
GrFPArgs fArgs;
SkMatrix fViewMatrixStorage;
std::unique_ptr<GrColorSpaceInfo> fColorSpaceInfoStorage;
GrFPArgs fArgs;
};
// We have a simplified dash path effect here to avoid relying on SkDashPathEffect which

View File

@ -375,7 +375,7 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context,
// Convert SkPaint color to 4f format, including optional linearizing and gamut conversion.
GrColor4f origColor = SkColorToUnpremulGrColor4f(skPaint.getColor(), colorSpaceInfo);
const GrFPArgs fpArgs(context, &viewM, skPaint.getFilterQuality(), &colorSpaceInfo);
const GrFPArgs fpArgs(context, &viewM, nullptr, skPaint.getFilterQuality(), &colorSpaceInfo);
// Setup the initial color considering the shader, the SkPaint color, and the presence or not
// of per-vertex colors.

View File

@ -369,7 +369,7 @@ std::unique_ptr<GrFragmentProcessor> SkPictureShader::asFragmentProcessor(
return nullptr;
}
return as_SB(bitmapShader)
->asFragmentProcessor(GrFPArgs(args.fContext, args.fViewMatrix,
->asFragmentProcessor(GrFPArgs(args.fContext, args.fViewMatrix, nullptr,
args.fFilterQuality, args.fDstColorSpaceInfo));
}
#endif