Arm Community
Site
Search
User
Site
Search
User
Support forums
Mobile, Graphics, and Gaming forum
eglCreatePixmapSurface error 0x300a
Jump...
Cancel
Locked
Locked
Replies
8 replies
Subscribers
137 subscribers
Views
8878 views
Users
0 members are here
OpenGL ES
Mali-GPU
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
eglCreatePixmapSurface error 0x300a
jack li
over 12 years ago
Note: This was originally posted on 12th September 2012 at
http://forums.arm.com
When I try the SAMSUNG S3 run the above code, I failed.
void GLImageRenderBlux::initEGL(int width, int height, SkBitmap bitmap)
{
const EGLint attribList[] = { EGL_WIDTH, width, EGL_HEIGHT, height, EGL_NONE };
EGLConfig config;
EGLint maj;
EGLint min;
m_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
checkEGLError("eglGetDisplay");
if(m_display == EGL_NO_DISPLAY) {
LOGE("getDisplay fail!");
return ;
}
if(eglInitialize(m_display, &maj, &min) == EGL_FALSE) {
LOGE("Initialize fail");
return ;
}
config = chooseConfig(m_display);
EGLint contextAttrs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
m_context = eglCreateContext(m_display, config, EGL_NO_CONTEXT, contextAttrs);
checkEGLError("eglCreateContext");
if(m_context == EGL_NO_CONTEXT) {
LOGE("Create Context failure");
return ;
}
//
SkPixelRef* ref = bitmap.pixelRef();
SkSafeRef(ref);
ref->lockPixels();
egl_native_pixmap_t pixmap;
pixmap.version = sizeof(pixmap);
pixmap.width = width;
pixmap.height = height;
pixmap.stride = bitmap.rowBytes() / bitmap.bytesPerPixel();
pixmap.format = SkBitmap::kARGB_8888_Config;
pixmap.data = (uint8_t*)ref->pixels();
ref->unlockPixels();
m_surface = eglCreatePixmapSurface(m_display, config, &pixmap, attribList);
checkEGLError("eglCreatePixmapSurface");
if(m_surface == EGL_NO_SURFACE) {
LOGE("Create Surface failure");
return ;
}
if (!eglMakeCurrent(m_display, m_surface, m_surface, m_context)) {
LOGE("Make Current failure");
return ;
}
}
EGLConfig GLImageRenderBlux::chooseConfig(EGLDisplay display)
{
EGLConfig config;
EGLint numConfigs;
static const EGLint configAttribs[] = {
EGL_SURFACE_TYPE,
EGL_PIXMAP_BIT,
EGL_RENDERABLE_TYPE,
EGL_OPENGL_ES2_BIT,
EGL_NONE
};
eglChooseConfig(display, configAttribs, &config, 1, &numConfigs);
checkEGLError("eglPbufferConfig");
if (numConfigs != 1) {
LOGE("eglPbufferConfig failed (%d)\n", numConfigs);
}
return config;
}
Error information is as follows:
'eglCreatePixmapSurface error: EGL_BAD_NATIVE_PIXMAP (0x300a)'
'[color=#FF0000]Create Surface failure'[/color]
Does any know how to fix the problem?
Parents
Karthik Hariharakrishnan
over 12 years ago
Note: This was originally posted on 21st September 2012 at
http://forums.arm.com
Hi Likai,
I have tried your above code snippet also on a Galaxy S2 (Android 4.0.4) and have not faced any issue. In the above code snippet, you also seem to be checking if the framebuffer is complete. If incomplete, you should get the following in Logcat, but I can't see it in your console log.
[color=#FF0000][font=Arial, sans-serif][size=2]
Framebuffer incomplete at XXX
[/size][/font][/color]
Cheers
Karthik
Cancel
Vote up
0
Vote down
Cancel
Reply
Karthik Hariharakrishnan
over 12 years ago
Note: This was originally posted on 21st September 2012 at
http://forums.arm.com
Hi Likai,
I have tried your above code snippet also on a Galaxy S2 (Android 4.0.4) and have not faced any issue. In the above code snippet, you also seem to be checking if the framebuffer is complete. If incomplete, you should get the following in Logcat, but I can't see it in your console log.
[color=#FF0000][font=Arial, sans-serif][size=2]
Framebuffer incomplete at XXX
[/size][/font][/color]
Cheers
Karthik
Cancel
Vote up
0
Vote down
Cancel
Children
No data