10
10
#else
11
11
#include < Evas_GL_GLES3_Helpers.h>
12
12
Evas_GL* g_evas_gl = nullptr ;
13
+ EvasGLSync g_glSync = nullptr ;
13
14
EVAS_GL_GLOBAL_GLES3_DEFINE ();
14
15
#endif
15
16
@@ -481,6 +482,16 @@ bool TizenRenderer::OnMakeCurrent() {
481
482
if (evas_gl_make_current (evas_gl_, gl_surface_, gl_context_) != EINA_TRUE) {
482
483
return false ;
483
484
}
485
+ {
486
+ if (g_glSync) {
487
+ evasglClientWaitSync (evas_gl_, g_glSync,
488
+ EVAS_GL_SYNC_PRIOR_COMMANDS_COMPLETE,
489
+ EVAS_GL_FOREVER);
490
+ evasglDestroySync (evas_gl_, g_glSync);
491
+ g_glSync = nullptr ;
492
+ }
493
+ }
494
+
484
495
return true ;
485
496
}
486
497
@@ -517,6 +528,10 @@ bool TizenRenderer::OnPresent() {
517
528
received_rotation = false ;
518
529
}
519
530
evas_object_image_pixels_dirty_set ((Evas_Object*)GetImageHandle (), EINA_TRUE);
531
+ {
532
+ int attr[] = {EVAS_GL_NONE};
533
+ g_glSync = evasglCreateSync (evas_gl_, EVAS_GL_SYNC_FENCE, attr);
534
+ }
520
535
return true ;
521
536
}
522
537
@@ -529,6 +544,16 @@ uint32_t TizenRenderer::OnGetFBO() {
529
544
return 0 ;
530
545
}
531
546
547
+ // There was a problem with gles support in a device that supports open gl
548
+ // es 3.1, so it is forcibly used with 2.1
549
+ const unsigned char gles_str[14 ] = " OpenGL ES 2.1" ;
550
+ const GLubyte* CustomGlGetString (GLenum name) {
551
+ if (name == GL_VERSION) {
552
+ return gles_str;
553
+ }
554
+ return glGetString (name);
555
+ }
556
+
532
557
#define GL_FUNC (FunctionName ) \
533
558
else if (strcmp(name, #FunctionName) == 0 ) { \
534
559
return reinterpret_cast <void *>(FunctionName); \
@@ -595,7 +620,7 @@ void* TizenRenderer::OnProcResolver(const char* name) {
595
620
GL_FUNC (glGetShaderInfoLog)
596
621
GL_FUNC (glGetShaderiv)
597
622
GL_FUNC (glGetShaderPrecisionFormat)
598
- GL_FUNC (glGetString)
623
+ // GL_FUNC(glGetString)
599
624
GL_FUNC (glGetUniformLocation)
600
625
GL_FUNC (glIsTexture)
601
626
GL_FUNC (glLineWidth)
@@ -644,6 +669,9 @@ void* TizenRenderer::OnProcResolver(const char* name) {
644
669
GL_FUNC (glVertexAttribPointer)
645
670
GL_FUNC (glViewport)
646
671
GL_FUNC (glGetStringi)
672
+ else if (strcmp (name, " glGetString" ) == 0 ) {
673
+ return reinterpret_cast <void *>(CustomGlGetString);
674
+ }
647
675
FT_LOGD (" Could not resolve: %s" , name);
648
676
return nullptr ;
649
677
}
@@ -674,7 +702,6 @@ bool TizenRenderer::SetupEvasGL(int32_t x, int32_t y, int32_t w, int32_t h) {
674
702
}
675
703
676
704
g_evas_gl = evas_gl_;
677
-
678
705
gl_config_ = evas_gl_config_new ();
679
706
gl_config_->color_format = EVAS_GL_RGBA_8888;
680
707
gl_config_->depth_bits = EVAS_GL_DEPTH_NONE;
0 commit comments