summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--NEWS2
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api.c114
-rwxr-xr-xsrc/modules/evas/engines/gl_common/evas_gl_core_private.h5
4 files changed, 104 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 97d91a5f59..05977ad8f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
12012-11-16 Sung W. Park (sung_)
2
3 * Fixed glGetIntegerv() in Direct Rendering mode for Evas GL
4 to properly handle GL_SCISSOR_BOX and GL_VIEWPORT parameters.
5
6
12012-11-13 Carsten Haitzler (The Rasterman) 72012-11-13 Carsten Haitzler (The Rasterman)
2 8
3 * Fixed GLX native surface handling to use glXChooseFBConfig. 9 * Fixed GLX native surface handling to use glXChooseFBConfig.
diff --git a/NEWS b/NEWS
index d955f483e0..46080388ab 100644
--- a/NEWS
+++ b/NEWS
@@ -24,3 +24,5 @@ Fixes:
24 eina_mmap_safety_enabled_get() returns after success 24 eina_mmap_safety_enabled_get() returns after success
25 * Fixed GLX native surface handling to use glXChooseFBConfig. 25 * Fixed GLX native surface handling to use glXChooseFBConfig.
26 This frixes a break in compositing on new intel mesa drivers. 26 This frixes a break in compositing on new intel mesa drivers.
27 * Fixed glGetIntegerv() in Direct Rendering mode for Evas GL
28 to properly handle GL_SCISSOR_BOX and GL_VIEWPORT parameters.
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c
index 490667f51e..ef7b5a2699 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api.c
@@ -285,8 +285,8 @@ _evgl_glClear(GLbitfield mask)
285 285
286 if ((ctx->scissor_upated) && (ctx->scissor_enabled)) 286 if ((ctx->scissor_upated) && (ctx->scissor_enabled))
287 { 287 {
288 glScissor(ctx->scissor_coord[0], ctx->scissor_coord[1], 288 glScissor(ctx->dr_scissor_coord[0], ctx->dr_scissor_coord[1],
289 ctx->scissor_coord[2], ctx->scissor_coord[3]); 289 ctx->dr_scissor_coord[2], ctx->dr_scissor_coord[3]);
290 ctx->direct_scissor = 0; 290 ctx->direct_scissor = 0;
291 } 291 }
292 else 292 else
@@ -341,6 +341,62 @@ _evgl_glDisable(GLenum cap)
341 glDisable(cap); 341 glDisable(cap);
342} 342}
343 343
344void
345_evgl_glGetIntegerv(GLenum pname, GLint* params)
346{
347 EVGL_Engine *ee = evgl_engine;
348 EVGL_Resource *rsc;
349 EVGL_Context *ctx;
350 Evas_Object_Protected_Data *img;
351
352 if (evgl_direct_enabled(evgl_engine))
353 {
354 if (!params)
355 {
356 ERR("Inavlid Parameter");
357 return;
358 }
359
360 rsc=_evgl_tls_resource_get(ee);
361 ctx = rsc->current_ctx;
362
363 // Only need to handle it if it's directly rendering to the window
364 if (!(rsc->current_ctx->current_fbo))
365 {
366 img = eo_data_get(rsc->direct_img_obj, EVAS_OBJ_CLASS);
367
368 if (pname==GL_SCISSOR_BOX)
369 {
370 if (ctx->scissor_upated)
371 {
372 memcpy(params, ctx->scissor_coord, sizeof(int)*4);
373 return;
374 }
375 }
376
377 if (pname==GL_VIEWPORT)
378 {
379 if (ctx->viewport_updated)
380 {
381 memcpy(params, ctx->viewport_coord, sizeof(int)*4);
382 return;
383 }
384 }
385
386 // If it hasn't been initialized yet, return img object size
387 if ((pname==GL_SCISSOR_BOX) || (pname==GL_VIEWPORT))
388 {
389 params[0] = 0;
390 params[1] = 0;
391 params[2] = (GLint)img->cur.geometry.w;
392 params[3] = (GLint)img->cur.geometry.h;
393 return;
394 }
395 }
396 }
397
398 glGetIntegerv(pname, params);
399}
344 400
345static void 401static void
346_evgl_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) 402_evgl_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
@@ -425,11 +481,17 @@ _evgl_glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
425 compute_gl_coordinates(img, rot, 1, x, y, width, height, oc, nc); 481 compute_gl_coordinates(img, rot, 1, x, y, width, height, oc, nc);
426 glScissor(nc[0], nc[1], nc[2], nc[3]); 482 glScissor(nc[0], nc[1], nc[2], nc[3]);
427 483
428 // Update coordinates 484 // Keep a copy of the original coordinates
429 ctx->scissor_coord[0] = nc[0]; 485 ctx->scissor_coord[0] = x;
430 ctx->scissor_coord[1] = nc[1]; 486 ctx->scissor_coord[1] = y;
431 ctx->scissor_coord[2] = nc[2]; 487 ctx->scissor_coord[2] = width;
432 ctx->scissor_coord[3] = nc[3]; 488 ctx->scissor_coord[3] = height;
489
490 // Update direct rendering coordinates
491 ctx->dr_scissor_coord[0] = nc[0];
492 ctx->dr_scissor_coord[1] = nc[1];
493 ctx->dr_scissor_coord[2] = nc[2];
494 ctx->dr_scissor_coord[3] = nc[3];
433 495
434 ctx->direct_scissor = 0; 496 ctx->direct_scissor = 0;
435 497
@@ -501,14 +563,22 @@ _evgl_glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
501 563
502 if ((ctx->scissor_upated) && (ctx->scissor_enabled)) 564 if ((ctx->scissor_upated) && (ctx->scissor_enabled))
503 { 565 {
504 glScissor(ctx->scissor_coord[0], ctx->scissor_coord[1], 566 glScissor(ctx->dr_scissor_coord[0], ctx->dr_scissor_coord[1],
505 ctx->scissor_coord[2], ctx->scissor_coord[3]); 567 ctx->dr_scissor_coord[2], ctx->dr_scissor_coord[3]);
506 ctx->direct_scissor = 0; 568 ctx->direct_scissor = 0;
507 } 569 }
508 else 570 else
509 glScissor(oc[0], oc[1], oc[2], oc[3]); 571 glScissor(oc[0], oc[1], oc[2], oc[3]);
510 572
511 glViewport(nc[0], nc[1], nc[2], nc[3]); 573 glViewport(nc[0], nc[1], nc[2], nc[3]);
574
575 // Keep a copy of the original coordinates
576 ctx->viewport_coord[0] = x;
577 ctx->viewport_coord[1] = y;
578 ctx->viewport_coord[2] = width;
579 ctx->viewport_coord[3] = height;
580
581 ctx->viewport_updated = 1;
512 } 582 }
513 else 583 else
514 { 584 {
@@ -1332,18 +1402,6 @@ finish:
1332} 1402}
1333 1403
1334void 1404void
1335_evgld_glGetIntegerv(GLenum pname, GLint* params)
1336{
1337 EVGL_FUNC_BEGIN();
1338 glGetIntegerv(pname, params);
1339 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1340 goto finish;
1341
1342finish:
1343 EVGL_FUNC_END();
1344}
1345
1346void
1347_evgld_glGetProgramiv(GLuint program, GLenum pname, GLint* params) 1405_evgld_glGetProgramiv(GLuint program, GLenum pname, GLint* params)
1348{ 1406{
1349 EVGL_FUNC_BEGIN(); 1407 EVGL_FUNC_BEGIN();
@@ -2538,6 +2596,17 @@ finish:
2538 EVGL_FUNC_END(); 2596 EVGL_FUNC_END();
2539} 2597}
2540 2598
2599void
2600_evgld_glGetIntegerv(GLenum pname, GLint* params)
2601{
2602 EVGL_FUNC_BEGIN();
2603 _evgl_glGetIntegerv(pname, params);
2604 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2605 goto finish;
2606
2607finish:
2608 EVGL_FUNC_END();
2609}
2541 2610
2542static void 2611static void
2543_evgld_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) 2612_evgld_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
@@ -2650,7 +2719,7 @@ _normal_gl_api_get(Evas_GL_API *funcs)
2650 ORD(glGetError); 2719 ORD(glGetError);
2651 ORD(glGetFloatv); 2720 ORD(glGetFloatv);
2652 ORD(glGetFramebufferAttachmentParameteriv); 2721 ORD(glGetFramebufferAttachmentParameteriv);
2653 ORD(glGetIntegerv); 2722// ORD(glGetIntegerv);
2654 ORD(glGetProgramiv); 2723 ORD(glGetProgramiv);
2655 ORD(glGetProgramInfoLog); 2724 ORD(glGetProgramInfoLog);
2656 ORD(glGetRenderbufferParameteriv); 2725 ORD(glGetRenderbufferParameteriv);
@@ -2743,6 +2812,7 @@ _normal_gl_api_get(Evas_GL_API *funcs)
2743 ORD(glClear); 2812 ORD(glClear);
2744 ORD(glDisable); 2813 ORD(glDisable);
2745 ORD(glEnable); 2814 ORD(glEnable);
2815 ORD(glGetIntegerv);
2746 ORD(glReadPixels); 2816 ORD(glReadPixels);
2747 ORD(glScissor); 2817 ORD(glScissor);
2748 ORD(glViewport); 2818 ORD(glViewport);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core_private.h b/src/modules/evas/engines/gl_common/evas_gl_core_private.h
index 838e8f5d4c..be114b497d 100755
--- a/src/modules/evas/engines/gl_common/evas_gl_core_private.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_core_private.h
@@ -121,9 +121,12 @@ struct _EVGL_Context
121 int scissor_enabled; 121 int scissor_enabled;
122 int scissor_upated; 122 int scissor_upated;
123 int scissor_coord[4]; 123 int scissor_coord[4];
124 124 int dr_scissor_coord[4];
125 int direct_scissor; 125 int direct_scissor;
126 126
127 int viewport_updated;
128 int viewport_coord[4];
129
127 EVGL_Surface *current_sfc; 130 EVGL_Surface *current_sfc;
128}; 131};
129 132