Android-x86
Fork

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-native: コミット

frameworks/native


コミットメタ情報

リビジョン792c8dc009bd3a0c44eb39e757a95e099c03b54c (tree)
日時2017-12-11 00:32:20
作者Chih-Wei Huang <cwhuang@linu...>
コミッターChih-Wei Huang

ログメッセージ

RenderEngine: support non-RGBA_8888 format

Some of our GPUs (e.g., radeon) don't support RGBA_8888 well.
To workaround it, just get the EGL config by a simpler query.

This patch should be reverted once all of our GPUs support
RGBA_8888.

変更サマリ

差分

--- a/services/surfaceflinger/RenderEngine/RenderEngine.cpp
+++ b/services/surfaceflinger/RenderEngine/RenderEngine.cpp
@@ -140,7 +140,7 @@ RenderEngine* RenderEngine::create(EGLDisplay display, int hwcFormat, uint32_t f
140140 }
141141 engine->setEGLHandles(config, ctxt);
142142
143- ALOGI("OpenGL ES informations:");
143+ ALOGI("OpenGL ES informations: format=0x%x", hwcFormat);
144144 ALOGI("vendor : %s", extensions.getVendor());
145145 ALOGI("renderer : %s", extensions.getRenderer());
146146 ALOGI("version : %s", extensions.getVersion());
@@ -411,9 +411,14 @@ EGLConfig RenderEngine::chooseEglConfig(EGLDisplay display, int format,
411411 status_t err;
412412 EGLConfig config;
413413
414- // First try to get an ES2 config
415- err = selectEGLConfig(display, format, EGL_OPENGL_ES2_BIT, &config);
416- if (err != NO_ERROR) {
414+ // Only try to get an ES2 config if format is RGBA_8888
415+ if (format != HAL_PIXEL_FORMAT_RGBA_8888) {
416+ ALOGI("Trying a simpler query for non-RGBA_8888");
417+ err = selectEGLConfig(display, format, 0, &config);
418+ if (err != NO_ERROR) {
419+ LOG_ALWAYS_FATAL("no suitable EGLConfig found, giving up");
420+ }
421+ } else if ((err = selectEGLConfig(display, format, EGL_OPENGL_ES2_BIT, &config)) != NO_ERROR) {
417422 // If ES2 fails, try ES1
418423 err = selectEGLConfig(display, format, EGL_OPENGL_ES_BIT, &config);
419424 if (err != NO_ERROR) {
@@ -435,7 +440,7 @@ EGLConfig RenderEngine::chooseEglConfig(EGLDisplay display, int format,
435440 eglGetConfigAttrib(display, config, EGL_GREEN_SIZE, &g);
436441 eglGetConfigAttrib(display, config, EGL_BLUE_SIZE, &b);
437442 eglGetConfigAttrib(display, config, EGL_ALPHA_SIZE, &a);
438- ALOGI("EGL information:");
443+ ALOGI("EGL information: format=0x%x", format);
439444 ALOGI("vendor : %s", eglQueryString(display, EGL_VENDOR));
440445 ALOGI("version : %s", eglQueryString(display, EGL_VERSION));
441446 ALOGI("extensions: %s", eglQueryString(display, EGL_EXTENSIONS));
旧リポジトリブラウザで表示