#include "components/viz/service/display_embedder/output_presenter_gl.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/feature_list.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "components/viz/common/features.h"
#include "components/viz/service/display_embedder/skia_output_surface_dependency.h"
#include "gpu/command_buffer/service/shared_context_state.h"
#include "ui/display/types/display_snapshot.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rrect_f.h"
#include "ui/gfx/overlay_plane_data.h"
#include "ui/gfx/overlay_transform.h"
#include "ui/gl/gl_fence.h"
#include "ui/gl/presenter.h"
#if BUILDFLAG(IS_OZONE)
#include "ui/base/ui_base_features.h"
#endif
namespace viz {
namespace {
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_OZONE)
std::unique_ptr<gfx::GpuFence> TakeGpuFence(gfx::GpuFenceHandle fence) { … }
#endif
}
OutputPresenterGL::OutputPresenterGL(scoped_refptr<gl::Presenter> presenter,
SkiaOutputSurfaceDependency* deps)
: … { … }
OutputPresenterGL::~OutputPresenterGL() = default;
void OutputPresenterGL::InitializeCapabilities(
OutputSurface::Capabilities* capabilities) { … }
bool OutputPresenterGL::Reshape(const ReshapeParams& params) { … }
void OutputPresenterGL::Present(SwapCompletionCallback completion_callback,
BufferPresentedCallback presentation_callback,
gfx::FrameData data) { … }
void OutputPresenterGL::ScheduleOverlayPlane(
const OutputPresenter::OverlayPlaneCandidate& overlay_plane_candidate,
ScopedOverlayAccess* access,
std::unique_ptr<gfx::GpuFence> acquire_fence) { … }
void OutputPresenterGL::SetVSyncDisplayID(int64_t display_id) { … }
#if BUILDFLAG(IS_APPLE)
void OutputPresenterGL::SetMaxPendingSwaps(int max_pending_swaps) {
presenter_->SetMaxPendingSwaps(max_pending_swaps);
}
#endif
}