KiCad PCB EDA Suite
Loading...
Searching...
No Matches
cached_container_gpu.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright 2013-2017 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Maciej Suminski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
23#ifndef CACHED_CONTAINER_GPU_H_
24#define CACHED_CONTAINER_GPU_H_
25
27
28namespace KIGFX
29{
30
35{
36public:
37 CACHED_CONTAINER_GPU( unsigned int aSize = DEFAULT_SIZE );
39
40 unsigned int GetBufferHandle() const override
41 {
42 return m_glBufferHandle;
43 }
44
45 bool IsMapped() const override
46 {
47 return m_isMapped;
48 }
49
51 void Map() override;
52
54 void Unmap() override;
55
56 virtual unsigned int AllItemsSize() const override;
57
58
59protected:
69 bool defragmentResize( unsigned int aNewSize ) override;
70 bool defragmentResizeMemcpy( unsigned int aNewSize );
71
80 bool defragmentResizeStaged( unsigned int aNewSize );
81
84
86 unsigned int m_glBufferHandle;
87
90};
91} // namespace KIGFX
92
93#endif /* CACHED_CONTAINER_GPU_H_ */
void Map() override
Finish the vertices updates stage.
bool m_isMapped
Vertex buffer handle.
unsigned int GetBufferHandle() const override
Return handle to the vertex buffer.
virtual unsigned int AllItemsSize() const override
bool IsMapped() const override
Prepare the container for vertices updates.
bool defragmentResizeStaged(unsigned int aNewSize)
Grow the buffer while keeping the peak video memory at max(old, new) rather than old + new,...
bool defragmentResizeMemcpy(unsigned int aNewSize)
void Unmap() override
Finish the vertices updates stage.
CACHED_CONTAINER_GPU(unsigned int aSize=DEFAULT_SIZE)
bool defragmentResize(unsigned int aNewSize) override
Remove empty spaces between chunks and optionally resizes the container.
unsigned int m_glBufferHandle
Flag saying whether it is safe to use glCopyBufferSubData.
CACHED_CONTAINER(unsigned int aSize=DEFAULT_SIZE)
static constexpr unsigned int DEFAULT_SIZE
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:29