KiCad PCB EDA Suite
cached_container_ram.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  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef CACHED_CONTAINER_RAM_H_
26 #define CACHED_CONTAINER_RAM_H_
27 
29 #include <map>
30 #include <set>
31 
32 namespace KIGFX
33 {
34 class VERTEX_ITEM;
35 class SHADER;
36 
43 {
44 public:
45  CACHED_CONTAINER_RAM( unsigned int aSize = DEFAULT_SIZE );
47 
49  void Map() override {}
50 
52  void Unmap() override;
53 
54  bool IsMapped() const override
55  {
56  return true;
57  }
58 
63  unsigned int GetBufferHandle() const override
64  {
65  return m_verticesBuffer; // make common with CACHED_CONTAINER_RAM
66  }
67 
68 protected:
71 
77  bool defragmentResize( unsigned int aNewSize ) override;
78 };
79 } // namespace KIGFX
80 
81 #endif /* CACHED_CONTAINER_RAM_H_ */
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
unsigned int GetBufferHandle() const override
Function GetBufferHandle() returns handle to the vertex buffer.
bool IsMapped() const override
Returns true if vertex buffer is currently mapped.
Class to store VERTEX instances with caching.
CACHED_CONTAINER_RAM(unsigned int aSize=DEFAULT_SIZE)
Specialization of CACHED_CONTAINER that stores data in RAM.
static constexpr unsigned int DEFAULT_SIZE
bool defragmentResize(unsigned int aNewSize) override
Defragments the currently stored data and resizes the buffer.
GLuint m_verticesBuffer
Handle to vertices buffer