Lines Matching defs:dc
134 static void DumpDebug(RsdHal *dc) {
135 ALOGE(" EGL ver %i %i", dc->gl.egl.majorVersion, dc->gl.egl.minorVersion);
136 ALOGE(" EGL context %p surface %p, Display=%p", dc->gl.egl.context, dc->gl.egl.surface,
137 dc->gl.egl.display);
138 ALOGE(" GL vendor: %s", dc->gl.gl.vendor);
139 ALOGE(" GL renderer: %s", dc->gl.gl.renderer);
140 ALOGE(" GL Version: %s", dc->gl.gl.version);
141 ALOGE(" GL Extensions: %s", dc->gl.gl.extensions);
142 ALOGE(" GL int Versions %i %i", dc->gl.gl.majorVersion, dc->gl.gl.minorVersion);
144 ALOGV("MAX Textures %i, %i %i", dc->gl.gl.maxVertexTextureUnits,
145 dc->gl.gl.maxFragmentTextureImageUnits, dc->gl.gl.maxTextureImageUnits);
146 ALOGV("MAX Attribs %i", dc->gl.gl.maxVertexAttribs);
147 ALOGV("MAX Uniforms %i, %i", dc->gl.gl.maxVertexUniformVectors,
148 dc->gl.gl.maxFragmentUniformVectors);
149 ALOGV("MAX Varyings %i", dc->gl.gl.maxVaryingVectors);
153 RsdHal *dc = (RsdHal *)rsc->mHal.drv;
156 dc->gl.shaderCache->cleanupAll();
157 delete dc->gl.shaderCache;
158 delete dc->gl.vertexArrayState;
160 if (dc->gl.egl.context != EGL_NO_CONTEXT) {
161 RSD_CALL_GL(eglMakeCurrent, dc->gl.egl.display,
163 RSD_CALL_GL(eglDestroySurface, dc->gl.egl.display, dc->gl.egl.surfaceDefault);
164 if (dc->gl.egl.surface != EGL_NO_SURFACE) {
165 RSD_CALL_GL(eglDestroySurface, dc->gl.egl.display, dc->gl.egl.surface);
167 RSD_CALL_GL(eglDestroyContext, dc->gl.egl.display, dc->gl.egl.context);
173 RSD_CALL_GL(eglTerminate, dc->gl.egl.display);
235 RsdHal *dc = (RsdHal *)rsc->mHal.drv;
237 dc->gl.egl.numConfigs = -1;
244 dc->gl.egl.display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
247 RSD_CALL_GL(eglInitialize, dc->gl.egl.display,
248 &dc->gl.egl.majorVersion, &dc->gl.egl.minorVersion);
261 ret = eglChooseConfig(dc->gl.egl.display, configAttribs, 0, 0, &numConfigs);
272 ret = eglChooseConfig(dc->gl.egl.display,
280 dc->gl.egl.config = configs[0];
286 eglGetConfigAttrib(dc->gl.egl.display,
295 eglGetConfigAttrib(dc->gl.egl.display,
303 dc->gl.egl.config = configs[i];
312 printEGLConfiguration(dc->gl.egl.display, dc->gl.egl.config);
317 dc->gl.egl.context = eglCreateContext(dc->gl.egl.display, dc->gl.egl.config,
320 if (dc->gl.egl.context == EGL_NO_CONTEXT) {
329 dc->gl.egl.surfaceDefault = eglCreatePbufferSurface(dc->gl.egl.display, dc->gl.egl.config,
332 if (dc->gl.egl.surfaceDefault == EGL_NO_SURFACE) {
340 ret = eglMakeCurrent(dc->gl.egl.display, dc->gl.egl.surfaceDefault,
341 dc->gl.egl.surfaceDefault, dc->gl.egl.context);
350 dc->gl.gl.version = glGetString(GL_VERSION);
351 dc->gl.gl.vendor = glGetString(GL_VENDOR);
352 dc->gl.gl.renderer = glGetString(GL_RENDERER);
353 dc->gl.gl.extensions = glGetString(GL_EXTENSIONS);
362 if (strlen((const char *)dc->gl.gl.version) > 9) {
363 if (!memcmp(dc->gl.gl.version, "OpenGL ES-CM", 12)) {
364 verptr = (const char *)dc->gl.gl.version + 12;
366 if (!memcmp(dc->gl.gl.version, "OpenGL ES ", 10)) {
367 verptr = (const char *)dc->gl.gl.version + 9;
377 sscanf(verptr, " %i.%i", &dc->gl.gl.majorVersion, &dc->gl.gl.minorVersion);
380 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &dc->gl.gl.maxVertexAttribs);
381 glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &dc->gl.gl.maxVertexUniformVectors);
382 glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &dc->gl.gl.maxVertexTextureUnits);
384 glGetIntegerv(GL_MAX_VARYING_VECTORS, &dc->gl.gl.maxVaryingVectors);
385 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &dc->gl.gl.maxTextureImageUnits);
387 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &dc->gl.gl.maxFragmentTextureImageUnits);
388 glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &dc->gl.gl.maxFragmentUniformVectors);
390 dc->gl.gl.OES_texture_npot = NULL != strstr((const char *)dc->gl.gl.extensions,
392 dc->gl.gl.IMG_texture_npot = NULL != strstr((const char *)dc->gl.gl.extensions,
394 dc->gl.gl.NV_texture_npot_2D_mipmap = NULL != strstr((const char *)dc->gl.gl.extensions,
396 dc->gl.gl.EXT_texture_max_aniso = 1.0f;
397 bool hasAniso = NULL != strstr((const char *)dc->gl.gl.extensions,
400 glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &dc->gl.gl.EXT_texture_max_aniso);
404 DumpDebug(dc);
407 dc->gl.shaderCache = new RsdShaderCache();
408 dc->gl.vertexArrayState = new RsdVertexArrayState();
409 dc->gl.vertexArrayState->init(dc->gl.gl.maxVertexAttribs);
410 dc->gl.currentFrameBuffer = NULL;
411 dc->mHasGraphics = true;
420 RsdHal *dc = (RsdHal *)rsc->mHal.drv;
423 if (dc->gl.egl.surface != NULL) {
425 ret = eglMakeCurrent(dc->gl.egl.display, dc->gl.egl.surfaceDefault,
426 dc->gl.egl.surfaceDefault, dc->gl.egl.context);
430 ret = eglDestroySurface(dc->gl.egl.display, dc->gl.egl.surface);
433 dc->gl.egl.surface = NULL;
436 if (dc->gl.currentWndSurface != NULL) {
437 dc->gl.currentWndSurface->decStrong(NULL);
440 dc->gl.currentWndSurface = (ANativeWindow *)sur;
441 if (dc->gl.currentWndSurface != NULL) {
442 dc->gl.currentWndSurface->incStrong(NULL);
445 dc->gl.egl.surface = eglCreateWindowSurface(dc->gl.egl.display, dc->gl.egl.config,
446 dc->gl.currentWndSurface, NULL);
448 if (dc->gl.egl.surface == EGL_NO_SURFACE) {
453 ret = eglMakeCurrent(dc->gl.egl.display, dc->gl.egl.surface,
454 dc->gl.egl.surface, dc->gl.egl.context);
462 RsdHal *dc = (RsdHal *)rsc->mHal.drv;
464 if (dc->gl.wndSurface != NULL) {
465 dc->gl.wndSurface->decStrong(NULL);
466 dc->gl.wndSurface = NULL;
471 dc->gl.wndSurface = (ANativeWindow *)sur;
472 if (dc->gl.wndSurface != NULL) {
473 dc->gl.wndSurface->incStrong(NULL);
481 RsdHal *dc = (RsdHal *)rsc->mHal.drv;
482 RSD_CALL_GL(eglSwapBuffers, dc->gl.egl.display, dc->gl.egl.surface);