1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 4; -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "SharedSurfaceGL.h"
8 #include "GLBlitHelper.h"
10 #include "GLReadTexImageHelper.h"
11 #include "mozilla/gfx/2D.h"
12 #include "mozilla/layers/TextureForwarder.h"
13 #include "ScopedGLHelpers.h"
19 UniquePtr
<SharedSurface_Basic
> SharedSurface_Basic::Create(
20 const SharedSurfaceDesc
& desc
) {
21 auto fb
= MozFramebuffer::Create(desc
.gl
, desc
.size
, 0, false);
22 if (!fb
) return nullptr;
24 return AsUnique(new SharedSurface_Basic(desc
, std::move(fb
)));
27 SharedSurface_Basic::SharedSurface_Basic(const SharedSurfaceDesc
& desc
,
28 UniquePtr
<MozFramebuffer
>&& fb
)
29 : SharedSurface(desc
, std::move(fb
)) {}
31 Maybe
<layers::SurfaceDescriptor
> SharedSurface_Basic::ToSurfaceDescriptor() {
35 ////////////////////////////////////////////////////////////////////////
37 SurfaceFactory_Basic::SurfaceFactory_Basic(GLContext
& gl
)
38 : SurfaceFactory({&gl
, SharedSurfaceType::Basic
,
39 layers::TextureType::Unknown
, true}) {}
42 } // namespace mozilla