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

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: Small fixes. 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
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..d54b0beef81124722c5ad59420954a61e78a3bd2 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) {
+ void* config;
+ 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;
+ }
+
+ 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;

Powered by Google App Engine
This is Rietveld 408576698