Bug 1874684 - Part 28: Return DateDuration from DifferenceISODateTime. r=mgaudet
[gecko.git] / gfx / webrender_bindings / RenderMacIOSurfaceTextureHost.h
blob173cd3c2238a5fdc2ee0545fa2820879e55667f8
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef MOZILLA_GFX_RENDERMACIOSURFACETEXTUREHOST_H
8 #define MOZILLA_GFX_RENDERMACIOSURFACETEXTUREHOST_H
10 #include "mozilla/gfx/MacIOSurface.h"
11 #include "mozilla/layers/TextureHostOGL.h"
12 #include "RenderTextureHostSWGL.h"
14 namespace mozilla {
16 namespace layers {
17 class SurfaceDescriptorMacIOSurface;
20 namespace wr {
22 class RenderMacIOSurfaceTextureHost final : public RenderTextureHostSWGL {
23 public:
24 explicit RenderMacIOSurfaceTextureHost(MacIOSurface* aSurface);
26 wr::WrExternalImage Lock(uint8_t aChannelIndex, gl::GLContext* aGL) override;
27 void Unlock() override;
29 gfx::IntSize GetSize(uint8_t aChannelIndex) const;
30 GLuint GetGLHandle(uint8_t aChannelIndex) const;
32 RenderMacIOSurfaceTextureHost* AsRenderMacIOSurfaceTextureHost() override {
33 return this;
36 size_t Bytes() override;
38 MacIOSurface* GetSurface() { return mSurface; }
40 // RenderTextureHostSWGL
41 size_t GetPlaneCount() const override;
42 gfx::SurfaceFormat GetFormat() const override;
43 gfx::ColorDepth GetColorDepth() const override;
44 gfx::YUVRangedColorSpace GetYUVColorSpace() const override;
45 bool MapPlane(RenderCompositor* aCompositor, uint8_t aChannelIndex,
46 PlaneInfo& aPlaneInfo) override;
47 void UnmapPlanes() override;
49 private:
50 virtual ~RenderMacIOSurfaceTextureHost();
51 void DeleteTextureHandle();
53 RefPtr<MacIOSurface> mSurface;
54 RefPtr<gl::GLContext> mGL;
55 GLuint mTextureHandles[3];
58 } // namespace wr
59 } // namespace mozilla
61 #endif // MOZILLA_GFX_RENDERMACIOSURFACETEXTUREHOST_H