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>
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) {
// 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) {