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

Unified Diff: tools/flags/SkCommonFlagsConfig.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 | « tools/flags/SkCommonFlagsConfig.h ('k') | tools/gpu/GrContextFactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/flags/SkCommonFlagsConfig.cpp
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp
index 447c56d5111528479ae5ac45e2a4d10f897e8adf..1d38b562a9af38be152b36d463e887378dcc1b8b 100644
--- a/tools/flags/SkCommonFlagsConfig.cpp
+++ b/tools/flags/SkCommonFlagsConfig.cpp
@@ -6,6 +6,7 @@
*/
#include "SkCommonFlagsConfig.h"
+#include "SkImageInfo.h"
#include <stdlib.h>
@@ -208,12 +209,20 @@ SkCommandLineConfigGpu::SkCommandLineConfigGpu(
sk_sp<SkColorSpace> colorSpace)
: SkCommandLineConfig(tag, SkString("gpu"), viaParts)
, fContextType(contextType)
- , fUseNVPR(useNVPR)
- , fUseInstanced(useInstanced)
+ , fContextOptions(ContextOptions::kNone)
, fUseDIText(useDIText)
, fSamples(samples)
, fColorType(colorType)
, fColorSpace(std::move(colorSpace)) {
+ if (useNVPR) {
+ fContextOptions |= ContextOptions::kEnableNVPR;
+ }
+ if (useInstanced) {
+ fContextOptions |= ContextOptions::kUseInstanced;
+ }
+ if (SkColorAndColorSpaceAreGammaCorrect(colorType, colorSpace.get())) {
+ fContextOptions |= ContextOptions::kRequireSRGBSupport;
+ }
}
static bool parse_option_int(const SkString& value, int* outInt) {
if (value.isEmpty()) {
« no previous file with comments | « tools/flags/SkCommonFlagsConfig.h ('k') | tools/gpu/GrContextFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698