1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 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 #ifndef WEBGLFRAMEBUFFERATTACHABLE_H_
7 #define WEBGLFRAMEBUFFERATTACHABLE_H_
11 #include "mozilla/WeakPtr.h"
12 #include "WebGLFramebuffer.h"
16 class WebGLFramebufferAttachable
18 struct AttachmentPoint
20 AttachmentPoint(const WebGLFramebuffer
* fb
, GLenum attachment
)
22 , mAttachment(attachment
)
25 WeakPtr
<const WebGLFramebuffer
> mFB
;
28 bool operator==(const AttachmentPoint
& o
) const {
29 return mFB
== o
.mFB
&& mAttachment
== o
.mAttachment
;
33 nsTArray
<AttachmentPoint
> mAttachmentPoints
;
37 // Track FBO/Attachment combinations
38 void AttachTo(WebGLFramebuffer
* fb
, GLenum attachment
);
39 void DetachFrom(WebGLFramebuffer
* fb
, GLenum attachment
);
40 void NotifyFBsStatusChanged();
43 } // namespace mozilla
45 #endif // !WEBGLFRAMEBUFFERATTACHABLE_H_