2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 4; -*- */
|
2013-02-14 03:26:24 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef SHARED_SURFACE_GL_H_
|
|
|
|
#define SHARED_SURFACE_GL_H_
|
|
|
|
|
|
|
|
#include "SharedSurface.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
class MozFramebuffer;
|
2013-02-14 03:26:24 +04:00
|
|
|
|
|
|
|
// For readback and bootstrapping:
|
2020-06-15 21:25:55 +03:00
|
|
|
class SharedSurface_Basic final : public SharedSurface {
|
2018-11-30 13:46:48 +03:00
|
|
|
public:
|
2020-06-15 21:25:55 +03:00
|
|
|
static UniquePtr<SharedSurface_Basic> Create(const SharedSurfaceDesc&);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
private:
|
|
|
|
SharedSurface_Basic(const SharedSurfaceDesc& desc,
|
|
|
|
UniquePtr<MozFramebuffer>&& fb);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-09-24 17:11:53 +03:00
|
|
|
public:
|
2020-06-15 21:25:55 +03:00
|
|
|
Maybe<layers::SurfaceDescriptor> ToSurfaceDescriptor() override;
|
2015-09-24 17:11:53 +03:00
|
|
|
};
|
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
class SurfaceFactory_Basic final : public SurfaceFactory {
|
2015-09-24 17:11:53 +03:00
|
|
|
public:
|
2020-06-15 21:25:55 +03:00
|
|
|
explicit SurfaceFactory_Basic(GLContext& gl);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
virtual UniquePtr<SharedSurface> CreateSharedImpl(
|
|
|
|
const SharedSurfaceDesc& desc) override {
|
|
|
|
return SharedSurface_Basic::Create(desc);
|
2015-09-24 17:11:53 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gl
|
2020-06-15 21:25:55 +03:00
|
|
|
} // namespace mozilla
|
2015-07-13 18:25:42 +03:00
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
#endif // SHARED_SURFACE_GL_H_
|