OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/exo/exo_compositor_frame_sink.h" |
| 6 |
| 7 namespace exo { |
| 8 |
| 9 //////////////////////////////////////////////////////////////////////////////// |
| 10 // ExoComopositorFrameSink, public: |
| 11 |
| 12 ExoComopositorFrameSink::ExoComopositorFrameSink() {} |
| 13 |
| 14 //////////////////////////////////////////////////////////////////////////////// |
| 15 // cc::SurfaceFactoryClient overrides: |
| 16 |
| 17 void ExoComopositorFrameSink::ReturnResources( |
| 18 const cc::ReturnedResourceArray& resources) { |
| 19 scoped_refptr<ExoComopositorFrameSink> holder(this); |
| 20 for (auto& resource : resources) { |
| 21 auto it = release_callbacks_.find(resource.id); |
| 22 DCHECK(it != release_callbacks_.end()); |
| 23 it->second.second->Run(resource.sync_token, resource.lost); |
| 24 release_callbacks_.erase(it); |
| 25 } |
| 26 } |
| 27 |
| 28 void ExoComopositorFrameSink::WillDrawSurface(const cc::LocalFrameId& id, |
| 29 const gfx::Rect& damage_rect) { |
| 30 if (surface_) |
| 31 surface_->WillDraw(); |
| 32 } |
| 33 |
| 34 void ExoComopositorFrameSink::SetBeginFrameSource( |
| 35 cc::BeginFrameSource* begin_frame_source) { |
| 36 if (surface_) |
| 37 surface_->SetBeginFrameSource(begin_frame_source); |
| 38 } |
| 39 |
| 40 //////////////////////////////////////////////////////////////////////////////// |
| 41 // ExoComopositorFrameSink, private: |
| 42 |
| 43 ExoComopositorFrameSink::~ExoComopositorFrameSink() { |
| 44 if (surface_factory_->manager()) |
| 45 surface_factory_->manager()->InvalidateFrameSinkId(frame_sink_id_); |
| 46 } |
| 47 |
| 48 } // namespace exo |
OLD | NEW |