/src/mozilla-central/dom/canvas/WebGLSampler.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
5 | | |
6 | | #ifndef WEBGL_SAMPLER_H_ |
7 | | #define WEBGL_SAMPLER_H_ |
8 | | |
9 | | #include "mozilla/LinkedList.h" |
10 | | #include "nsWrapperCache.h" |
11 | | #include "WebGLObjectModel.h" |
12 | | #include "WebGLStrongTypes.h" |
13 | | #include "WebGLTexture.h" |
14 | | |
15 | | namespace mozilla { |
16 | | |
17 | | class WebGLSampler final |
18 | | : public nsWrapperCache |
19 | | , public WebGLRefCountedObject<WebGLSampler> |
20 | | , public LinkedListElement<WebGLSampler> |
21 | | { |
22 | | friend class WebGLContext2; |
23 | | friend class WebGLTexture; |
24 | | |
25 | | NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSampler) |
26 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLSampler) |
27 | | |
28 | | public: |
29 | | const GLuint mGLName; |
30 | | private: |
31 | | webgl::SamplingState mState; |
32 | | |
33 | | public: |
34 | | explicit WebGLSampler(WebGLContext* webgl); |
35 | | private: |
36 | | ~WebGLSampler(); |
37 | | |
38 | | public: |
39 | | void Delete(); |
40 | | WebGLContext* GetParentObject() const; |
41 | | |
42 | | virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto) override; |
43 | | |
44 | | void SamplerParameter(GLenum pname, const FloatOrInt& param); |
45 | | |
46 | 0 | const auto& State() const { return mState; } |
47 | | }; |
48 | | |
49 | | } // namespace mozilla |
50 | | |
51 | | #endif // WEBGL_SAMPLER_H_ |