Bug 1700051: part 26) Correct typo in comment of `mozInlineSpellWordUtil::BuildSoftTe...
[gecko.git] / dom / canvas / WebGLTransformFeedback.h
blobb9361a26c32b71aa4930460c5b27494afcf61f19
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_TRANSFORM_FEEDBACK_H_
7 #define WEBGL_TRANSFORM_FEEDBACK_H_
9 #include "WebGLContext.h"
10 #include "WebGLObjectModel.h"
12 namespace mozilla {
13 namespace webgl {
14 struct CachedDrawFetchLimits;
17 class WebGLTransformFeedback final : public WebGLContextBoundObject {
18 friend class ScopedDrawWithTransformFeedback;
19 friend class WebGLContext;
20 friend class WebGL2Context;
21 friend class WebGLProgram;
23 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(WebGLTransformFeedback, override)
25 friend const webgl::CachedDrawFetchLimits* ValidateDraw(WebGLContext*, GLenum,
26 uint32_t);
28 public:
29 const GLuint mGLName;
30 bool mHasBeenBound = false;
32 private:
33 // GLES 3.0.4 p267, Table 6.24 "Transform Feedback State"
34 // It's not yet in the ES3 spec, but the generic TF buffer bind point has been
35 // moved to context state, instead of TFO state.
36 std::vector<IndexedBufferBinding> mIndexedBindings;
37 bool mIsPaused;
38 bool mIsActive;
39 // Not in state tables:
40 RefPtr<WebGLProgram> mActive_Program;
41 MOZ_INIT_OUTSIDE_CTOR GLenum mActive_PrimMode;
42 MOZ_INIT_OUTSIDE_CTOR size_t mActive_VertPosition;
43 MOZ_INIT_OUTSIDE_CTOR size_t mActive_VertCapacity;
45 public:
46 WebGLTransformFeedback(WebGLContext* webgl, GLuint tf);
48 private:
49 ~WebGLTransformFeedback() override;
51 public:
52 bool IsActiveAndNotPaused() const { return mIsActive && !mIsPaused; }
54 // GL Funcs
55 void BeginTransformFeedback(GLenum primMode);
56 void EndTransformFeedback();
57 void PauseTransformFeedback();
58 void ResumeTransformFeedback();
61 } // namespace mozilla
63 #endif // WEBGL_TRANSFORM_FEEDBACK_H_