Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Unmaintained
KDE Workspace
Commits
4f445a75
Commit
4f445a75
authored
Jan 06, 2011
by
Martin Flöser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Screenshot Effect ported to GLES
parent
34f37400
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
14 deletions
+6
-14
kwin/effects/CMakeLists.txt
kwin/effects/CMakeLists.txt
+1
-1
kwin/effects/screenshot/screenshot.cpp
kwin/effects/screenshot/screenshot.cpp
+5
-13
No files found.
kwin/effects/CMakeLists.txt
View file @
4f445a75
...
...
@@ -94,6 +94,7 @@ if( KWIN_HAVE_OPENGL_COMPOSITING )
include
(
flipswitch/CMakeLists.txt
)
include
(
glide/CMakeLists.txt
)
include
(
mousemark/CMakeLists.txt
)
include
(
screenshot/CMakeLists.txt
)
include
(
sheet/CMakeLists.txt
)
include
(
snaphelper/CMakeLists.txt
)
include
(
trackmouse/CMakeLists.txt
)
...
...
@@ -105,7 +106,6 @@ if( KWIN_HAVE_OPENGL_COMPOSITING AND NOT KWIN_HAVE_OPENGLES_COMPOSITING )
include
(
invert/CMakeLists.txt
)
include
(
lookingglass/CMakeLists.txt
)
include
(
magnifier/CMakeLists.txt
)
include
(
screenshot/CMakeLists.txt
)
include
(
sharpen/CMakeLists.txt
)
include
(
snow/CMakeLists.txt
)
include
(
startupfeedback/CMakeLists.txt
)
...
...
kwin/effects/screenshot/screenshot.cpp
View file @
4f445a75
...
...
@@ -112,22 +112,14 @@ void ScreenShotEffect::postPaintScreen()
// render window into offscreen texture
int
mask
=
PAINT_WINDOW_TRANSFORMED
|
PAINT_WINDOW_TRANSLUCENT
;
effects
->
pushRenderTarget
(
target
);
glClearColor
(
0.0
,
0.0
,
0.0
,
0.0
);
glClear
(
GL_COLOR_BUFFER_BIT
);
glClearColor
(
0.0
,
0.0
,
0.0
,
1.0
);
effects
->
drawWindow
(
m_scheduledScreenshot
,
mask
,
QRegion
(
0
,
0
,
width
,
height
),
d
);
// Create a scratch texture and copy the rendered window into it
GLTexture
*
tex
=
new
GLTexture
(
width
,
height
);
tex
->
setFilter
(
GL_LINEAR
);
tex
->
setWrapMode
(
GL_CLAMP_TO_EDGE
);
tex
->
bind
();
glCopyTexSubImage2D
(
GL_TEXTURE_2D
,
0
,
0
,
0
,
0
,
offscreenTexture
->
height
()
-
height
,
width
,
height
);
effects
->
popRenderTarget
();
// copy content from GL texture into image
// copy content from framebuffer into image
QImage
img
(
QSize
(
width
,
height
),
QImage
::
Format_ARGB32
);
tex
->
bind
();
glGetTexImage
(
GL_TEXTURE_2D
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
img
.
bits
()
);
tex
->
unbind
();
delete
tex
;
glReadPixels
(
0
,
offscreenTexture
->
height
()
-
height
,
width
,
height
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
(
GLvoid
*
)
img
.
bits
());
effects
->
popRenderTarget
();
ScreenShotEffect
::
convertFromGLImage
(
img
,
width
,
height
);
if
(
m_type
&
INCLUDE_CURSOR
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment