| Index: components/exo/compositor_frame_sink_holder.cc
|
| diff --git a/components/exo/compositor_frame_sink_holder.cc b/components/exo/compositor_frame_sink_holder.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..032db507715ef7d223b6d0549556b03668f3afae
|
| --- /dev/null
|
| +++ b/components/exo/compositor_frame_sink_holder.cc
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "components/exo/compositor_frame_sink_holder.h"
|
| +
|
| +#include "cc/resources/returned_resource.h"
|
| +
|
| +namespace exo {
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| +// CompositorFrameSinkHolder, public:
|
| +CompositorFrameSinkHolder::CompositorFrameSinkHolder(
|
| + cc::mojom::MojoCompositorFrameSinkClientRequest request)
|
| + : binding_(this, std::move(request)) {}
|
| +
|
| +bool CompositorFrameSinkHolder::HasReleaseCallbacks(cc::ResourceId id) {
|
| + return release_callbacks_.count(id);
|
| +}
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| +// cc::SurfaceFactoryClient overrides:
|
| +
|
| +// TODO(staraz): Implement this
|
| +void CompositorFrameSinkHolder::DidReceiveCompositorFrameAck() {}
|
| +
|
| +// TODO(staraz): Implement this
|
| +void CompositorFrameSinkHolder::OnBeginFrame(const cc::BeginFrameArgs& args) {}
|
| +
|
| +void CompositorFrameSinkHolder::ReclaimResources(
|
| + const cc::ReturnedResourceArray& resources) {
|
| + for (auto& resource : resources) {
|
| + auto it = release_callbacks_.find(resource.id);
|
| + DCHECK(it != release_callbacks_.end());
|
| + it->second.second->Run(resource.sync_token, resource.lost);
|
| + release_callbacks_.erase(it);
|
| + }
|
| +}
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| +// ExoComopositorFrameSink, private:
|
| +CompositorFrameSinkHolder::~CompositorFrameSinkHolder() {}
|
| +
|
| +} // namespace exo
|
|
|