[M94 Migration][DA][Rendering] Fix webgl contents black screen issue. 12/293312/13
authorAditya Jha <aditya.jha@samsung.com>
Tue, 23 May 2023 20:56:25 +0000 (02:26 +0530)
committerBot Blink <blinkbot@samsung.com>
Wed, 7 Jun 2023 02:49:00 +0000 (02:49 +0000)
In the case of heavy webgl contents, screen compositing is accomplished
before webgl scene is finished. Call |glFinish| to ensure webgl
contents is complete.

Ref: https://review.tizen.org/gerrit/c/251751

Change-Id: I1706314ea2dcc88ec74cc1382975b2620344016c
Signed-off-by: Aditya Jha <aditya.jha@samsung.com>
third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc
third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.h

index ca220b1a9311c5e276579991c01d80dd272699bf..3c627a06a16785cf3e36ba8e61aa9f242905b2e7 100644 (file)
@@ -8890,6 +8890,10 @@ void WebGLRenderingContextBase::SetFramebuffer(GLenum target,
     GetDrawingBuffer()->Bind(target);
   } else {
     ContextGL()->BindFramebuffer(target, buffer->Object());
+#if defined(OS_TIZEN_DA_PRODUCT)
+    if (GetDrawingBuffer())
+      GetDrawingBuffer()->MarkOffscreenFramebufferChanged();
+#endif
   }
 }
 
index bd0e14b6b994f903fa67961a4863a1021f81a10b..8d92b5cc2f4cac3afc7518643be387b539510491 100644 (file)
 #include "third_party/skia/include/gpu/gl/GrGLTypes.h"
 #include "v8/include/v8.h"
 
+#if defined(OS_TIZEN)
+#include "tizen/system_info.h"
+#endif
+
 namespace blink {
 
 namespace {
@@ -547,6 +551,13 @@ bool DrawingBuffer::FinishPrepareTransferableResourceGpu(
     // to be treated atomically.
     gl_->DescheduleUntilFinishedCHROMIUM();
 #endif
+
+#if defined(OS_TIZEN_DA_PRODUCT)
+    if (offscreen_framebuffer_changed_) {
+      gl_->Finish();
+    }
+    offscreen_framebuffer_changed_ = false;
+#endif
   }
 
   // Populate the output mailbox and callback.
index eebcf5f8940d191f6f580d81fe9cacd4c42f4da4..65cde534b89b15fea50a3d2ca2a70aa391d2e736 100644 (file)
@@ -203,6 +203,11 @@ class PLATFORM_EXPORT DrawingBuffer : public cc::TextureLayerClient,
   // have not yet been resolved.
   bool MarkContentsChanged();
 
+#if defined(OS_TIZEN_DA_PRODUCT)
+  void MarkOffscreenFramebufferChanged() {
+    offscreen_framebuffer_changed_ = true;
+  }
+#endif
   // Maintenance of auto-clearing of color/depth/stencil buffers. The
   // Reset method is present to keep calling code simpler, so it
   // doesn't have to know which buffers were allocated.
@@ -632,7 +637,9 @@ class PLATFORM_EXPORT DrawingBuffer : public cc::TextureLayerClient,
   // True if resolveIfNeeded() has been called since the last time
   // markContentsChanged() had been called.
   bool contents_change_resolved_ = false;
-
+#if defined(OS_TIZEN_DA_PRODUCT)
+  bool offscreen_framebuffer_changed_ = false;
+#endif
   // A bitmask of GL buffer bits (GL_COLOR_BUFFER_BIT,
   // GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT) which need to be
   // auto-cleared.