From: Chandan Padhi Date: Tue, 10 Dec 2019 05:42:48 +0000 (+0530) Subject: [M85 Migration] Ensure ProduceTexture is executed before ConsumeTexture X-Git-Tag: submit/tizen/20201118.160233~119 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F84%2F245384%2F4;p=platform%2Fframework%2Fweb%2Fchromium-efl.git [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 --- 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); }