1 // 2 // Copyright 2016 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 // BufferNULL.h: 7 // Defines the class interface for BufferNULL, implementing BufferImpl. 8 // 9 10 #ifndef LIBANGLE_RENDERER_NULL_BUFFERNULL_H_ 11 #define LIBANGLE_RENDERER_NULL_BUFFERNULL_H_ 12 13 #include "libANGLE/renderer/BufferImpl.h" 14 15 namespace rx 16 { 17 18 class AllocationTrackerNULL; 19 20 class BufferNULL : public BufferImpl 21 { 22 public: 23 BufferNULL(const gl::BufferState &state, AllocationTrackerNULL *allocationTracker); 24 ~BufferNULL() override; 25 26 angle::Result setDataWithUsageFlags(const gl::Context *context, 27 gl::BufferBinding target, 28 GLeglClientBufferEXT clientBuffer, 29 const void *data, 30 size_t size, 31 gl::BufferUsage usage, 32 GLbitfield flags) override; 33 angle::Result setData(const gl::Context *context, 34 gl::BufferBinding target, 35 const void *data, 36 size_t size, 37 gl::BufferUsage usage) override; 38 angle::Result setSubData(const gl::Context *context, 39 gl::BufferBinding target, 40 const void *data, 41 size_t size, 42 size_t offset) override; 43 angle::Result copySubData(const gl::Context *context, 44 BufferImpl *source, 45 GLintptr sourceOffset, 46 GLintptr destOffset, 47 GLsizeiptr size) override; 48 angle::Result map(const gl::Context *context, GLenum access, void **mapPtr) override; 49 angle::Result mapRange(const gl::Context *context, 50 size_t offset, 51 size_t length, 52 GLbitfield access, 53 void **mapPtr) override; 54 angle::Result unmap(const gl::Context *context, GLboolean *result) override; 55 56 angle::Result getIndexRange(const gl::Context *context, 57 gl::DrawElementsType type, 58 size_t offset, 59 size_t count, 60 bool primitiveRestartEnabled, 61 gl::IndexRange *outRange) override; 62 63 uint8_t *getDataPtr(); 64 const uint8_t *getDataPtr() const; 65 66 private: 67 std::vector<uint8_t> mData; 68 69 AllocationTrackerNULL *mAllocationTracker; 70 }; 71 72 } // namespace rx 73 74 #endif // LIBANGLE_RENDERER_NULL_BUFFERNULL_H_ 75