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"
8 #include "mozilla/Assertions.h"
10 using namespace mozilla
;
12 WebGLBindableName::WebGLBindableName()
13 : mGLName(LOCAL_GL_NONE
)
14 , mTarget(LOCAL_GL_NONE
)
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
);