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

Unified Diff: include/gpu/GrContextFactory.h

Issue 640283004: Refactor SkGLContext to be actually extendable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: win compile fix. Created 6 years, 2 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 | « no previous file | include/gpu/gl/SkANGLEGLContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrContextFactory.h
diff --git a/include/gpu/GrContextFactory.h b/include/gpu/GrContextFactory.h
index eff1f5834c039566e2865375ce46f5906b071095..143ca31aad6c0f3f62c4704ec71a48a1e99a00a6 100644
--- a/include/gpu/GrContextFactory.h
+++ b/include/gpu/GrContextFactory.h
@@ -135,35 +135,33 @@ public:
switch (type) {
case kNVPR_GLContextType: // fallthru
case kNative_GLContextType:
- glCtx.reset(SkCreatePlatformGLContext());
+ glCtx.reset(SkCreatePlatformGLContext(forcedGpuAPI));
break;
#ifdef SK_ANGLE
case kANGLE_GLContextType:
- glCtx.reset(SkNEW(SkANGLEGLContext));
+ glCtx.reset(SkANGLEGLContext::Create(forcedGpuAPI));
break;
#endif
#ifdef SK_MESA
case kMESA_GLContextType:
- glCtx.reset(SkNEW(SkMesaGLContext));
+ glCtx.reset(SkMesaGLContext::Create(forcedGpuAPI));
break;
#endif
case kNull_GLContextType:
- glCtx.reset(SkNEW(SkNullGLContext));
+ glCtx.reset(SkNullGLContext::Create(forcedGpuAPI));
break;
case kDebug_GLContextType:
- glCtx.reset(SkNEW(SkDebugGLContext));
+ glCtx.reset(SkDebugGLContext::Create(forcedGpuAPI));
break;
}
- static const int kBogusSize = 1;
- if (!glCtx.get()) {
- return NULL;
- }
- if (!glCtx.get()->init(forcedGpuAPI, kBogusSize, kBogusSize)) {
+ if (NULL == glCtx.get()) {
return NULL;
}
+ SkASSERT(glCtx->isValid());
+
// Ensure NVPR is available for the NVPR type and block it from other types.
- SkAutoTUnref<const GrGLInterface> glInterface(SkRef(glCtx.get()->gl()));
+ SkAutoTUnref<const GrGLInterface> glInterface(SkRef(glCtx->gl()));
if (kNVPR_GLContextType == type) {
if (!glInterface->hasExtension("GL_NV_path_rendering")) {
return NULL;
« no previous file with comments | « no previous file | include/gpu/gl/SkANGLEGLContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698