Changeset View
Changeset View
Standalone View
Standalone View
egl_context_attribute_builder.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 26 | { | |||
---|---|---|---|---|---|
47 | if (isCoreProfile() || isCompatibilityProfile()) { | 47 | if (isCoreProfile() || isCompatibilityProfile()) { | ||
48 | attribs.emplace_back(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR); | 48 | attribs.emplace_back(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR); | ||
49 | if (isCoreProfile()) { | 49 | if (isCoreProfile()) { | ||
50 | attribs.emplace_back(EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR); | 50 | attribs.emplace_back(EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR); | ||
51 | } else if (isCompatibilityProfile()) { | 51 | } else if (isCompatibilityProfile()) { | ||
52 | attribs.emplace_back(EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR); | 52 | attribs.emplace_back(EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR); | ||
53 | } | 53 | } | ||
54 | } | 54 | } | ||
55 | if (isHighPriority()) { | ||||
56 | attribs.emplace_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG); | ||||
57 | attribs.emplace_back(EGL_CONTEXT_PRIORITY_HIGH_IMG); | ||||
58 | } | ||||
55 | attribs.emplace_back(EGL_NONE); | 59 | attribs.emplace_back(EGL_NONE); | ||
56 | return attribs; | 60 | return attribs; | ||
57 | } | 61 | } | ||
58 | 62 | | |||
59 | std::vector<int> EglOpenGLESContextAttributeBuilder::build() const | 63 | std::vector<int> EglOpenGLESContextAttributeBuilder::build() const | ||
60 | { | 64 | { | ||
61 | std::vector<int> attribs; | 65 | std::vector<int> attribs; | ||
62 | attribs.emplace_back(EGL_CONTEXT_CLIENT_VERSION); | 66 | attribs.emplace_back(EGL_CONTEXT_CLIENT_VERSION); | ||
63 | attribs.emplace_back(majorVersion()); | 67 | attribs.emplace_back(majorVersion()); | ||
64 | if (isRobust()) { | 68 | if (isRobust()) { | ||
65 | attribs.emplace_back(EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT); | 69 | attribs.emplace_back(EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT); | ||
66 | attribs.emplace_back(EGL_TRUE); | 70 | attribs.emplace_back(EGL_TRUE); | ||
67 | attribs.emplace_back(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT); | 71 | attribs.emplace_back(EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT); | ||
68 | attribs.emplace_back(EGL_LOSE_CONTEXT_ON_RESET_EXT); | 72 | attribs.emplace_back(EGL_LOSE_CONTEXT_ON_RESET_EXT); | ||
69 | } | 73 | } | ||
74 | if (isHighPriority()) { | ||||
75 | attribs.emplace_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG); | ||||
76 | attribs.emplace_back(EGL_CONTEXT_PRIORITY_HIGH_IMG); | ||||
77 | } | ||||
70 | attribs.emplace_back(EGL_NONE); | 78 | attribs.emplace_back(EGL_NONE); | ||
71 | return attribs; | 79 | return attribs; | ||
72 | } | 80 | } | ||
73 | 81 | | |||
74 | } | 82 | } |