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/. */
5 
6 #ifndef WEBGL_SAMPLER_H_
7 #define WEBGL_SAMPLER_H_
8 
9 #include "WebGLObjectModel.h"
10 #include "WebGLStrongTypes.h"
11 #include "WebGLTexture.h"
12 
13 namespace mozilla {
14 
15 class WebGLSampler final : public WebGLContextBoundObject,
16                            public CacheInvalidator {
17   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(WebGLSampler, override)
18 
19  public:
20   const GLuint mGLName;
21 
22  private:
23   webgl::SamplingState mState;
24 
25  public:
26   explicit WebGLSampler(WebGLContext* webgl);
27 
28  private:
29   ~WebGLSampler();
30 
31  public:
32   void SamplerParameter(GLenum pname, const FloatOrInt& param);
State()33   const auto& State() const { return mState; }
34 };
35 
36 }  // namespace mozilla
37 
38 #endif  // WEBGL_SAMPLER_H_
39