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/. */
|
|
|
|
|
|
|
|
#include "SharedSurfaceGL.h"
|
2014-07-12 02:10:49 +04:00
|
|
|
|
2013-11-29 00:57:19 +04:00
|
|
|
#include "GLBlitHelper.h"
|
2014-09-03 02:16:02 +04:00
|
|
|
#include "GLContext.h"
|
2014-01-02 19:17:29 +04:00
|
|
|
#include "GLReadTexImageHelper.h"
|
2014-09-03 02:16:02 +04:00
|
|
|
#include "mozilla/gfx/2D.h"
|
2020-01-09 01:19:23 +03:00
|
|
|
#include "mozilla/layers/TextureForwarder.h"
|
2014-09-03 02:16:02 +04:00
|
|
|
#include "ScopedGLHelpers.h"
|
2013-02-14 03:26:24 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gl {
|
|
|
|
|
2019-02-26 01:07:19 +03:00
|
|
|
/*static*/
|
|
|
|
UniquePtr<SharedSurface_Basic> SharedSurface_Basic::Create(
|
2020-06-15 21:25:55 +03:00
|
|
|
const SharedSurfaceDesc& desc) {
|
|
|
|
auto fb = MozFramebuffer::Create(desc.gl, desc.size, 0, false);
|
|
|
|
if (!fb) return nullptr;
|
2015-06-05 03:15:38 +03:00
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
return AsUnique(new SharedSurface_Basic(desc, std::move(fb)));
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2014-08-16 04:38:08 +04:00
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
SharedSurface_Basic::SharedSurface_Basic(const SharedSurfaceDesc& desc,
|
|
|
|
UniquePtr<MozFramebuffer>&& fb)
|
|
|
|
: SharedSurface(desc, std::move(fb)) {}
|
2013-02-14 03:26:24 +04:00
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
Maybe<layers::SurfaceDescriptor> SharedSurface_Basic::ToSurfaceDescriptor() {
|
|
|
|
return Nothing();
|
2013-02-14 03:26:24 +04:00
|
|
|
}
|
|
|
|
|
2015-09-24 17:11:53 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2020-06-15 21:25:55 +03:00
|
|
|
SurfaceFactory_Basic::SurfaceFactory_Basic(GLContext& gl)
|
|
|
|
: SurfaceFactory({&gl, SharedSurfaceType::Basic,
|
|
|
|
layers::TextureType::Unknown, true}) {}
|
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
|