Changeset View
Changeset View
Standalone View
Standalone View
krita/ui/opengl/kis_texture_tile.cpp
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | |||||
106 | #endif | 106 | #endif | ||
107 | 107 | | |||
108 | setNeedsMipmapRegeneration(); | 108 | setNeedsMipmapRegeneration(); | ||
109 | } | 109 | } | ||
110 | 110 | | |||
111 | KisTextureTile::~KisTextureTile() | 111 | KisTextureTile::~KisTextureTile() | ||
112 | { | 112 | { | ||
113 | #ifdef USE_PIXEL_BUFFERS | 113 | #ifdef USE_PIXEL_BUFFERS | ||
114 | if (m_useBuffer) { | | |||
115 | delete m_glBuffer; | 114 | delete m_glBuffer; | ||
116 | } | | |||
117 | #endif | 115 | #endif | ||
118 | f->glDeleteTextures(1, &m_textureId); | 116 | f->glDeleteTextures(1, &m_textureId); | ||
119 | } | 117 | } | ||
120 | 118 | | |||
121 | void KisTextureTile::bindToActiveTexture() | 119 | void KisTextureTile::bindToActiveTexture() | ||
122 | { | 120 | { | ||
123 | f->glBindTexture(GL_TEXTURE_2D, m_textureId); | 121 | f->glBindTexture(GL_TEXTURE_2D, m_textureId); | ||
124 | 122 | | |||
▲ Show 20 Lines • Show All 221 Lines • ▼ Show 20 Line(s) | 339 | if (!m_glBuffer) { | |||
346 | m_glBuffer->allocate(size); | 344 | m_glBuffer->allocate(size); | ||
347 | } | 345 | } | ||
348 | void *vid = m_glBuffer->map(QOpenGLBuffer::WriteOnly); | 346 | void *vid = m_glBuffer->map(QOpenGLBuffer::WriteOnly); | ||
349 | memcpy(vid, data, size); | 347 | memcpy(vid, data, size); | ||
350 | m_glBuffer->unmap(); | 348 | m_glBuffer->unmap(); | ||
351 | 349 | | |||
352 | } | 350 | } | ||
353 | else { | 351 | else { | ||
352 | delete m_glBuffer; | ||||
354 | m_glBuffer = 0; | 353 | m_glBuffer = 0; | ||
355 | } | 354 | } | ||
356 | } | 355 | } | ||
357 | #endif | 356 | #endif | ||
358 | 357 | | |||
359 | #endif /* HAVE_OPENGL */ | 358 | #endif /* HAVE_OPENGL */ | ||
360 | 359 | |