/src/mozilla-central/dom/canvas/WebGLFramebufferAttachable.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 20; 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/. */ |
5 | | |
6 | | #include "WebGLFramebufferAttachable.h" |
7 | | |
8 | | #include "WebGLFramebuffer.h" |
9 | | |
10 | | namespace mozilla { |
11 | | |
12 | | void |
13 | | WebGLFramebufferAttachable::MarkAttachment(const WebGLFBAttachPoint& attachment) |
14 | 0 | { |
15 | 0 | if (mAttachmentPoints.Contains(&attachment)) |
16 | 0 | return; // Already attached. Ignore. |
17 | 0 | |
18 | 0 | mAttachmentPoints.AppendElement(&attachment); |
19 | 0 | } |
20 | | |
21 | | void |
22 | | WebGLFramebufferAttachable::UnmarkAttachment(const WebGLFBAttachPoint& attachment) |
23 | 0 | { |
24 | 0 | const size_t i = mAttachmentPoints.IndexOf(&attachment); |
25 | 0 | if (i == mAttachmentPoints.NoIndex) { |
26 | 0 | MOZ_ASSERT(false, "Is not attached to FB"); |
27 | 0 | return; |
28 | 0 | } |
29 | 0 |
|
30 | 0 | mAttachmentPoints.RemoveElementAt(i); |
31 | 0 | } |
32 | | |
33 | | void |
34 | | WebGLFramebufferAttachable::InvalidateStatusOfAttachedFBs() const |
35 | 0 | { |
36 | 0 | const size_t count = mAttachmentPoints.Length(); |
37 | 0 | for (size_t i = 0; i < count; ++i) { |
38 | 0 | MOZ_ASSERT(mAttachmentPoints[i]->mFB); |
39 | 0 | mAttachmentPoints[i]->mFB->InvalidateFramebufferStatus(); |
40 | 0 | } |
41 | 0 | } |
42 | | |
43 | | } // namespace mozilla |