gl_mock.cc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (c) 2010 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ui/gl/gl_mock.h"
  5. namespace gl {
  6. namespace {
  7. // This is called mainly to prevent the compiler combining the code of mock
  8. // functions with identical contents, so that their function pointers will be
  9. // different.
  10. void MakeFunctionUnique(const char* func_name) {
  11. VLOG(2) << "Calling mock " << func_name;
  12. }
  13. } // namespace anonymous
  14. MockGLInterface::MockGLInterface() {
  15. }
  16. MockGLInterface::~MockGLInterface() {
  17. }
  18. MockGLInterface* MockGLInterface::interface_;
  19. void MockGLInterface::SetGLInterface(MockGLInterface* gl_interface) {
  20. interface_ = gl_interface;
  21. }
  22. void GL_BINDING_CALL MockGLInterface::Mock_glTexSubImage3DNoData(
  23. GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
  24. GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type) {
  25. MakeFunctionUnique("glTexSubImage3DNoData");
  26. interface_->TexSubImage3DNoData(
  27. target, level, xoffset, yoffset, zoffset, width, height, depth,
  28. format, type);
  29. }
  30. } // namespace gl