Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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 #ifndef UI_AURA_LOCAL_COMPOSITOR_FRAME_SINK_LOCAL_H_ | |
| 6 #define UI_AURA_LOCAL_COMPOSITOR_FRAME_SINK_LOCAL_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "cc/output/compositor_frame_sink.h" | |
| 11 #include "cc/scheduler/begin_frame_source.h" | |
| 12 #include "cc/surfaces/compositor_frame_sink_support_client.h" | |
| 13 #include "cc/surfaces/frame_sink_id.h" | |
| 14 #include "cc/surfaces/local_surface_id_allocator.h" | |
| 15 #include "ui/aura/window_port.h" | |
| 16 #include "ui/base/property_data.h" | |
| 17 | |
| 18 namespace cc { | |
| 19 class CompositorFrameSinkSupport; | |
| 20 class SurfaceManager; | |
| 21 } | |
| 22 | |
| 23 namespace aura { | |
| 24 | |
| 25 class CompositorFrameSinkLocal : public cc::CompositorFrameSink, | |
|
sky
2017/05/08 22:36:43
Please add a description to all files. It may be o
Peng
2017/05/09 17:26:57
Done.
| |
| 26 public cc::CompositorFrameSinkSupportClient, | |
| 27 public cc::ExternalBeginFrameSourceClient { | |
| 28 public: | |
| 29 CompositorFrameSinkLocal(const cc::FrameSinkId& frame_sink_id, | |
| 30 cc::SurfaceManager* surface_manager); | |
| 31 ~CompositorFrameSinkLocal() override; | |
| 32 | |
| 33 using SurfaceChangedCallback = | |
| 34 base::Callback<void(const cc::SurfaceId&, const gfx::Size&)>; | |
| 35 void SetSurfaceChangedCallback(const SurfaceChangedCallback& callback); | |
| 36 | |
| 37 // cc::CompositorFrameSink: | |
| 38 bool BindToClient(cc::CompositorFrameSinkClient* client) override; | |
| 39 void DetachFromClient() override; | |
| 40 void SubmitCompositorFrame(cc::CompositorFrame frame) override; | |
| 41 void EvictFrame() override; | |
| 42 | |
| 43 // cc::CompositorFrameSinkSupportClient: | |
| 44 void DidReceiveCompositorFrameAck( | |
| 45 const cc::ReturnedResourceArray& resources) override; | |
| 46 void OnBeginFrame(const cc::BeginFrameArgs& args) override; | |
| 47 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; | |
| 48 void WillDrawSurface(const cc::LocalSurfaceId& local_surface_id, | |
| 49 const gfx::Rect& damage_rect) override {} | |
| 50 | |
| 51 // cc::ExternalBeginFrameSourceClient: | |
| 52 void OnNeedsBeginFrames(bool needs_begin_frames) override; | |
| 53 void OnDidFinishFrame(const cc::BeginFrameAck& ack) override; | |
| 54 | |
| 55 private: | |
| 56 const cc::FrameSinkId frame_sink_id_; | |
| 57 std::unique_ptr<cc::CompositorFrameSinkSupport> support_; | |
| 58 gfx::Size last_submitted_frame_size_; | |
| 59 cc::LocalSurfaceIdAllocator id_allocator_; | |
| 60 cc::LocalSurfaceId local_surface_id_; | |
| 61 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; | |
| 62 std::unique_ptr<base::ThreadChecker> thread_checker_; | |
| 63 SurfaceChangedCallback surface_changed_callback_; | |
| 64 | |
| 65 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkLocal); | |
| 66 }; | |
| 67 | |
| 68 } // namespace aura | |
| 69 | |
| 70 #endif // UI_AURA_LOCAL_COMPOSITOR_FRAME_SINK_LOCAL_H_ | |
| OLD | NEW |