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

Unified Diff: dm/DM.cpp

Issue 2337163002: Add ContextOptions field to SkCommandLineConfigGpu (Closed)
Patch Set: Add ContextOptions field to SkCommandLineConfigGpu Created 4 years, 3 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
« no previous file with comments | « bench/nanobench.cpp ('k') | tests/GrContextFactoryTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 1598bcddea45295d835ac372a9b647edd5b8765b..fc332a2adec2305e627be34ee9e566001a105a8d 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -825,21 +825,7 @@ static Sink* create_sink(const SkCommandLineConfig* config) {
if (gpu_supported()) {
if (const SkCommandLineConfigGpu* gpuConfig = config->asConfigGpu()) {
GrContextFactory::ContextType contextType = gpuConfig->getContextType();
- GrContextFactory::ContextOptions contextOptions =
- GrContextFactory::kNone_ContextOptions;
- if (gpuConfig->getUseNVPR()) {
- contextOptions = static_cast<GrContextFactory::ContextOptions>(
- contextOptions | GrContextFactory::kEnableNVPR_ContextOptions);
- }
- if (gpuConfig->getUseInstanced()) {
- contextOptions = static_cast<GrContextFactory::ContextOptions>(
- contextOptions | GrContextFactory::kUseInstanced_ContextOptions);
- }
- if (SkColorAndColorSpaceAreGammaCorrect(gpuConfig->getColorType(),
- gpuConfig->getColorSpace())) {
- contextOptions = static_cast<GrContextFactory::ContextOptions>(
- contextOptions | GrContextFactory::kRequireSRGBSupport_ContextOptions);
- }
+ GrContextFactory::ContextOptions contextOptions = gpuConfig->getContextOptions();
GrContextFactory testFactory;
if (!testFactory.get(contextType, contextOptions)) {
info("WARNING: can not create GPU context for config '%s'. "
@@ -1429,7 +1415,7 @@ void RunWithGPUTestContexts(GrContextTestFn* test, GrContextTypeFilterFn* contex
(*test)(reporter, ctxInfo);
}
ctxInfo = factory->getContextInfo(contextType,
- GrContextFactory::kEnableNVPR_ContextOptions);
+ GrContextFactory::ContextOptions::kEnableNVPR);
if (ctxInfo.grContext()) {
(*test)(reporter, ctxInfo);
}
« no previous file with comments | « bench/nanobench.cpp ('k') | tests/GrContextFactoryTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698