Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / dom / canvas / WebGLBindableName.cpp
blob3a361bd7d43da6b6a36510ca93ea1ee7c07506c9
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 #include "WebGLBindableName.h"
7 #include "GLConsts.h"
8 #include "mozilla/Assertions.h"
10 using namespace mozilla;
12 WebGLBindableName::WebGLBindableName()
13 : mGLName(LOCAL_GL_NONE)
14 , mTarget(LOCAL_GL_NONE)
15 { }
17 void
18 WebGLBindableName::BindTo(GLenum target)
20 MOZ_ASSERT(target != LOCAL_GL_NONE, "Can't bind to GL_NONE.");
21 MOZ_ASSERT(mTarget == LOCAL_GL_NONE || mTarget == target, "Rebinding is illegal.");
23 bool targetChanged = (target != mTarget);
24 mTarget = target;
25 if (targetChanged)
26 OnTargetChanged();