2014-03-04 11:14:35 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2015-03-17 07:32:52 +03:00
|
|
|
#ifndef WEBGLFRAMEBUFFERATTACHABLE_H_
|
|
|
|
#define WEBGLFRAMEBUFFERATTACHABLE_H_
|
2014-03-04 11:14:35 +04:00
|
|
|
|
|
|
|
#include "GLDefs.h"
|
2015-03-17 04:22:17 +03:00
|
|
|
#include "nsTArray.h"
|
2015-03-17 07:32:52 +03:00
|
|
|
#include "mozilla/WeakPtr.h"
|
2014-07-30 23:52:07 +04:00
|
|
|
#include "WebGLFramebuffer.h"
|
2014-09-25 19:21:33 +04:00
|
|
|
#include "WebGLStrongTypes.h"
|
2014-03-04 11:14:35 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class WebGLFramebufferAttachable
|
|
|
|
{
|
2015-03-17 07:32:52 +03:00
|
|
|
struct AttachmentPoint
|
|
|
|
{
|
|
|
|
AttachmentPoint(const WebGLFramebuffer* fb, FBAttachment attachment)
|
|
|
|
: mFB(fb)
|
|
|
|
, mAttachment(attachment)
|
|
|
|
{}
|
|
|
|
|
|
|
|
WeakPtr<const WebGLFramebuffer> mFB;
|
|
|
|
FBAttachment mAttachment;
|
|
|
|
|
|
|
|
bool operator==(const AttachmentPoint& o) const {
|
|
|
|
return mFB == o.mFB && mAttachment == o.mAttachment;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
nsTArray<AttachmentPoint> mAttachmentPoints;
|
2014-03-04 11:14:35 +04:00
|
|
|
|
|
|
|
public:
|
2015-03-17 07:32:52 +03:00
|
|
|
|
2014-03-04 11:14:35 +04:00
|
|
|
// Track FBO/Attachment combinations
|
2015-03-17 07:32:52 +03:00
|
|
|
void AttachTo(WebGLFramebuffer* fb, FBAttachment attachment);
|
|
|
|
void DetachFrom(WebGLFramebuffer* fb, FBAttachment attachment);
|
|
|
|
void NotifyFBsStatusChanged();
|
2014-03-04 11:14:35 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // !WEBGLFRAMEBUFFERATTACHABLE_H_
|