aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dm/DM.cpp2
-rw-r--r--dm/DMSrcSink.cpp8
-rw-r--r--dm/DMSrcSink.h3
3 files changed, 8 insertions, 5 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 37ff24d8d6..a442e09050 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -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
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 9eee2d2fd0..f9e5fd3d21 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -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);
diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h
index a4c3c488dd..117514995a 100644
--- a/dm/DMSrcSink.h
+++ b/dm/DMSrcSink.h
@@ -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 {