Bug 1858921 - Part 6: Remove unused default template arguments r=sfink
[gecko.git] / dom / canvas / WebGLRenderbuffer.h
blob9f9d9e212be610744292c4430401ba46bdb86ec5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 #ifndef WEBGL_RENDERBUFFER_H_
7 #define WEBGL_RENDERBUFFER_H_
9 #include "CacheInvalidator.h"
10 #include "WebGLObjectModel.h"
11 #include "WebGLStrongTypes.h"
12 #include "WebGLTexture.h"
14 namespace mozilla {
15 namespace webgl {
16 struct FormatUsageInfo;
19 class WebGLRenderbuffer final : public WebGLContextBoundObject,
20 public WebGLRectangleObject,
21 public CacheInvalidator {
22 friend class WebGLFramebuffer;
23 friend class WebGLFBAttachPoint;
25 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(WebGLRenderbuffer, override)
27 public:
28 const GLuint mPrimaryRB;
30 protected:
31 const bool mEmulatePackedDepthStencil;
32 GLuint mSecondaryRB;
33 webgl::ImageInfo mImageInfo;
35 public:
36 explicit WebGLRenderbuffer(WebGLContext* webgl);
38 const auto& ImageInfo() const { return mImageInfo; }
40 void RenderbufferStorage(uint32_t samples, GLenum internalFormat,
41 uint32_t width, uint32_t height);
42 // Only handles a subset of `pname`s.
43 GLint GetRenderbufferParameter(RBParam pname) const;
45 auto MemoryUsage() const { return mImageInfo.MemoryUsage(); }
47 protected:
48 ~WebGLRenderbuffer() override;
50 void DoFramebufferRenderbuffer(GLenum attachment) const;
51 GLenum DoRenderbufferStorage(uint32_t samples,
52 const webgl::FormatUsageInfo* format,
53 uint32_t width, uint32_t height);
56 } // namespace mozilla
58 #endif // WEBGL_RENDERBUFFER_H_