| Index: mojo/services/surfaces/surfaces_impl.h
|
| diff --git a/mojo/services/surfaces/surfaces_impl.h b/mojo/services/surfaces/surfaces_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5ecb9cf57ddfa1554848afbf615d38de7e115846
|
| --- /dev/null
|
| +++ b/mojo/services/surfaces/surfaces_impl.h
|
| @@ -0,0 +1,74 @@
|
| +// Copyright 2014 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.
|
| +
|
| +#ifndef MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_
|
| +#define MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_
|
| +
|
| +#include "base/compiler_specific.h"
|
| +#include "cc/surfaces/display_client.h"
|
| +#include "cc/surfaces/surface_factory.h"
|
| +#include "cc/surfaces/surface_factory_client.h"
|
| +#include "mojo/public/cpp/application/application_connection.h"
|
| +#include "mojo/services/gles2/command_buffer.mojom.h"
|
| +#include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
|
| +
|
| +namespace cc {
|
| +class Display;
|
| +}
|
| +
|
| +namespace mojo {
|
| +class ServiceManager;
|
| +
|
| +namespace surfaces {
|
| +
|
| +class SurfaceNativeViewportClient;
|
| +
|
| +class SurfacesImpl : public InterfaceImpl<Surface>,
|
| + public cc::SurfaceFactoryClient,
|
| + public cc::DisplayClient {
|
| + public:
|
| + class Context {
|
| + public:
|
| + virtual cc::SurfaceManager* Manager() = 0;
|
| + virtual uint32_t IdNamespace() = 0;
|
| + virtual void FrameSubmitted() = 0;
|
| + virtual void SetDisplay(cc::Display*) = 0;
|
| + };
|
| + SurfacesImpl(ApplicationConnection* app, Context* context);
|
| + virtual ~SurfacesImpl();
|
| +
|
| + // InterfaceImpl<Surface> implementation.
|
| + virtual void OnConnectionEstablished() OVERRIDE;
|
| +
|
| + // Surface implementation.
|
| + virtual void CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) OVERRIDE;
|
| + virtual void SubmitFrame(SurfaceIdPtr id, FramePtr frame) OVERRIDE;
|
| + virtual void DestroySurface(SurfaceIdPtr id) OVERRIDE;
|
| + virtual void CreateGLES2BoundSurface(CommandBufferPtr gles2_client,
|
| + SurfaceIdPtr id,
|
| + mojo::SizePtr size) OVERRIDE;
|
| +
|
| + // SurfaceFactoryClient implementation.
|
| + virtual void ReturnResources(
|
| + const cc::ReturnedResourceArray& resources) OVERRIDE;
|
| +
|
| + // DisplayClient implementation.
|
| + virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface() OVERRIDE;
|
| +
|
| + cc::SurfaceFactory* factory() { return &factory_; }
|
| +
|
| + private:
|
| + Context* context_;
|
| + cc::SurfaceFactory factory_;
|
| + uint32_t id_namespace_;
|
| + scoped_ptr<cc::Display> display_;
|
| + ScopedMessagePipeHandle command_buffer_handle_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(SurfacesImpl);
|
| +};
|
| +
|
| +} // namespace surfaces
|
| +} // namespace mojo
|
| +
|
| +#endif // MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_
|
|
|