diff options
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/GrFPArgs.h | 11 | ||||
-rw-r--r-- | src/gpu/GrTestUtils.cpp | 18 | ||||
-rw-r--r-- | src/gpu/GrTestUtils.h | 2 | ||||
-rw-r--r-- | src/gpu/SkGr.cpp | 2 |
4 files changed, 14 insertions, 19 deletions
diff --git a/src/gpu/GrFPArgs.h b/src/gpu/GrFPArgs.h index cdb2e5de50..58f12c5cac 100644 --- a/src/gpu/GrFPArgs.h +++ b/src/gpu/GrFPArgs.h @@ -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; diff --git a/src/gpu/GrTestUtils.cpp b/src/gpu/GrTestUtils.cpp index 1918ad61f9..d5565ca828 100644 --- a/src/gpu/GrTestUtils.cpp +++ b/src/gpu/GrTestUtils.cpp @@ -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() {} diff --git a/src/gpu/GrTestUtils.h b/src/gpu/GrTestUtils.h index 0cfe6e45a3..12e2ea3493 100644 --- a/src/gpu/GrTestUtils.h +++ b/src/gpu/GrTestUtils.h @@ -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 diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 6b1c779ff8..9342cd676b 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -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. |