#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/viz/demo/client/demo_client.h"
#include <memory>
#include <utility>
#include <vector>
#include "components/viz/common/quads/compositor_frame.h"
#include "components/viz/common/quads/solid_color_draw_quad.h"
#include "components/viz/common/quads/surface_draw_quad.h"
namespace demo {
DemoClient::DemoClient(const viz::FrameSinkId& frame_sink_id,
const viz::LocalSurfaceId& local_surface_id,
const gfx::Rect& bounds)
: … { … }
DemoClient::~DemoClient() = default;
void DemoClient::Initialize(
mojo::PendingReceiver<viz::mojom::CompositorFrameSinkClient> receiver,
mojo::PendingAssociatedRemote<viz::mojom::CompositorFrameSink>
sink_remote) { … }
void DemoClient::Initialize(
mojo::PendingReceiver<viz::mojom::CompositorFrameSinkClient> receiver,
mojo::PendingRemote<viz::mojom::CompositorFrameSink> sink_remote) { … }
viz::LocalSurfaceId DemoClient::Embed(const viz::FrameSinkId& frame_sink_id,
const gfx::Rect& bounds) { … }
void DemoClient::Resize(const gfx::Size& size,
const viz::LocalSurfaceId& local_surface_id) { … }
viz::CompositorFrame DemoClient::CreateFrame(const viz::BeginFrameArgs& args) { … }
viz::mojom::CompositorFrameSink* DemoClient::GetPtr() { … }
void DemoClient::InitializeOnThread(
mojo::PendingReceiver<viz::mojom::CompositorFrameSinkClient> receiver,
mojo::PendingAssociatedRemote<viz::mojom::CompositorFrameSink>
associated_sink_remote,
mojo::PendingRemote<viz::mojom::CompositorFrameSink> sink_remote) { … }
void DemoClient::DidReceiveCompositorFrameAck(
std::vector<viz::ReturnedResource> resources) { … }
void DemoClient::OnBeginFrame(const viz::BeginFrameArgs& args,
const viz::FrameTimingDetailsMap& timing_details,
bool frame_ack,
std::vector<viz::ReturnedResource> resources) { … }
void DemoClient::OnBeginFramePausedChanged(bool paused) { … }
void DemoClient::ReclaimResources(
std::vector<viz::ReturnedResource> resources) { … }
}