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

Unified Diff: ui/ozone/common/egl_util.cc

Issue 2165303002: Convert Ozone GBM to use new surface API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ozone_impl
Patch Set: Add missing dep. Created 4 years, 5 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 | « ui/ozone/common/egl_util.h ('k') | ui/ozone/ozone.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/common/egl_util.cc
diff --git a/ui/ozone/common/egl_util.cc b/ui/ozone/common/egl_util.cc
index a86704640ad21f36649ba0e35c16d993c4f876b4..b33407ae5428013d0e31c363dad107bd72de9ce7 100644
--- a/ui/ozone/common/egl_util.cc
+++ b/ui/ozone/common/egl_util.cc
@@ -5,6 +5,8 @@
#include "ui/ozone/common/egl_util.h"
#include "base/files/file_path.h"
+#include "ui/gl/egl_util.h"
+#include "ui/gl/gl_bindings.h"
namespace ui {
namespace {
@@ -62,6 +64,28 @@ bool LoadEGLGLES2Bindings(
return true;
}
+EGLConfig ChooseEGLConfig(EGLDisplay display, const int32_t* attributes) {
+ int32_t num_configs;
+ if (!eglChooseConfig(display, attributes, nullptr, 0, &num_configs)) {
+ LOG(ERROR) << "eglChooseConfig failed with error "
+ << GetLastEGLErrorString();
+ return nullptr;
+ }
+
+ if (num_configs == 0) {
+ LOG(ERROR) << "No suitable EGL configs found.";
+ return nullptr;
+ }
+
+ EGLConfig config;
+ if (!eglChooseConfig(display, attributes, &config, 1, &num_configs)) {
+ LOG(ERROR) << "eglChooseConfig failed with error "
+ << GetLastEGLErrorString();
+ return nullptr;
+ }
+ return config;
+}
+
void* /* EGLConfig */ ChooseEGLConfig(const EglConfigCallbacks& egl,
const int32_t* attributes) {
void* config;
« no previous file with comments | « ui/ozone/common/egl_util.h ('k') | ui/ozone/ozone.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698