Add caps overrides to GMs
Review URL: https://codereview.chromium.org/1158963002
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index a838511..0a90e03 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -57,6 +57,11 @@
return gm->getName();
}
+void GMSrc::modifyGrContextOptions(GrContextOptions* options) const {
+ SkAutoTDelete<skiagm::GM> gm(fFactory(NULL));
+ gm->modifyGrContextOptions(options);
+}
+
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
CodecSrc::CodecSrc(Path path, Mode mode, DstColorType dstColorType)
@@ -434,7 +439,10 @@
void PreAbandonGpuContextErrorHandler(SkError, void*) {}
Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) const {
- GrContextFactory factory;
+ GrContextOptions options;
+ src.modifyGrContextOptions(&options);
+
+ GrContextFactory factory(options);
const SkISize size = src.size();
const SkImageInfo info =
SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul_SkAlphaType);