Changeset View
Changeset View
Standalone View
Standalone View
effects/mousemark/mousemark.cpp
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | |||||
114 | 114 | | |||
115 | void MouseMarkEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) | 115 | void MouseMarkEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) | ||
116 | { | 116 | { | ||
117 | effects->paintScreen(mask, region, data); // paint normal screen | 117 | effects->paintScreen(mask, region, data); // paint normal screen | ||
118 | if (marks.isEmpty() && drawing.isEmpty()) | 118 | if (marks.isEmpty() && drawing.isEmpty()) | ||
119 | return; | 119 | return; | ||
120 | if ( effects->isOpenGLCompositing()) { | 120 | if ( effects->isOpenGLCompositing()) { | ||
121 | if (!GLPlatform::instance()->isGLES()) { | 121 | if (!GLPlatform::instance()->isGLES()) { | ||
122 | glEnable(GL_BLEND); | ||||
123 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | ||||
124 | | ||||
122 | glEnable(GL_LINE_SMOOTH); | 125 | glEnable(GL_LINE_SMOOTH); | ||
126 | glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); | ||||
123 | } | 127 | } | ||
124 | glLineWidth(width); | 128 | glLineWidth(width); | ||
125 | GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer(); | 129 | GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer(); | ||
126 | vbo->reset(); | 130 | vbo->reset(); | ||
127 | vbo->setUseColor(true); | 131 | vbo->setUseColor(true); | ||
128 | vbo->setColor(color); | 132 | vbo->setColor(color); | ||
129 | ShaderBinder binder(ShaderTrait::UniformColor); | 133 | ShaderBinder binder(ShaderTrait::UniformColor); | ||
130 | binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, data.projectionMatrix()); | 134 | binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, data.projectionMatrix()); | ||
Show All 14 Lines | 148 | foreach (const QPoint & p, drawing) { | |||
145 | verts << p.x() << p.y(); | 149 | verts << p.x() << p.y(); | ||
146 | } | 150 | } | ||
147 | vbo->setData(verts.size() / 2, 2, verts.data(), NULL); | 151 | vbo->setData(verts.size() / 2, 2, verts.data(), NULL); | ||
148 | vbo->render(GL_LINE_STRIP); | 152 | vbo->render(GL_LINE_STRIP); | ||
149 | } | 153 | } | ||
150 | glLineWidth(1.0); | 154 | glLineWidth(1.0); | ||
151 | if (!GLPlatform::instance()->isGLES()) { | 155 | if (!GLPlatform::instance()->isGLES()) { | ||
152 | glDisable(GL_LINE_SMOOTH); | 156 | glDisable(GL_LINE_SMOOTH); | ||
157 | glDisable(GL_BLEND); | ||||
153 | } | 158 | } | ||
154 | } | 159 | } | ||
155 | #ifdef KWIN_HAVE_XRENDER_COMPOSITING | 160 | #ifdef KWIN_HAVE_XRENDER_COMPOSITING | ||
156 | if ( effects->compositingType() == XRenderCompositing) { | 161 | if ( effects->compositingType() == XRenderCompositing) { | ||
157 | xcb_render_color_t c = preMultiply(color); | 162 | xcb_render_color_t c = preMultiply(color); | ||
158 | for (int i = 0; i < marks.count(); ++i) { | 163 | for (int i = 0; i < marks.count(); ++i) { | ||
159 | const int n = marks[i].count() - 1; | 164 | const int n = marks[i].count() - 1; | ||
160 | if (n > 0) { | 165 | if (n > 0) { | ||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |