Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/smallcolorselector/KisGLImageWidget.cpp
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
54 | { | 54 | { | ||
55 | } | 55 | } | ||
56 | 56 | | |||
57 | KisGLImageWidget::KisGLImageWidget(KisSurfaceColorSpace colorSpace, | 57 | KisGLImageWidget::KisGLImageWidget(KisSurfaceColorSpace colorSpace, | ||
58 | QWidget *parent) | 58 | QWidget *parent) | ||
59 | : QOpenGLWidget(parent), | 59 | : QOpenGLWidget(parent), | ||
60 | m_texture(QOpenGLTexture::Target2D) | 60 | m_texture(QOpenGLTexture::Target2D) | ||
61 | { | 61 | { | ||
62 | Q_UNUSED(colorSpace) | ||||
63 | | ||||
62 | #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) | 64 | #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) | ||
63 | setTextureFormat(GL_RGBA16F); | 65 | setTextureFormat(GL_RGBA16F); | ||
64 | #endif | 66 | #endif | ||
65 | 67 | | |||
66 | #ifdef HAVE_HDR | 68 | #ifdef HAVE_HDR | ||
67 | setTextureColorSpace(colorSpace); | 69 | setTextureColorSpace(colorSpace); | ||
68 | #endif | 70 | #endif | ||
69 | 71 | | |||
▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | 172 | { | |||
178 | m_verticesBuffer.allocate(2 * 3 * sizeof(QVector3D)); | 180 | m_verticesBuffer.allocate(2 * 3 * sizeof(QVector3D)); | ||
179 | m_verticesBuffer.write(0, vertices.data(), m_verticesBuffer.size()); | 181 | m_verticesBuffer.write(0, vertices.data(), m_verticesBuffer.size()); | ||
180 | m_verticesBuffer.release(); | 182 | m_verticesBuffer.release(); | ||
181 | } | 183 | } | ||
182 | 184 | | |||
183 | 185 | | |||
184 | void KisGLImageWidget::paintGL() | 186 | void KisGLImageWidget::paintGL() | ||
185 | { | 187 | { | ||
186 | const QColor bgColor = palette().background().color(); | | |||
187 | // TODO: fix conversion to the destination surface space | 188 | // TODO: fix conversion to the destination surface space | ||
dkazakov: Please also change the comment below to
```
// Fill with bright color as as default for… | |||||
189 | // Fill with bright color as as default for debugging purposes | ||||
188 | //glClearColor(bgColor.redF(), bgColor.greenF(), bgColor.blueF(), 1.0f); | 190 | // glClearColor(bgColor.redF(), bgColor.greenF(), bgColor.blueF(), 1.0f); | ||
189 | glClearColor(0.3, 0.2, 0.8, 1.0f); | 191 | glClearColor(0.3, 0.2, 0.8, 1.0f); | ||
190 | glClear(GL_COLOR_BUFFER_BIT); | 192 | glClear(GL_COLOR_BUFFER_BIT); | ||
191 | 193 | | |||
192 | 194 | | |||
193 | 195 | | |||
194 | if (m_havePendingTextureUpdate) { | 196 | if (m_havePendingTextureUpdate) { | ||
195 | m_havePendingTextureUpdate = false; | 197 | m_havePendingTextureUpdate = false; | ||
196 | 198 | | |||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |
Please also change the comment below to