Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: components/viz/frame_sinks/gpu_compositor_frame_sink.h

Issue 2878113002: mus: Embedder can request and observe BeginFrame for embedded client. (Closed)
Patch Set: . Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_VIZ_FRAME_SINKS_GPU_COMPOSITOR_FRAME_SINK_H_ 5 #ifndef COMPONENTS_VIZ_FRAME_SINKS_GPU_COMPOSITOR_FRAME_SINK_H_
6 #define COMPONENTS_VIZ_FRAME_SINKS_GPU_COMPOSITOR_FRAME_SINK_H_ 6 #define COMPONENTS_VIZ_FRAME_SINKS_GPU_COMPOSITOR_FRAME_SINK_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "cc/ipc/frame_sink_manager.mojom.h"
13 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" 14 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
14 #include "cc/surfaces/compositor_frame_sink_support.h" 15 #include "cc/surfaces/compositor_frame_sink_support.h"
15 #include "cc/surfaces/compositor_frame_sink_support_client.h" 16 #include "cc/surfaces/compositor_frame_sink_support_client.h"
16 #include "cc/surfaces/local_surface_id.h" 17 #include "cc/surfaces/local_surface_id.h"
17 #include "cc/surfaces/surface_id.h" 18 #include "cc/surfaces/surface_id.h"
18 #include "components/viz/frame_sinks/gpu_compositor_frame_sink_delegate.h" 19 #include "components/viz/frame_sinks/gpu_compositor_frame_sink_delegate.h"
19 #include "mojo/public/cpp/bindings/binding.h" 20 #include "mojo/public/cpp/bindings/binding.h"
20 21
21 namespace viz { 22 namespace viz {
22 23
(...skipping 17 matching lines...) Expand all
40 void EvictCurrentSurface() override; 41 void EvictCurrentSurface() override;
41 void SetNeedsBeginFrame(bool needs_begin_frame) override; 42 void SetNeedsBeginFrame(bool needs_begin_frame) override;
42 void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, 43 void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id,
43 cc::CompositorFrame frame) override; 44 cc::CompositorFrame frame) override;
44 void BeginFrameDidNotSwap(const cc::BeginFrameAck& begin_frame_ack) override; 45 void BeginFrameDidNotSwap(const cc::BeginFrameAck& begin_frame_ack) override;
45 46
46 // cc::mojom::MojoCompositorFrameSinkPrivate: 47 // cc::mojom::MojoCompositorFrameSinkPrivate:
47 void ClaimTemporaryReference(const cc::SurfaceId& surface_id) override; 48 void ClaimTemporaryReference(const cc::SurfaceId& surface_id) override;
48 void RequestCopyOfSurface( 49 void RequestCopyOfSurface(
49 std::unique_ptr<cc::CopyOutputRequest> request) override; 50 std::unique_ptr<cc::CopyOutputRequest> request) override;
51 void RequestBeginFrames(cc::mojom::FrameSinkObserverPtr observer) override;
50 52
51 private: 53 private:
52 // cc::CompositorFrameSinkSupportClient implementation: 54 // cc::CompositorFrameSinkSupportClient implementation:
53 void DidReceiveCompositorFrameAck( 55 void DidReceiveCompositorFrameAck(
54 const cc::ReturnedResourceArray& resources) override; 56 const cc::ReturnedResourceArray& resources) override;
55 void OnBeginFrame(const cc::BeginFrameArgs& args) override; 57 void OnBeginFrame(const cc::BeginFrameArgs& args) override;
56 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; 58 void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
57 void WillDrawSurface(const cc::LocalSurfaceId& local_surface_id, 59 void WillDrawSurface(const cc::LocalSurfaceId& local_surface_id,
58 const gfx::Rect& damage_rect) override; 60 const gfx::Rect& damage_rect) override;
59 61
60 void OnClientConnectionLost(); 62 void OnClientConnectionLost();
61 void OnPrivateConnectionLost(); 63 void OnPrivateConnectionLost();
62 64
63 GpuCompositorFrameSinkDelegate* const delegate_; 65 GpuCompositorFrameSinkDelegate* const delegate_;
64 std::unique_ptr<cc::CompositorFrameSinkSupport> support_; 66 std::unique_ptr<cc::CompositorFrameSinkSupport> support_;
65 67
66 bool client_connection_lost_ = false; 68 bool client_connection_lost_ = false;
67 bool private_connection_lost_ = false; 69 bool private_connection_lost_ = false;
68 70
71 cc::mojom::FrameSinkObserverPtr observer_;
72
69 cc::mojom::MojoCompositorFrameSinkClientPtr client_; 73 cc::mojom::MojoCompositorFrameSinkClientPtr client_;
70 mojo::Binding<cc::mojom::MojoCompositorFrameSink> 74 mojo::Binding<cc::mojom::MojoCompositorFrameSink>
71 compositor_frame_sink_binding_; 75 compositor_frame_sink_binding_;
72 mojo::Binding<cc::mojom::MojoCompositorFrameSinkPrivate> 76 mojo::Binding<cc::mojom::MojoCompositorFrameSinkPrivate>
73 compositor_frame_sink_private_binding_; 77 compositor_frame_sink_private_binding_;
74 78
75 DISALLOW_COPY_AND_ASSIGN(GpuCompositorFrameSink); 79 DISALLOW_COPY_AND_ASSIGN(GpuCompositorFrameSink);
76 }; 80 };
77 81
78 } // namespace viz 82 } // namespace viz
79 83
80 #endif // COMPONENTS_VIZ_FRAME_SINKS_GPU_COMPOSITOR_FRAME_SINK_H_ 84 #endif // COMPONENTS_VIZ_FRAME_SINKS_GPU_COMPOSITOR_FRAME_SINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698