Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwinglutils.cpp
Show First 20 Lines • Show All 1234 Lines • ▼ Show 20 Line(s) | 1234 | if (!GLRenderTarget::blitSupported()) { | |||
---|---|---|---|---|---|
1235 | return; | 1235 | return; | ||
1236 | } | 1236 | } | ||
1237 | GLRenderTarget::pushRenderTarget(this); | 1237 | GLRenderTarget::pushRenderTarget(this); | ||
1238 | glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mFramebuffer); | 1238 | glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mFramebuffer); | ||
1239 | glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); | 1239 | glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); | ||
1240 | const QRect s = source.isNull() ? s_virtualScreenGeometry : source; | 1240 | const QRect s = source.isNull() ? s_virtualScreenGeometry : source; | ||
1241 | const QRect d = destination.isNull() ? QRect(0, 0, mTexture.width(), mTexture.height()) : destination; | 1241 | const QRect d = destination.isNull() ? QRect(0, 0, mTexture.width(), mTexture.height()) : destination; | ||
1242 | 1242 | | |||
1243 | glBlitFramebuffer(s.x() - s_virtualScreenGeometry.x(), s_virtualScreenGeometry.height() - s_virtualScreenGeometry.y() - s.y() - s.height(), | 1243 | glBlitFramebuffer((s.x() - s_virtualScreenGeometry.x()) * s_virtualScreenScale, | ||
1244 | s.x() - s_virtualScreenGeometry.x() + s.width(), s_virtualScreenGeometry.height() - s_virtualScreenGeometry.y() - s.y(), | 1244 | (s_virtualScreenGeometry.height() - s_virtualScreenGeometry.y() - s.y() - s.height()) * s_virtualScreenScale, | ||
1245 | (s.x() - s_virtualScreenGeometry.x() + s.width()) * s_virtualScreenScale, | ||||
1246 | (s_virtualScreenGeometry.height() - s_virtualScreenGeometry.y() - s.y()) * s_virtualScreenScale, | ||||
1245 | d.x(), mTexture.height() - d.y() - d.height(), d.x() + d.width(), mTexture.height() - d.y(), | 1247 | d.x(), mTexture.height() - d.y() - d.height(), d.x() + d.width(), mTexture.height() - d.y(), | ||
1246 | GL_COLOR_BUFFER_BIT, filter); | 1248 | GL_COLOR_BUFFER_BIT, filter); | ||
1247 | GLRenderTarget::popRenderTarget(); | 1249 | GLRenderTarget::popRenderTarget(); | ||
1248 | } | 1250 | } | ||
1249 | 1251 | | |||
1250 | void GLRenderTarget::attachTexture(const GLTexture& target) | 1252 | void GLRenderTarget::attachTexture(const GLTexture& target) | ||
1251 | { | 1253 | { | ||
1252 | if (!mValid || mTexture.texture() == target.texture()) { | 1254 | if (!mValid || mTexture.texture() == target.texture()) { | ||
▲ Show 20 Lines • Show All 994 Lines • Show Last 20 Lines |