[M85 Migration] Ensure ProduceTexture is executed before ConsumeTexture 84/245384/4
authorChandan Padhi <c.padhi@samsung.com>
Tue, 10 Dec 2019 05:42:48 +0000 (11:12 +0530)
committerBot Blink <blinkbot@samsung.com>
Mon, 12 Oct 2020 09:17:35 +0000 (09:17 +0000)
Black patches are seen occasionally while navigating back and
forth between pages. This is a sync issue where ConsumeTexture
gets executed before ProduceTexture's execution is completed.

To fix this issue, we add glFlush and glError before renderer
submits a frame to the browser. This will ensure that execution
of ProduceTexture is completed before ConsumeTexture is called.

Reference:
https://review.tizen.org/gerrit/c/197968/

Change-Id: I6882269588d257da3c455c2aa575b43c26e1d958
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
Signed-off-by: uzair <uzair.jaleel@samsung.com>
cc/mojo_embedder/async_layer_tree_frame_sink.cc

index b534bbb..be439af 100644 (file)
 #include "components/viz/common/hit_test/hit_test_region_list.h"
 #include "components/viz/common/quads/compositor_frame.h"
 
+#if defined(USE_EFL)
+#include "gpu/command_buffer/client/gles2_interface.h"
+#endif
+
 namespace {
 
 base::HistogramBase* GetHistogramNamed(const char* histogram_name_format,
@@ -246,6 +250,13 @@ void AsyncLayerTreeFrameSink::SubmitCompositorFrame(
                          TRACE_EVENT_FLAG_FLOW_OUT, "step",
                          "SubmitHitTestData");
 
+#if defined(USE_EFL)
+  if (auto* compositor_context_provider = context_provider()) {
+    compositor_context_provider->ContextGL()->Flush();
+    compositor_context_provider->ContextGL()->GetError();
+  }
+#endif
+
   compositor_frame_sink_ptr_->SubmitCompositorFrame(
       local_surface_id_, std::move(frame), std::move(hit_test_region_list), 0);
 }