Commit e63f403b authored by Daniele Castagna's avatar Daniele Castagna Committed by Commit Bot

viz/cros: HW overlays ifdefs

SkiaRender HW overlays support has been added with various
per-platform ifdefs.

Since Android and CrOS share a lot of the same code, this CL simply
adds defined(OS_CHROMEOS) along with OS_ANDROID in places where the
code can be reused by CrOS.

Bug: 1114290
Change-Id: I385003892c6013f90d09d8ed8d747372d1f59b01
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2342262Reviewed-by: default avatarweiliangc <weiliangc@chromium.org>
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796556}
parent 177e7991
...@@ -2136,11 +2136,11 @@ void SkiaRenderer::ScheduleOverlays() { ...@@ -2136,11 +2136,11 @@ void SkiaRenderer::ScheduleOverlays() {
if (current_frame()->overlay_list.empty()) if (current_frame()->overlay_list.empty())
return; return;
#if defined(OS_ANDROID) #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
// For Android, only SurfaceControl uses this code path. Android classic has // CrOS and Android SurfaceControl use this code path. Android classic has
// switched over to OverlayProcessor. // switched over to OverlayProcessor.
// TODO(weiliangc): Remove this when Android SurfaceControl switches to // TODO(weiliangc): Remove this when CrOS and Android SurfaceControl switch
// OverlayProcessor as well. // to OverlayProcessor as well.
DCHECK(output_surface_->capabilities().supports_surfaceless); DCHECK(output_surface_->capabilities().supports_surfaceless);
auto& locks = pending_overlay_locks_.back(); auto& locks = pending_overlay_locks_.back();
std::vector<gpu::SyncToken> sync_tokens; std::vector<gpu::SyncToken> sync_tokens;
......
...@@ -347,7 +347,7 @@ void OutputPresenterGL::CommitOverlayPlanes( ...@@ -347,7 +347,7 @@ void OutputPresenterGL::CommitOverlayPlanes(
std::vector<OutputPresenter::OverlayData> OutputPresenterGL::ScheduleOverlays( std::vector<OutputPresenter::OverlayData> OutputPresenterGL::ScheduleOverlays(
SkiaOutputSurface::OverlayList overlays) { SkiaOutputSurface::OverlayList overlays) {
std::vector<OverlayData> pending_overlays; std::vector<OverlayData> pending_overlays;
#if defined(OS_ANDROID) || defined(OS_APPLE) #if defined(OS_ANDROID) || defined(OS_APPLE) || defined(OS_CHROMEOS)
// Note while reading through this for-loop that |overlay| has different // Note while reading through this for-loop that |overlay| has different
// types on different platforms. On Android and Ozone it is an // types on different platforms. On Android and Ozone it is an
// OverlayCandidate, on Windows it is a DCLayerOverlay, and on macOS it is // OverlayCandidate, on Windows it is a DCLayerOverlay, and on macOS it is
...@@ -380,7 +380,7 @@ std::vector<OutputPresenter::OverlayData> OutputPresenterGL::ScheduleOverlays( ...@@ -380,7 +380,7 @@ std::vector<OutputPresenter::OverlayData> OutputPresenterGL::ScheduleOverlays(
std::move(shared_image_access)); std::move(shared_image_access));
} }
#if defined(OS_ANDROID) #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
if (gl_image) { if (gl_image) {
DCHECK(!overlay.gpu_fence_id); DCHECK(!overlay.gpu_fence_id);
gl_surface_->ScheduleOverlayPlane( gl_surface_->ScheduleOverlayPlane(
...@@ -400,7 +400,7 @@ std::vector<OutputPresenter::OverlayData> OutputPresenterGL::ScheduleOverlays( ...@@ -400,7 +400,7 @@ std::vector<OutputPresenter::OverlayData> OutputPresenterGL::ScheduleOverlays(
overlay.shared_state->opacity, overlay.filter)); overlay.shared_state->opacity, overlay.filter));
#endif #endif
} }
#endif // defined(OS_ANDROID) || defined(OS_APPLE) #endif // defined(OS_ANDROID) || defined(OS_APPLE) || defined(OS_CHROMEOS)
return pending_overlays; return pending_overlays;
} }
......
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