Commit 9121209f authored by Weiliang Chen's avatar Weiliang Chen Committed by Commit Bot

viz: SkiaOutputSurface Checks OutputDevice for SchedulePrimaryPlane

SkiaOutputSUrface checks the OutputDevice implementation for whether it
supports scheduling the primary plane as overlay. This is to match
GLOutputSurface's behavior, where only the BufferQueue implementation
would return true for IsDisplayedAsOverlay(). This also helps avoid
the case where a Surfaceless GLSurface is created for
SkiaOutputDeviceGL.

R=kylechar

Change-Id: Iadfce3551f90e2049db73ed33dfff6ad042c4ccf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095142Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Commit-Queue: weiliangc <weiliangc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749269}
parent 552e4dd4
...@@ -46,6 +46,10 @@ void SkiaOutputDevice::SetGpuVSyncEnabled(bool enabled) { ...@@ -46,6 +46,10 @@ void SkiaOutputDevice::SetGpuVSyncEnabled(bool enabled) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
} }
bool SkiaOutputDevice::IsPrimaryPlaneOverlay() const {
return false;
}
void SkiaOutputDevice::SchedulePrimaryPlane( void SkiaOutputDevice::SchedulePrimaryPlane(
const OverlayProcessorInterface::OutputSurfaceOverlayPlane& plane) { const OverlayProcessorInterface::OutputSurfaceOverlayPlane& plane) {
NOTIMPLEMENTED(); NOTIMPLEMENTED();
......
...@@ -99,6 +99,9 @@ class SkiaOutputDevice { ...@@ -99,6 +99,9 @@ class SkiaOutputDevice {
virtual void SetGpuVSyncEnabled(bool enabled); virtual void SetGpuVSyncEnabled(bool enabled);
// Whether the output device's primary plane is an overlay. This returns true
// is the SchedulePrimaryPlane function is implemented.
virtual bool IsPrimaryPlaneOverlay() const;
// Schedule the output device's back buffer as an overlay plane. The scheduled // Schedule the output device's back buffer as an overlay plane. The scheduled
// primary plane will be on screen when SwapBuffers() or PostSubBuffer() is // primary plane will be on screen when SwapBuffers() or PostSubBuffer() is
// called. // called.
......
...@@ -407,6 +407,10 @@ void SkiaOutputDeviceBufferQueue::FreeAllSurfaces() { ...@@ -407,6 +407,10 @@ void SkiaOutputDeviceBufferQueue::FreeAllSurfaces() {
available_images_.clear(); available_images_.clear();
} }
bool SkiaOutputDeviceBufferQueue::IsPrimaryPlaneOverlay() const {
return true;
}
void SkiaOutputDeviceBufferQueue::SchedulePrimaryPlane( void SkiaOutputDeviceBufferQueue::SchedulePrimaryPlane(
const OverlayProcessorInterface::OutputSurfaceOverlayPlane& plane) { const OverlayProcessorInterface::OutputSurfaceOverlayPlane& plane) {
// If the current_image_ is nullptr, it means there is no change on the // If the current_image_ is nullptr, it means there is no change on the
......
...@@ -57,6 +57,7 @@ class VIZ_SERVICE_EXPORT SkiaOutputDeviceBufferQueue final ...@@ -57,6 +57,7 @@ class VIZ_SERVICE_EXPORT SkiaOutputDeviceBufferQueue final
std::vector<GrBackendSemaphore> TakeEndPaintSemaphores(void) override; std::vector<GrBackendSemaphore> TakeEndPaintSemaphores(void) override;
bool supports_alpha() { return true; } bool supports_alpha() { return true; }
bool IsPrimaryPlaneOverlay() const override;
void SchedulePrimaryPlane( void SchedulePrimaryPlane(
const OverlayProcessorInterface::OutputSurfaceOverlayPlane& plane) const OverlayProcessorInterface::OutputSurfaceOverlayPlane& plane)
override; override;
......
...@@ -990,6 +990,7 @@ void SkiaOutputSurfaceImplOnGpu::SwapBuffers( ...@@ -990,6 +990,7 @@ void SkiaOutputSurfaceImplOnGpu::SwapBuffers(
scoped_output_device_paint_.reset(); scoped_output_device_paint_.reset();
if (output_surface_plane_) { if (output_surface_plane_) {
DCHECK(output_device_->IsPrimaryPlaneOverlay());
output_device_->SchedulePrimaryPlane(output_surface_plane_.value()); output_device_->SchedulePrimaryPlane(output_surface_plane_.value());
output_surface_plane_.reset(); output_surface_plane_.reset();
} }
...@@ -1646,7 +1647,7 @@ void SkiaOutputSurfaceImplOnGpu::ReleaseFenceSyncAndPushTextureUpdates( ...@@ -1646,7 +1647,7 @@ void SkiaOutputSurfaceImplOnGpu::ReleaseFenceSyncAndPushTextureUpdates(
} }
bool SkiaOutputSurfaceImplOnGpu::IsDisplayedAsOverlay() { bool SkiaOutputSurfaceImplOnGpu::IsDisplayedAsOverlay() {
return gl_surface_ ? gl_surface_->IsSurfaceless() : false; return output_device_->IsPrimaryPlaneOverlay();
} }
#if defined(OS_WIN) #if defined(OS_WIN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment