Bumping manifests a=b2g-bump
[gecko.git] / dom / canvas / WebGLUniformLocation.h
blobf8cfdec650526b6faf45507cc334e0b9f29bdd5a
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/. */
6 #ifndef WEBGL_UNIFORM_LOCATION_H_
7 #define WEBGL_UNIFORM_LOCATION_H_
9 #include "WebGLObjectModel.h"
10 #include "WebGLUniformInfo.h"
12 namespace mozilla {
14 class WebGLProgram;
16 class WebGLUniformLocation MOZ_FINAL
17 : public WebGLContextBoundObject
19 public:
20 WebGLUniformLocation(WebGLContext* context, WebGLProgram* program,
21 GLint location, const WebGLUniformInfo& info);
23 // needed for certain helper functions like ValidateObject.
24 // WebGLUniformLocation's can't be 'Deleted' in the WebGL sense.
25 bool IsDeleted() const { return false; }
27 const WebGLUniformInfo& Info() const { return mInfo; }
29 WebGLProgram* Program() const { return mProgram; }
30 GLint Location() const { return mLocation; }
31 uint32_t ProgramGeneration() const { return mProgramGeneration; }
32 int ElementSize() const { return mElementSize; }
34 JSObject* WrapObject(JSContext* cx);
36 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLUniformLocation)
37 NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(WebGLUniformLocation)
39 protected:
40 ~WebGLUniformLocation() { }
42 // nsRefPtr, not WebGLRefPtr, so that we don't prevent the program from being explicitly deleted.
43 // we just want to avoid having a dangling pointer.
44 nsRefPtr<WebGLProgram> mProgram;
46 uint32_t mProgramGeneration;
47 GLint mLocation;
48 WebGLUniformInfo mInfo;
49 int mElementSize;
50 friend class WebGLProgram;
53 } // namespace mozilla
55 #endif // WEBGL_UNIFORM_LOCATION_H_