Buffer.h 595 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2022, cflip <cflip@cflip.net>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/ByteBuffer.h>
  8. #include <AK/RefCounted.h>
  9. namespace GL {
  10. // FIXME: For now, this is basically just a wrapper around ByteBuffer, but in
  11. // the future buffer data should be stored in LibGPU.
  12. class Buffer : public RefCounted<Buffer> {
  13. public:
  14. ErrorOr<void> set_data(void const*, size_t);
  15. void replace_data(void const*, size_t offset, size_t size);
  16. size_t size();
  17. void* data();
  18. void* offset_data(size_t);
  19. private:
  20. ByteBuffer m_data;
  21. };
  22. }