2014-03-03 23:14:35 -08: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/. */
|
|
|
|
|
|
|
|
#ifndef WEBGLFRAMEBUFFERATTACHABLE_H_
|
|
|
|
#define WEBGLFRAMEBUFFERATTACHABLE_H_
|
|
|
|
|
|
|
|
#include "GLDefs.h"
|
2014-07-30 12:52:06 -07:00
|
|
|
#include "nsTArray.h"
|
2014-07-30 12:52:07 -07:00
|
|
|
#include "mozilla/WeakPtr.h"
|
|
|
|
#include "WebGLFramebuffer.h"
|
2014-09-25 08:21:33 -07:00
|
|
|
#include "WebGLStrongTypes.h"
|
2014-03-03 23:14:35 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class WebGLFramebufferAttachable
|
|
|
|
{
|
|
|
|
struct AttachmentPoint
|
|
|
|
{
|
2014-09-25 08:21:33 -07:00
|
|
|
AttachmentPoint(const WebGLFramebuffer* fb, FBAttachment attachment)
|
2014-03-03 23:14:35 -08:00
|
|
|
: mFB(fb)
|
|
|
|
, mAttachment(attachment)
|
|
|
|
{}
|
|
|
|
|
2014-07-30 12:52:07 -07:00
|
|
|
WeakPtr<const WebGLFramebuffer> mFB;
|
2014-09-25 08:21:33 -07:00
|
|
|
FBAttachment mAttachment;
|
2014-03-03 23:14:35 -08:00
|
|
|
|
2014-07-30 12:52:06 -07:00
|
|
|
bool operator==(const AttachmentPoint& o) const {
|
|
|
|
return mFB == o.mFB && mAttachment == o.mAttachment;
|
|
|
|
}
|
|
|
|
};
|
2014-03-03 23:14:35 -08:00
|
|
|
|
2014-07-30 12:52:06 -07:00
|
|
|
nsTArray<AttachmentPoint> mAttachmentPoints;
|
2014-03-03 23:14:35 -08:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Track FBO/Attachment combinations
|
2014-09-25 08:21:33 -07:00
|
|
|
void AttachTo(WebGLFramebuffer* fb, FBAttachment attachment);
|
|
|
|
void DetachFrom(WebGLFramebuffer* fb, FBAttachment attachment);
|
2014-03-03 23:14:35 -08:00
|
|
|
void NotifyFBsStatusChanged();
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // !WEBGLFRAMEBUFFERATTACHABLE_H_
|