Changeset View
Changeset View
Standalone View
Standalone View
effects/backgroundcontrast/contrast.cpp
Show First 20 Lines • Show All 444 Lines • ▼ Show 20 Line(s) | 434 | { | |||
---|---|---|---|---|---|
445 | // Create a scratch texture and copy the area in the back buffer that we're | 445 | // Create a scratch texture and copy the area in the back buffer that we're | ||
446 | // going to blur into it | 446 | // going to blur into it | ||
447 | GLTexture scratch(GL_RGBA8, r.width() * scale, r.height() * scale); | 447 | GLTexture scratch(GL_RGBA8, r.width() * scale, r.height() * scale); | ||
448 | scratch.setFilter(GL_LINEAR); | 448 | scratch.setFilter(GL_LINEAR); | ||
449 | scratch.setWrapMode(GL_CLAMP_TO_EDGE); | 449 | scratch.setWrapMode(GL_CLAMP_TO_EDGE); | ||
450 | scratch.bind(); | 450 | scratch.bind(); | ||
451 | 451 | | |||
452 | const QRect sg = GLRenderTarget::virtualScreenGeometry(); | 452 | const QRect sg = GLRenderTarget::virtualScreenGeometry(); | ||
453 | glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, (r.x() - sg.x()) * scale, (sg.height() - sg.y() - r.y() - r.height()) * scale, | 453 | glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, (r.x() - sg.x()) * scale, (sg.height() - (r.y() - sg.y() + r.height())) * scale, | ||
454 | scratch.width(), scratch.height()); | 454 | scratch.width(), scratch.height()); | ||
455 | 455 | | |||
456 | // Draw the texture on the offscreen framebuffer object, while blurring it horizontally | 456 | // Draw the texture on the offscreen framebuffer object, while blurring it horizontally | ||
457 | 457 | | |||
458 | shader->setColorMatrix(m_colorMatrices.value(w)); | 458 | shader->setColorMatrix(m_colorMatrices.value(w)); | ||
459 | shader->bind(); | 459 | shader->bind(); | ||
460 | 460 | | |||
461 | 461 | | |||
Show All 25 Lines |