1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_OUTPUT_PRESENTER_FUCHSIA_H_
#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_OUTPUT_PRESENTER_FUCHSIA_H_
#include <memory>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "components/viz/service/display_embedder/output_presenter.h"
#include "components/viz/service/viz_service_export.h"
#include "ui/ozone/public/overlay_plane.h"
namespace ui {
class PlatformWindowSurface;
} // namespace ui
namespace viz {
class SkiaOutputSurfaceDependency;
class VIZ_SERVICE_EXPORT OutputPresenterFuchsia : public OutputPresenter {
public:
static std::unique_ptr<OutputPresenterFuchsia> Create(
ui::PlatformWindowSurface* window_surface,
SkiaOutputSurfaceDependency* deps);
OutputPresenterFuchsia(ui::PlatformWindowSurface* window_surface,
SkiaOutputSurfaceDependency* deps);
~OutputPresenterFuchsia() override;
// OutputPresenter implementation:
void InitializeCapabilities(OutputSurface::Capabilities* capabilities) final;
bool Reshape(const ReshapeParams& params) final;
void Present(SwapCompletionCallback completion_callback,
BufferPresentedCallback presentation_callback,
gfx::FrameData data) final;
void ScheduleOverlayPlane(
const OutputPresenter::OverlayPlaneCandidate& overlay_plane_candidate,
ScopedOverlayAccess* access) final;
private:
struct PendingFrame {
PendingFrame();
~PendingFrame();
PendingFrame(PendingFrame&&);
PendingFrame& operator=(PendingFrame&&);
// Primary plane pixmap.
scoped_refptr<gfx::NativePixmap> native_pixmap;
std::vector<gfx::GpuFenceHandle> acquire_fences;
std::vector<gfx::GpuFenceHandle> release_fences;
// Vector of overlays that are associated with this frame.
std::vector<ui::OverlayPlane> overlays;
};
const raw_ptr<ui::PlatformWindowSurface> window_surface_;
const raw_ptr<SkiaOutputSurfaceDependency> dependency_;
// The next frame to be submitted by SwapBuffers().
std::optional<PendingFrame> next_frame_;
};
} // namespace viz
#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_OUTPUT_PRESENTER_FUCHSIA_H_
|