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

Unified Diff: src/gpu/GrContextFactory.cpp

Issue 1486153002: Revert of Make NVPR a GL context option instead of a GL context (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-02-other-tests-refactor
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrContextFactory.h ('k') | tests/GLInterfaceValidationTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContextFactory.cpp
diff --git a/src/gpu/GrContextFactory.cpp b/src/gpu/GrContextFactory.cpp
index 19382ee1124e7cabfec53c637bdf504132d25c17..424b3fda3a86b6047ee45d4fbe94ca056b86a3ff 100755
--- a/src/gpu/GrContextFactory.cpp
+++ b/src/gpu/GrContextFactory.cpp
@@ -24,21 +24,21 @@
#include "GrCaps.h"
GrContextFactory::ContextInfo* GrContextFactory::getContextInfo(GLContextType type,
- GrGLStandard forcedGpuAPI,
- GLContextOptions options) {
+ GrGLStandard forcedGpuAPI) {
for (int i = 0; i < fContexts.count(); ++i) {
- if (fContexts[i]->fType == type &&
- fContexts[i]->fOptions == options &&
- (forcedGpuAPI == kNone_GrGLStandard ||
- forcedGpuAPI == fContexts[i]->fGLContext->gl()->fStandard)) {
+ if (forcedGpuAPI != kNone_GrGLStandard &&
+ forcedGpuAPI != fContexts[i]->fGLContext->gl()->fStandard)
+ continue;
+
+ if (fContexts[i]->fType == type) {
fContexts[i]->fGLContext->makeCurrent();
return fContexts[i];
}
}
-
SkAutoTUnref<SkGLContext> glCtx;
SkAutoTUnref<GrContext> grCtx;
switch (type) {
+ case kNVPR_GLContextType: // fallthru
case kNative_GLContextType:
glCtx.reset(SkCreatePlatformGLContext(forcedGpuAPI));
break;
@@ -75,7 +75,7 @@
// Block NVPR from non-NVPR types.
SkAutoTUnref<const GrGLInterface> glInterface(SkRef(glCtx->gl()));
- if (!(kEnableNVPR_GLContextOptions & options)) {
+ if (kNVPR_GLContextType != type) {
glInterface.reset(GrGLInterfaceRemoveNVPR(glInterface));
if (!glInterface) {
return nullptr;
@@ -97,7 +97,7 @@
return nullptr;
}
// Warn if path rendering support is not available for the NVPR type.
- if (kEnableNVPR_GLContextOptions & options) {
+ if (kNVPR_GLContextType == type) {
if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) {
GrGpu* gpu = grCtx->getGpu();
const GrGLContext* ctx = gpu->glContextForTesting();
@@ -119,6 +119,5 @@
ctx->fGLContext = SkRef(glCtx.get());
ctx->fGrContext = SkRef(grCtx.get());
ctx->fType = type;
- ctx->fOptions = options;
return ctx;
}
« no previous file with comments | « src/gpu/GrContextFactory.h ('k') | tests/GLInterfaceValidationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698