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: ui/ozone/common/egl_util.cc

Issue 750593003: Ozone X11 platform Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup leftover stuff Created 6 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 | « ui/ozone/common/egl_util.h ('k') | ui/ozone/ozone.gni » ('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 8000360c7b0c4a99be228bcdb2f46b5a788a398a..847e6c61f1785ec599f635cf4ce0698d27abca8f 100644
--- a/ui/ozone/common/egl_util.cc
+++ b/ui/ozone/common/egl_util.cc
@@ -62,4 +62,27 @@ bool LoadEGLGLES2Bindings(
return true;
}
+void* ChooseEGLConfig(const SurfaceFactoryOzone::EglConfigInfo& egl,
+ const int32* attributes) {
+ void* config;
+ int32 num_configs;
+ if (!egl.choose_config.Run(attributes, NULL, 0, &num_configs)) {
+ LOG(ERROR) << "eglChooseConfig failed with error "
+ << egl.get_last_error_string.Run();
+ return nullptr;
+ }
+
+ if (num_configs == 0) {
+ LOG(ERROR) << "No suitable EGL configs found.";
+ return nullptr;
+ }
+
+ if (!egl.choose_config.Run(attributes, &config, 1, &num_configs)) {
+ LOG(ERROR) << "eglChooseConfig failed with error "
+ << egl.get_last_error_string.Run();
+ return nullptr;
+ }
+ return config;
+}
+
} // namespace ui
« no previous file with comments | « ui/ozone/common/egl_util.h ('k') | ui/ozone/ozone.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698