0004-Fix-the-build-with-EFL-1.12-https-bugs.webkit.org-sh.patch 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. From baebc004111289ef658c78a42f8332f3dceef41e Mon Sep 17 00:00:00 2001
  2. From: "ryuan.choi@navercorp.com" <ryuan.choi@navercorp.com>
  3. Date: Thu, 13 Nov 2014 07:07:16 +0000
  4. Subject: [PATCH 4/4] Fix the build with EFL 1.12
  5. https://bugs.webkit.org/show_bug.cgi?id=138245
  6. Reviewed by Gyuyoung Kim.
  7. Source/WebKit2:
  8. * UIProcess/API/efl/EwkView.cpp:
  9. First, modified to use Evas_GL raw pointer instead of UniquePtrEfl because
  10. Evas_GL.h can't be included in UniquePtrEfl.h
  11. It should be moved into EvasGLContext because WebKit/EFL use only one Evas_GL.
  12. Second, provided the version of GLES in Evas_GL_Config not to break build with
  13. EFL 1.12
  14. (EwkView::EwkView):
  15. (EwkView::~EwkView):
  16. (EwkView::displayTimerFired):
  17. (EwkView::createGLSurface):
  18. * UIProcess/API/efl/EwkView.h:
  19. Source/WTF:
  20. * wtf/efl/UniquePtrEfl.h:
  21. Removed Evas_GL.h from UniquePtrEfl.h, which is commonly included, because
  22. it should not be included with official GL headers.
  23. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  24. ---
  25. Source/WTF/wtf/efl/UniquePtrEfl.h | 2 --
  26. Source/WebKit2/UIProcess/API/efl/EwkView.cpp | 24 ++++++++++++++++--------
  27. Source/WebKit2/UIProcess/API/efl/EwkView.h | 3 ++-
  28. 3 files changed, 18 insertions(+), 11 deletions(-)
  29. diff --git a/Source/WTF/wtf/efl/UniquePtrEfl.h b/Source/WTF/wtf/efl/UniquePtrEfl.h
  30. index ba0110a..038d3fb 100644
  31. --- a/Source/WTF/wtf/efl/UniquePtrEfl.h
  32. +++ b/Source/WTF/wtf/efl/UniquePtrEfl.h
  33. @@ -33,7 +33,6 @@
  34. #include <Ecore_IMF.h>
  35. #include <Eina.h>
  36. #include <Evas.h>
  37. -#include <Evas_GL.h>
  38. namespace WTF {
  39. @@ -51,7 +50,6 @@ using EflUniquePtr = std::unique_ptr<T, EflPtrDeleter<T>>;
  40. macro(Eina_Hash, eina_hash_free) \
  41. macro(Eina_Module, eina_module_free) \
  42. macro(Evas_Object, evas_object_del) \
  43. - macro(Evas_GL, evas_gl_free)
  44. #define WTF_DEFINE_EFLPTR_DELETER(typeName, deleterFunc) \
  45. template<> struct EflPtrDeleter<typeName> \
  46. diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp
  47. index 50d34ed..6ff3394 100755
  48. --- a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp
  49. +++ b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp
  50. @@ -299,9 +299,11 @@ EwkView::EwkView(WKViewRef view, Evas_Object* evasObject)
  51. // FIXME: Remove when possible.
  52. static_cast<WebViewEfl*>(webView())->setEwkView(this);
  53. - m_evasGL = EflUniquePtr<Evas_GL>(evas_gl_new(evas_object_evas_get(m_evasObject)));
  54. +
  55. + // FIXME: Consider it to move into EvasGLContext.
  56. + m_evasGL = evas_gl_new(evas_object_evas_get(m_evasObject));
  57. if (m_evasGL)
  58. - m_evasGLContext = EvasGLContext::create(m_evasGL.get());
  59. + m_evasGLContext = EvasGLContext::create(m_evasGL);
  60. if (!m_evasGLContext) {
  61. WARN("Failed to create Evas_GL, falling back to software mode.");
  62. @@ -333,6 +335,9 @@ EwkView::~EwkView()
  63. {
  64. ASSERT(wkPageToEvasObjectMap().get(wkPage()) == m_evasObject);
  65. wkPageToEvasObjectMap().remove(wkPage());
  66. +
  67. + if (m_evasGL)
  68. + evas_gl_free(m_evasGL);
  69. }
  70. EwkView* EwkView::create(WKViewRef webView, Evas* canvas, Evas_Smart* smart)
  71. @@ -587,7 +592,7 @@ void EwkView::displayTimerFired(Timer<EwkView>*)
  72. return;
  73. }
  74. - evas_gl_make_current(m_evasGL.get(), m_evasGLSurface->surface(), m_evasGLContext->context());
  75. + evas_gl_make_current(m_evasGL, m_evasGLSurface->surface(), m_evasGLContext->context());
  76. WKViewPaintToCurrentGLContext(wkView());
  77. @@ -828,21 +833,24 @@ bool EwkView::createGLSurface()
  78. EVAS_GL_DEPTH_BIT_8,
  79. EVAS_GL_STENCIL_NONE,
  80. EVAS_GL_OPTIONS_NONE,
  81. - EVAS_GL_MULTISAMPLE_NONE
  82. + EVAS_GL_MULTISAMPLE_NONE,
  83. +#if defined(EVAS_GL_API_VERSION) && EVAS_GL_API_VERSION >= 2
  84. + EVAS_GL_GLES_2_X
  85. +#endif
  86. };
  87. // Recreate to current size: Replaces if non-null, and frees existing surface after (OwnPtr).
  88. - m_evasGLSurface = EvasGLSurface::create(m_evasGL.get(), &evasGLConfig, deviceSize());
  89. + m_evasGLSurface = EvasGLSurface::create(m_evasGL, &evasGLConfig, deviceSize());
  90. if (!m_evasGLSurface)
  91. return false;
  92. Evas_Native_Surface nativeSurface;
  93. - evas_gl_native_surface_get(m_evasGL.get(), m_evasGLSurface->surface(), &nativeSurface);
  94. + evas_gl_native_surface_get(m_evasGL, m_evasGLSurface->surface(), &nativeSurface);
  95. evas_object_image_native_surface_set(smartData()->image, &nativeSurface);
  96. - evas_gl_make_current(m_evasGL.get(), m_evasGLSurface->surface(), m_evasGLContext->context());
  97. + evas_gl_make_current(m_evasGL, m_evasGLSurface->surface(), m_evasGLContext->context());
  98. - Evas_GL_API* gl = evas_gl_api_get(m_evasGL.get());
  99. + Evas_GL_API* gl = evas_gl_api_get(m_evasGL);
  100. WKPoint boundsEnd = WKViewUserViewportToScene(wkView(), WKPointMake(deviceSize().width(), deviceSize().height()));
  101. gl->glViewport(0, 0, boundsEnd.x, boundsEnd.y);
  102. diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.h b/Source/WebKit2/UIProcess/API/efl/EwkView.h
  103. index 1c482cf..68dab87 100644
  104. --- a/Source/WebKit2/UIProcess/API/efl/EwkView.h
  105. +++ b/Source/WebKit2/UIProcess/API/efl/EwkView.h
  106. @@ -39,6 +39,7 @@
  107. #endif
  108. typedef struct _cairo_surface cairo_surface_t;
  109. +typedef struct _Evas_GL Evas_GL;
  110. namespace WebKit {
  111. class ContextMenuClientEfl;
  112. @@ -241,7 +242,7 @@ private:
  113. Evas_Object* m_evasObject;
  114. RefPtr<EwkContext> m_context;
  115. RefPtr<EwkPageGroup> m_pageGroup;
  116. - EflUniquePtr<Evas_GL> m_evasGL;
  117. + Evas_GL* m_evasGL;
  118. std::unique_ptr<WebCore::EvasGLContext> m_evasGLContext;
  119. std::unique_ptr<WebCore::EvasGLSurface> m_evasGLSurface;
  120. bool m_pendingSurfaceResize;
  121. --
  122. 2.1.3