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

Unified Diff: src/gpu/GrContextFactory.h

Issue 1448883002: 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: rebase 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 | « dm/DMSrcSink.cpp ('k') | src/gpu/GrContextFactory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContextFactory.h
diff --git a/src/gpu/GrContextFactory.h b/src/gpu/GrContextFactory.h
index c837e74a25b29c36ee2031ed97686d089b87d893..50978138174a22c22b68f45727b1e32a96aab8bf 100644
--- a/src/gpu/GrContextFactory.h
+++ b/src/gpu/GrContextFactory.h
@@ -23,35 +23,34 @@
*/
class GrContextFactory : SkNoncopyable {
public:
- /**
- * Types of GL contexts supported. For historical and testing reasons the native GrContext will
- * not use "GL_NV_path_rendering" even when the driver supports it. There is a separate context
- * type that does not remove NVPR support and which will fail when the driver does not support
- * the extension.
- */
enum GLContextType {
- kNative_GLContextType,
+ kNative_GLContextType,
#if SK_ANGLE
- kANGLE_GLContextType,
- kANGLE_GL_GLContextType,
+ kANGLE_GLContextType,
+ kANGLE_GL_GLContextType,
#endif
#if SK_COMMAND_BUFFER
- kCommandBuffer_GLContextType,
+ kCommandBuffer_GLContextType,
#endif
#if SK_MESA
- kMESA_GLContextType,
+ kMESA_GLContextType,
#endif
- /** Similar to kNative but does not filter NVPR. It will fail if the GL driver does not
- support NVPR */
- kNVPR_GLContextType,
- kNull_GLContextType,
- kDebug_GLContextType,
-
- kLastGLContextType = kDebug_GLContextType
+ kNull_GLContextType,
+ kDebug_GLContextType,
+ kLastGLContextType = kDebug_GLContextType
};
static const int kGLContextTypeCnt = kLastGLContextType + 1;
+ /**
+ * Options for GL context creation. For historical and testing reasons the options will default
+ * to not using GL_NV_path_rendering extension even when the driver supports it.
+ */
+ enum GLContextOptions {
+ kNone_GLContextOptions = 0,
+ kEnableNVPR_GLContextOptions = 0x1,
+ };
+
static bool IsRenderingGLContext(GLContextType type) {
switch (type) {
case kNull_GLContextType:
@@ -82,8 +81,6 @@ public:
case kMESA_GLContextType:
return "mesa";
#endif
- case kNVPR_GLContextType:
- return "nvpr";
case kDebug_GLContextType:
return "debug";
default:
@@ -119,6 +116,7 @@ public:
struct ContextInfo {
GLContextType fType;
+ GLContextOptions fOptions;
SkGLContext* fGLContext;
GrContext* fGrContext;
};
@@ -126,13 +124,15 @@ public:
* Get a context initialized with a type of GL context. It also makes the GL context current.
* Pointer is valid until destroyContexts() is called.
*/
- ContextInfo* getContextInfo(GLContextType type, GrGLStandard forcedGpuAPI = kNone_GrGLStandard);
+ ContextInfo* getContextInfo(GLContextType type, GrGLStandard forcedGpuAPI = kNone_GrGLStandard,
+ GLContextOptions options = kNone_GLContextOptions);
/**
* Get a GrContext initialized with a type of GL context. It also makes the GL context current.
*/
- GrContext* get(GLContextType type, GrGLStandard forcedGpuAPI = kNone_GrGLStandard) {
- if (ContextInfo* info = this->getContextInfo(type, forcedGpuAPI)) {
+ GrContext* get(GLContextType type, GrGLStandard forcedGpuAPI = kNone_GrGLStandard,
+ GLContextOptions options = kNone_GLContextOptions) {
+ if (ContextInfo* info = this->getContextInfo(type, forcedGpuAPI, options)) {
return info->fGrContext;
}
return nullptr;
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | src/gpu/GrContextFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698