diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-12-01 08:18:47 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-12-01 11:40:36 (GMT) |
commit | dbfdfdb1bc37dd18dd1b723b5d5b0b65c37f3f41 (patch) | |
tree | ff1ca3a0e5e9555111cb60a05009b60cd27f07bf /src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h | |
parent | b5b9faa7cdc877f8ab32a8d5ae480b5857761409 (diff) | |
download | Qt-dbfdfdb1bc37dd18dd1b723b5d5b0b65c37f3f41.zip Qt-dbfdfdb1bc37dd18dd1b723b5d5b0b65c37f3f41.tar.gz Qt-dbfdfdb1bc37dd18dd1b723b5d5b0b65c37f3f41.tar.bz2 |
Added caching of vectorpaths to the GL paint engine.
The first time a path is drawn we call makeCachable on the path, which
means that if it is drawn again, we start caching it. This is a bit of
a trick to avoid caching paths that are drawn once and discared while
at the same time cache paths that are reused automatically.
The GL engine owns the vertex information and is responsible for cleaning
it up. If the vectorpath is destroyed first, it will call the cleanup function.
if the engine dies first, we still require some hooks to clean up the cache
in the path. More to come. When VBO's are used, these will be a leaked if the
path is destroyed after the engine.
Reviewed-by: Samuel
Diffstat (limited to 'src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h')
-rw-r--r-- | src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h index 03aec17..98eaa91 100644 --- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h +++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h @@ -112,6 +112,8 @@ public: int stopCount() const { return vertexArrayStops.size(); } QGLRect boundingRect() const; + int vertexCount() const { return vertexArray.size(); } + void lineToArray(const GLfloat x, const GLfloat y); private: |