| Index: services/ui/surfaces/compositor_frame_sink.h
|
| diff --git a/services/ui/surfaces/display_compositor.h b/services/ui/surfaces/compositor_frame_sink.h
|
| similarity index 70%
|
| copy from services/ui/surfaces/display_compositor.h
|
| copy to services/ui/surfaces/compositor_frame_sink.h
|
| index 4ec50dedbc9b1a10e02f53216ccfcf6834dacf80..6ba22c5e87f34b698a370980e9e7c70efb998e4b 100644
|
| --- a/services/ui/surfaces/display_compositor.h
|
| +++ b/services/ui/surfaces/compositor_frame_sink.h
|
| @@ -2,15 +2,15 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_
|
| -#define SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_
|
| +#ifndef SERVICES_UI_SURFACES_COMPOSITOR_FRAME_SINK_H_
|
| +#define SERVICES_UI_SURFACES_COMPOSITOR_FRAME_SINK_H_
|
|
|
| #include "cc/surfaces/display_client.h"
|
| #include "cc/surfaces/surface.h"
|
| #include "cc/surfaces/surface_factory.h"
|
| #include "cc/surfaces/surface_factory_client.h"
|
| #include "cc/surfaces/surface_id_allocator.h"
|
| -#include "services/ui/surfaces/surfaces_state.h"
|
| +#include "services/ui/surfaces/display_compositor.h"
|
| #include "ui/gfx/native_widget_types.h"
|
|
|
| namespace cc {
|
| @@ -22,22 +22,24 @@ class GpuChannelHost;
|
| }
|
|
|
| namespace ui {
|
| +namespace surfaces {
|
|
|
| // TODO(fsamuel): This should become a mojo interface for the mus-gpu split.
|
| // TODO(fsamuel): This should not be a SurfaceFactoryClient.
|
| -// The DisplayCompositor receives CompositorFrames from all sources,
|
| +// The CompositorFrameSink receives CompositorFrames from all sources,
|
| // creates a top-level CompositorFrame once per tick, and generates graphical
|
| // output.
|
| -class DisplayCompositor : public cc::SurfaceFactoryClient,
|
| - public cc::DisplayClient {
|
| +class CompositorFrameSink : public cc::SurfaceFactoryClient,
|
| + public cc::DisplayClient {
|
| public:
|
| - DisplayCompositor(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| - gfx::AcceleratedWidget widget,
|
| - scoped_refptr<gpu::GpuChannelHost> gpu_channel,
|
| - const scoped_refptr<SurfacesState>& surfaces_state);
|
| - ~DisplayCompositor() override;
|
| -
|
| - // DisplayCompositor embedders submit a CompositorFrame when content on the
|
| + CompositorFrameSink(
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner,
|
| + gfx::AcceleratedWidget widget,
|
| + scoped_refptr<gpu::GpuChannelHost> gpu_channel,
|
| + const scoped_refptr<DisplayCompositor>& display_compositor);
|
| + ~CompositorFrameSink() override;
|
| +
|
| + // CompositorFrameSink embedders submit a CompositorFrame when content on the
|
| // display should be changed. A well-behaving embedder should only submit
|
| // a CompositorFrame once per BeginFrame tick. The callback is called the
|
| // first time this frame is used to draw, or if the frame is discarded.
|
| @@ -45,7 +47,7 @@ class DisplayCompositor : public cc::SurfaceFactoryClient,
|
| const base::Callback<void()>& callback);
|
|
|
| // TODO(fsamuel): This is used for surface hittesting and should not be
|
| - // exposed outside of DisplayCompositor.
|
| + // exposed outside of CompositorFrameSink.
|
| const cc::SurfaceId& surface_id() const { return surface_id_; }
|
|
|
| // This requests the display CompositorFrame be rendered and given to the
|
| @@ -69,16 +71,17 @@ class DisplayCompositor : public cc::SurfaceFactoryClient,
|
| void DisplayDidDrawAndSwap() override;
|
|
|
| scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
|
| - scoped_refptr<SurfacesState> surfaces_state_;
|
| + scoped_refptr<DisplayCompositor> display_compositor_;
|
| cc::SurfaceFactory factory_;
|
| cc::SurfaceIdAllocator allocator_;
|
| cc::SurfaceId surface_id_;
|
|
|
| gfx::Size display_size_;
|
| std::unique_ptr<cc::Display> display_;
|
| - DISALLOW_COPY_AND_ASSIGN(DisplayCompositor);
|
| + DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink);
|
| };
|
|
|
| +} // nanmespace surfaces
|
| } // namespace ui
|
|
|
| -#endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_
|
| +#endif // SERVICES_UI_SURFACES_COMPOSITOR_FRAME_SINK_H_
|
|
|