Bumping manifests a=b2g-bump
[gecko.git] / dom / canvas / WebGLSampler.cpp
blobe2bfa5bf5895a0429e1f0fed020b2af715f7086f
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/. */
6 #include "WebGLSampler.h"
8 #include "GLContext.h"
9 #include "mozilla/dom/WebGL2RenderingContextBinding.h"
10 #include "WebGLContext.h"
12 namespace mozilla {
14 WebGLSampler::WebGLSampler(WebGLContext* webgl, GLuint sampler)
15 : WebGLBindableName<GLenum>(sampler),
16 WebGLContextBoundObject(webgl)
18 mContext->mSamplers.insertBack(this);
21 WebGLSampler::~WebGLSampler()
23 DeleteOnce();
26 void
27 WebGLSampler::Delete()
29 mContext->MakeContextCurrent();
30 mContext->gl->fDeleteSamplers(1, &mGLName);
32 removeFrom(mContext->mSamplers);
35 WebGLContext*
36 WebGLSampler::GetParentObject() const
38 return Context();
41 JSObject*
42 WebGLSampler::WrapObject(JSContext* cx)
44 return dom::WebGLSamplerBinding::Wrap(cx, this);
48 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLSampler)
49 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLSampler, AddRef)
50 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLSampler, Release)
52 } // namespace mozilla