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 1548683002: Revert of Add config options to run different GPU APIs to dm and nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-03-context-factory-glcontext-type
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') | src/gpu/gl/SkNullGLContext.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 4814e7870e8f0f16e118e824d526abea7122f0a7..15af8162b1e90bdbf0fa71d5da6c3ce358703eda 100755
--- a/src/gpu/GrContextFactory.cpp
+++ b/src/gpu/GrContextFactory.cpp
@@ -24,10 +24,13 @@
#include "GrCaps.h"
GrContextFactory::ContextInfo* GrContextFactory::getContextInfo(GLContextType type,
+ GrGLStandard forcedGpuAPI,
GLContextOptions options) {
for (int i = 0; i < fContexts.count(); ++i) {
if (fContexts[i]->fType == type &&
- fContexts[i]->fOptions == options) {
+ fContexts[i]->fOptions == options &&
+ (forcedGpuAPI == kNone_GrGLStandard ||
+ forcedGpuAPI == fContexts[i]->fGLContext->gl()->fStandard)) {
fContexts[i]->fGLContext->makeCurrent();
return fContexts[i];
}
@@ -36,39 +39,31 @@
SkAutoTUnref<GrContext> grCtx;
switch (type) {
case kNative_GLContextType:
- glCtx.reset(SkCreatePlatformGLContext(kNone_GrGLStandard));
+ glCtx.reset(SkCreatePlatformGLContext(forcedGpuAPI));
break;
- case kGL_GLContextType:
- glCtx.reset(SkCreatePlatformGLContext(kGL_GrGLStandard));
+#ifdef SK_ANGLE
+ case kANGLE_GLContextType:
+ glCtx.reset(SkANGLEGLContext::Create(forcedGpuAPI, false));
break;
- case kGLES_GLContextType:
- glCtx.reset(SkCreatePlatformGLContext(kGLES_GrGLStandard));
- break;
-#if SK_ANGLE
-#ifdef SK_BUILD_FOR_WIN
- case kANGLE_GLContextType:
- glCtx.reset(SkANGLEGLContext::CreateDirectX());
+ case kANGLE_GL_GLContextType:
+ glCtx.reset(SkANGLEGLContext::Create(forcedGpuAPI, true));
break;
#endif
- case kANGLE_GL_GLContextType:
- glCtx.reset(SkANGLEGLContext::CreateOpenGL());
+#ifdef SK_COMMAND_BUFFER
+ case kCommandBuffer_GLContextType:
+ glCtx.reset(SkCommandBufferGLContext::Create(forcedGpuAPI));
break;
#endif
-#if SK_COMMAND_BUFFER
- case kCommandBuffer_GLContextType:
- glCtx.reset(SkCommandBufferGLContext::Create());
- break;
-#endif
-#if SK_MESA
+#ifdef SK_MESA
case kMESA_GLContextType:
- glCtx.reset(SkMesaGLContext::Create());
+ glCtx.reset(SkMesaGLContext::Create(forcedGpuAPI));
break;
#endif
case kNull_GLContextType:
- glCtx.reset(SkNullGLContext::Create());
+ glCtx.reset(SkNullGLContext::Create(forcedGpuAPI));
break;
case kDebug_GLContextType:
- glCtx.reset(SkDebugGLContext::Create());
+ glCtx.reset(SkDebugGLContext::Create(forcedGpuAPI));
break;
}
if (nullptr == glCtx.get()) {
« no previous file with comments | « src/gpu/GrContextFactory.h ('k') | src/gpu/gl/SkNullGLContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698