Ensure all gl calls are submitted to GPU 22/289922/4 submit/tizen/20230317.160013
authoruzair <uzair.jaleel@samsung.com>
Wed, 15 Mar 2023 11:09:45 +0000 (16:39 +0530)
committerUzair Jaleel <uzair.jaleel@samsung.com>
Fri, 17 Mar 2023 10:33:01 +0000 (10:33 +0000)
Black screen is observed on static pages as all gl calls
were not submitted to graphics driver, below change helps
fixing the same.

Also improves benchmark scores on TV

+------------------+-------------+------------+
| KPI              |   Before    |    After   |
+------------------+--------------------------+
| Aquarium         |   50 fps    |     60 fps |
+------------------+-------------+------------+
| Falling Leaves   |  Not Smooth |     60 fps |
+------------------+-------------+------------+
| Poster Circle    |  Not Smooth |     60 fps |
+------------------+-------------+------------+

Change-Id: I3df6bead0d7a0817c8dfd5ac4e2836a00fc49580
Signed-off-by: uzair <uzair.jaleel@samsung.com>
cc/mojo_embedder/async_layer_tree_frame_sink.cc

index 029471a..399f501 100644 (file)
 #include "components/viz/common/hit_test/hit_test_region_list.h"
 #include "components/viz/common/quads/compositor_frame.h"
 
+#if BUILDFLAG(IS_TIZEN)
+#include "gpu/command_buffer/client/gles2_interface.h"
+#endif
+
 namespace cc {
 namespace mojo_embedder {
 
@@ -214,6 +218,12 @@ void AsyncLayerTreeFrameSink::SubmitCompositorFrame(
   power_mode_voter_.OnFrameProduced(frame.render_pass_list.back()->damage_rect,
                                     frame.device_scale_factor());
 
+#if BUILDFLAG(IS_TIZEN)
+  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);
 }