Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: dm/DMSrcSink.cpp

Issue 1158963002: Add caps overrides to GMs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tiny Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 090a24d86a62590f123881274578b0468e59a01d..9859ef99985749f772ba49b1eeb6f100e97e5d7c 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -57,6 +57,11 @@ Name GMSrc::name() const {
return gm->getName();
}
robertphillips 2015/05/27 18:28:31 Would getGrContextOptions make more sense ?
bsalomon 2015/05/27 20:17:33 Maybe modify is more accurate, since it is in/out.
+void GMSrc::setGrContextOptions(GrContextOptions* options) const {
+ SkAutoTDelete<skiagm::GM> gm(fFactory(NULL));
robertphillips 2015/05/27 18:28:31 return of void ?
bsalomon 2015/05/27 20:17:33 Done.
+ return gm->setGrContextOptions(options);
+}
+
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
CodecSrc::CodecSrc(Path path, Mode mode, DstColorType dstColorType)
@@ -340,7 +345,10 @@ int GPUSink::enclave() const {
void PreAbandonGpuContextErrorHandler(SkError, void*) {}
Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) const {
- GrContextFactory factory;
+ GrContextOptions options;
+ src.setGrContextOptions(&options);
+
+ GrContextFactory factory(options);
const SkISize size = src.size();
const SkImageInfo info =
SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul_SkAlphaType);

Powered by Google App Engine
This is Rietveld 408576698