SharedSurfaceGL.h (1156B)
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/. */ 5 6 #ifndef SHARED_SURFACE_GL_H_ 7 #define SHARED_SURFACE_GL_H_ 8 9 #include "SharedSurface.h" 10 11 namespace mozilla { 12 namespace gl { 13 14 class MozFramebuffer; 15 16 // For readback and bootstrapping: 17 class SharedSurface_Basic final : public SharedSurface { 18 public: 19 static UniquePtr<SharedSurface_Basic> Create(const SharedSurfaceDesc&); 20 21 private: 22 SharedSurface_Basic(const SharedSurfaceDesc& desc, 23 UniquePtr<MozFramebuffer>&& fb); 24 25 public: 26 Maybe<layers::SurfaceDescriptor> ToSurfaceDescriptor() override; 27 }; 28 29 class SurfaceFactory_Basic final : public SurfaceFactory { 30 public: 31 explicit SurfaceFactory_Basic(GLContext& gl); 32 33 virtual UniquePtr<SharedSurface> CreateSharedImpl( 34 const SharedSurfaceDesc& desc) override { 35 return SharedSurface_Basic::Create(desc); 36 } 37 }; 38 39 } // namespace gl 40 } // namespace mozilla 41 42 #endif // SHARED_SURFACE_GL_H_