OSDN Git Service

Ensure Media surface state is updated correctly.
authorKalyan Kondapally <kalyan.kondapally@intel.com>
Sun, 14 Jan 2018 20:29:46 +0000 (12:29 -0800)
committerKalyan Kondapally <kalyan.kondapally@intel.com>
Sun, 14 Jan 2018 20:35:17 +0000 (12:35 -0800)
GL Backend reset's clear surface state correctly, which we
relied in DisplayQueue to determine if we need to refresh
the surface in case of partial update. VA backend never
did that resulting in display frame never getting updated
after set once. Now, we ensure we refresh surfaces in case
we need partial clear.

Jira: None.
Test: Video layer scales correctly when changing between full
      screen and non-fullscreen mode.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
common/compositor/va/varenderer.cpp
common/display/displayqueue.cpp

index 9080b4e..09839c9 100644 (file)
@@ -208,6 +208,8 @@ bool VARenderer::SetVAProcFilterDeinterlaceMode(
 
 bool VARenderer::Draw(const MediaState& state, NativeSurface* surface) {
   CTRACE();
+  // TODO: Clear surface ?
+  surface->SetClearSurface(NativeSurface::kNone);
   OverlayBuffer* buffer_out = surface->GetLayer()->GetBuffer();
   int rt_format = DrmFormatToRTFormat(buffer_out->GetFormat());
   if (va_context_ == VA_INVALID_ID || render_target_format_ != rt_format) {
index 8b0a117..ef9ae4f 100644 (file)
@@ -283,14 +283,16 @@ void DisplayQueue::GetCachedLayers(const std::vector<OverlayLayer>& layers,
 
       // Let's get the state from surface if it needs to be cleared.
       if (!clear_surface) {
+        if (update_rect) {
+          last_plane.RefreshSurfaces(NativeSurface::kPartialClear);
+        }
+
         NativeSurface* surface = last_plane.GetOffScreenTarget();
         if (surface) {
           clear_surface = surface->ClearSurface();
         }
 
-        if (!clear_surface && update_rect) {
-          last_plane.RefreshSurfaces(NativeSurface::kPartialClear);
-        }
+        content_changed = content_changed || update_rect || clear_surface;
       }
 
       if (content_changed) {