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

Side by Side Diff: tools/gpu/GrContextFactory.cpp

Issue 2539993002: Enable sRGB on iOS, make sRGB decode support optional (Closed)
Patch Set: Don't allow sRGBA on ES BGRA devices Created 4 years 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 unified diff | Download patch
« no previous file with comments | « tools/gpu/GrContextFactory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrContextFactory.h" 9 #include "GrContextFactory.h"
10 #include "gl/GLTestContext.h" 10 #include "gl/GLTestContext.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 #endif 191 #endif
192 default: 192 default:
193 return ContextInfo(); 193 return ContextInfo();
194 } 194 }
195 testCtx->makeCurrent(); 195 testCtx->makeCurrent();
196 SkASSERT(testCtx && testCtx->backend() == backend); 196 SkASSERT(testCtx && testCtx->backend() == backend);
197 GrContextOptions grOptions = fGlobalOptions; 197 GrContextOptions grOptions = fGlobalOptions;
198 if (ContextOptions::kUseInstanced & options) { 198 if (ContextOptions::kUseInstanced & options) {
199 grOptions.fEnableInstancedRendering = true; 199 grOptions.fEnableInstancedRendering = true;
200 } 200 }
201 grOptions.fRequireDecodeDisableForSRGB =
202 SkToBool(ContextOptions::kRequireSRGBDecodeDisableSupport & options);
201 grCtx.reset(GrContext::Create(backend, backendContext, grOptions)); 203 grCtx.reset(GrContext::Create(backend, backendContext, grOptions));
202 if (!grCtx.get()) { 204 if (!grCtx.get()) {
203 return ContextInfo(); 205 return ContextInfo();
204 } 206 }
205 if (ContextOptions::kEnableNVPR & options) { 207 if (ContextOptions::kEnableNVPR & options) {
206 if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) { 208 if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) {
207 return ContextInfo(); 209 return ContextInfo();
208 } 210 }
209 } 211 }
210 if (ContextOptions::kUseInstanced & options) { 212 if (ContextOptions::kUseInstanced & options) {
(...skipping 10 matching lines...) Expand all
221 Context& context = fContexts.push_back(); 223 Context& context = fContexts.push_back();
222 context.fBackend = backend; 224 context.fBackend = backend;
223 context.fTestContext = testCtx.release(); 225 context.fTestContext = testCtx.release();
224 context.fGrContext = SkRef(grCtx.get()); 226 context.fGrContext = SkRef(grCtx.get());
225 context.fType = type; 227 context.fType = type;
226 context.fOptions = options; 228 context.fOptions = options;
227 context.fAbandoned = false; 229 context.fAbandoned = false;
228 return ContextInfo(context.fBackend, context.fTestContext, context.fGrContex t); 230 return ContextInfo(context.fBackend, context.fTestContext, context.fGrContex t);
229 } 231 }
230 } // namespace sk_gpu_test 232 } // namespace sk_gpu_test
OLDNEW
« no previous file with comments | « tools/gpu/GrContextFactory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698