[M40 Merge] Fixed that webview is crushed on resizing viewport.
authoruzair.jaleel <uzair.jaleel@samsung.com>
Tue, 28 Apr 2015 07:45:47 +0000 (13:15 +0530)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
webView is crushed when creating/removing IME and rotating device.
It is caused by diffrence between the size of egl surface rendered
and glViewport arguments. The arguments were set by evas geometry size,
but it was different from the size of rendered surface.

M40 patch: http://165.213.202.130/gerrit/#/c/75627/
Bug: http://168.219.209.56/jira/browse/TNEF-190
Reviewed by: DaeHyun Ko, Siba Samal

Change-Id: I9ef7d67f3d05ce1744489dbd14f83fa46772046c
Signed-off-by: uzair.jaleel <uzair.jaleel@samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.h

index affaa2d..12ca47e 100644 (file)
@@ -390,7 +390,8 @@ void RenderWidgetHostViewEfl::PaintTextureToSurface(GLuint texture_id) {
   GL_CHECK_STATUS("GL error before texture paint.");
 
   gfx::Rect bounds = GetViewBoundsInPix();
-  GL_CHECK(gl_api->glViewport(0, 0, bounds.width(), bounds.height()));
+  gfx::Size surface = surface_size_;
+  GL_CHECK(gl_api->glViewport(0, bounds.height() - surface.height(), surface.width(), surface.height()));
   GL_CHECK(gl_api->glClearColor(1.0, 1.0, 1.0, 1.0));
   GL_CHECK(gl_api->glClear(GL_COLOR_BUFFER_BIT));
   GL_CHECK(gl_api->glUseProgram(program_id_));
@@ -1541,7 +1542,7 @@ void RenderWidgetHostViewEfl::OnSwapCompositorFrame(
   // those frames black screen will appear.
   if (frame->gl_frame_data) {
     ack.gl_frame_data = frame->gl_frame_data.Pass();
-
+    surface_size_ = ack.gl_frame_data->size;
     if (evas_gl_initialized_) {
       std::swap(ack.gl_frame_data->mailbox, pending_mailbox_);
       gpu::gles2::MailboxManager* manager =
index ece6de8..58ff036 100644 (file)
@@ -305,6 +305,7 @@ class RenderWidgetHostViewEfl
   unsigned long next_pixmap_id_;
   GLuint texture_id_;
   int surface_id_;
+  gfx::Size surface_size_;
   bool is_modifier_key_;
   GLuint vertex_buffer_obj_;
   GLuint vertex_buffer_obj_270_;