From 3cd85ae1241949a5227906fad79a5ac204adb185 Mon Sep 17 00:00:00 2001 From: Chandan Padhi Date: Tue, 10 Dec 2019 11:12:48 +0530 Subject: [PATCH] [M85 Migration] Ensure ProduceTexture is executed before ConsumeTexture 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 Signed-off-by: uzair --- cc/mojo_embedder/async_layer_tree_frame_sink.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cc/mojo_embedder/async_layer_tree_frame_sink.cc b/cc/mojo_embedder/async_layer_tree_frame_sink.cc index b534bbb..be439af 100644 --- a/cc/mojo_embedder/async_layer_tree_frame_sink.cc +++ b/cc/mojo_embedder/async_layer_tree_frame_sink.cc @@ -19,6 +19,10 @@ #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); } -- 2.7.4