Plumb GrContextOptions to GPU sinks in DM

We were ignoring the path renderer flag when drawing GMs or SKPs.

Bug: skia:
Change-Id: Iee443fb70f1faec65e46925fa0e3cea3716d448d
Reviewed-on: https://skia-review.googlesource.com/36861
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2017-08-21 16:48:46 -04:00 committed by Skia Commit-Bot
parent b30c8d4531
commit f21aa04dca
3 changed files with 8 additions and 5 deletions

View File

@ -861,7 +861,7 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi
return new GPUSink(contextType, contextOverrides, gpuConfig->getSamples(),
gpuConfig->getUseDIText(), gpuConfig->getColorType(),
gpuConfig->getAlphaType(), sk_ref_sp(gpuConfig->getColorSpace()),
FLAGS_gpu_threading);
FLAGS_gpu_threading, grCtxOptions);
}
}
#endif

View File

@ -1301,7 +1301,8 @@ GPUSink::GPUSink(GrContextFactory::ContextType ct,
SkColorType colorType,
SkAlphaType alphaType,
sk_sp<SkColorSpace> colorSpace,
bool threaded)
bool threaded,
const GrContextOptions& grCtxOptions)
: fContextType(ct)
, fContextOverrides(overrides)
, fSampleCount(samples)
@ -1309,12 +1310,13 @@ GPUSink::GPUSink(GrContextFactory::ContextType ct,
, fColorType(colorType)
, fAlphaType(alphaType)
, fColorSpace(std::move(colorSpace))
, fThreaded(threaded) {}
, fThreaded(threaded)
, fBaseContextOptions(grCtxOptions) {}
DEFINE_bool(drawOpClip, false, "Clip each GrDrawOp to its device bounds for testing.");
Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) const {
GrContextOptions grOptions;
GrContextOptions grOptions = fBaseContextOptions;
src.modifyGrContextOptions(&grOptions);

View File

@ -307,7 +307,7 @@ public:
GPUSink(sk_gpu_test::GrContextFactory::ContextType,
sk_gpu_test::GrContextFactory::ContextOverrides, int samples, bool diText,
SkColorType colorType, SkAlphaType alphaType, sk_sp<SkColorSpace> colorSpace,
bool threaded);
bool threaded, const GrContextOptions& grCtxOptions);
Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
bool serial() const override { return !fThreaded; }
@ -326,6 +326,7 @@ private:
SkAlphaType fAlphaType;
sk_sp<SkColorSpace> fColorSpace;
bool fThreaded;
GrContextOptions fBaseContextOptions;
};
class PDFSink : public Sink {