WebGLExtensionLoseContext.cpp 908 B

123456789101112131415161718192021222324252627282930313233343536373839
  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/. */
  5. #include "WebGLExtensions.h"
  6. #include "mozilla/dom/WebGLRenderingContextBinding.h"
  7. #include "WebGLContext.h"
  8. namespace mozilla {
  9. WebGLExtensionLoseContext::WebGLExtensionLoseContext(WebGLContext* webgl)
  10. : WebGLExtensionBase(webgl)
  11. {
  12. }
  13. WebGLExtensionLoseContext::~WebGLExtensionLoseContext()
  14. {
  15. }
  16. void
  17. WebGLExtensionLoseContext::LoseContext()
  18. {
  19. if (!mContext) return;
  20. mContext->LoseContext();
  21. }
  22. void
  23. WebGLExtensionLoseContext::RestoreContext()
  24. {
  25. if (!mContext) return;
  26. mContext->RestoreContext();
  27. }
  28. IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionLoseContext, WEBGL_lose_context)
  29. } // namespace mozilla