• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 setData(const gl::Context *context,
27                           gl::BufferBinding target,
28                           const void *data,
29                           size_t size,
30                           gl::BufferUsage usage) override;
31     angle::Result setSubData(const gl::Context *context,
32                              gl::BufferBinding target,
33                              const void *data,
34                              size_t size,
35                              size_t offset) override;
36     angle::Result copySubData(const gl::Context *context,
37                               BufferImpl *source,
38                               GLintptr sourceOffset,
39                               GLintptr destOffset,
40                               GLsizeiptr size) override;
41     angle::Result map(const gl::Context *context, GLenum access, void **mapPtr) override;
42     angle::Result mapRange(const gl::Context *context,
43                            size_t offset,
44                            size_t length,
45                            GLbitfield access,
46                            void **mapPtr) override;
47     angle::Result unmap(const gl::Context *context, GLboolean *result) override;
48 
49     angle::Result getIndexRange(const gl::Context *context,
50                                 gl::DrawElementsType type,
51                                 size_t offset,
52                                 size_t count,
53                                 bool primitiveRestartEnabled,
54                                 gl::IndexRange *outRange) override;
55 
56     uint8_t *getDataPtr();
57     const uint8_t *getDataPtr() const;
58 
59   private:
60     std::vector<uint8_t> mData;
61 
62     AllocationTrackerNULL *mAllocationTracker;
63 };
64 
65 }  // namespace rx
66 
67 #endif  // LIBANGLE_RENDERER_NULL_BUFFERNULL_H_
68