gl_image_stub.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (c) 2012 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. #ifndef UI_GL_GL_IMAGE_STUB_H_
  5. #define UI_GL_GL_IMAGE_STUB_H_
  6. #include <stdint.h>
  7. #include "ui/gl/gl_export.h"
  8. #include "ui/gl/gl_image.h"
  9. namespace gl {
  10. // A GLImage that does nothing for unit tests.
  11. class GL_EXPORT GLImageStub : public GLImage {
  12. public:
  13. GLImageStub();
  14. // Overridden from GLImage:
  15. gfx::Size GetSize() override;
  16. unsigned GetInternalFormat() override;
  17. unsigned GetDataType() override;
  18. BindOrCopy ShouldBindOrCopy() override;
  19. bool BindTexImage(unsigned target) override;
  20. void ReleaseTexImage(unsigned target) override {}
  21. bool CopyTexImage(unsigned target) override;
  22. bool CopyTexSubImage(unsigned target,
  23. const gfx::Point& offset,
  24. const gfx::Rect& rect) override;
  25. void Flush() override {}
  26. void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
  27. uint64_t process_tracing_id,
  28. const std::string& dump_name) override {}
  29. protected:
  30. ~GLImageStub() override;
  31. };
  32. } // namespace gl
  33. #endif // UI_GL_GL_IMAGE_STUB_H_