Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
0f1afdbd
Commit
0f1afdbd
authored
Feb 03, 2021
by
Vlad Zahorodnii
Browse files
scene: Pass dirty region to SceneOpenGLTexture::updateTexture
parent
369b768f
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/platformsupport/scenes/opengl/abstract_egl_backend.cpp
View file @
0f1afdbd
...
...
@@ -435,7 +435,7 @@ bool AbstractEglTexture::loadTexture(WindowPixmap *pixmap)
return
loadEglTexture
(
buffer
);
}
void
AbstractEglTexture
::
updateTexture
(
WindowPixmap
*
pixmap
)
void
AbstractEglTexture
::
updateTexture
(
WindowPixmap
*
pixmap
,
const
QRegion
&
region
)
{
// FIXME: Refactor this method.
...
...
@@ -444,7 +444,7 @@ void AbstractEglTexture::updateTexture(WindowPixmap *pixmap)
if
(
updateFromFBO
(
pixmap
->
fbo
()))
{
return
;
}
if
(
updateFromInternalImageObject
(
pixmap
))
{
if
(
updateFromInternalImageObject
(
pixmap
,
region
))
{
return
;
}
return
;
...
...
@@ -681,7 +681,7 @@ static QRegion scale(const QRegion ®ion, qreal scaleFactor)
return
scaled
;
}
bool
AbstractEglTexture
::
updateFromInternalImageObject
(
WindowPixmap
*
pixmap
)
bool
AbstractEglTexture
::
updateFromInternalImageObject
(
WindowPixmap
*
pixmap
,
const
QRegion
&
region
)
{
const
QImage
image
=
pixmap
->
internalImage
();
if
(
image
.
isNull
())
{
...
...
@@ -693,7 +693,7 @@ bool AbstractEglTexture::updateFromInternalImageObject(WindowPixmap *pixmap)
return
loadInternalImageObject
(
pixmap
);
}
createTextureSubImage
(
image
,
scale
(
pixmap
->
toplevel
()
->
damage
()
,
image
.
devicePixelRatio
()));
createTextureSubImage
(
image
,
scale
(
region
,
image
.
devicePixelRatio
()));
return
true
;
}
...
...
src/platformsupport/scenes/opengl/abstract_egl_backend.h
View file @
0f1afdbd
...
...
@@ -96,7 +96,7 @@ class KWIN_EXPORT AbstractEglTexture : public SceneOpenGLTexturePrivate
public:
~
AbstractEglTexture
()
override
;
bool
loadTexture
(
WindowPixmap
*
pixmap
)
override
;
void
updateTexture
(
WindowPixmap
*
pixmap
)
override
;
void
updateTexture
(
WindowPixmap
*
pixmap
,
const
QRegion
&
region
)
override
;
OpenGLBackend
*
backend
()
override
;
protected:
...
...
@@ -120,7 +120,7 @@ private:
bool
loadInternalImageObject
(
WindowPixmap
*
pixmap
);
EGLImageKHR
attach
(
const
QPointer
<
KWaylandServer
::
BufferInterface
>
&
buffer
);
bool
updateFromFBO
(
const
QSharedPointer
<
QOpenGLFramebufferObject
>
&
fbo
);
bool
updateFromInternalImageObject
(
WindowPixmap
*
pixmap
);
bool
updateFromInternalImageObject
(
WindowPixmap
*
pixmap
,
const
QRegion
&
region
);
SceneOpenGLTexture
*
q
;
AbstractEglBackend
*
m_backend
;
EGLImageKHR
m_image
;
...
...
src/platformsupport/scenes/opengl/texture.cpp
View file @
0f1afdbd
...
...
@@ -47,10 +47,10 @@ bool SceneOpenGLTexture::load(WindowPixmap *pixmap)
return
d
->
loadTexture
(
pixmap
);
}
void
SceneOpenGLTexture
::
updateFromPixmap
(
WindowPixmap
*
pixmap
)
void
SceneOpenGLTexture
::
updateFromPixmap
(
WindowPixmap
*
pixmap
,
const
QRegion
&
region
)
{
Q_D
(
SceneOpenGLTexture
);
d
->
updateTexture
(
pixmap
);
d
->
updateTexture
(
pixmap
,
region
);
}
SceneOpenGLTexturePrivate
::
SceneOpenGLTexturePrivate
()
...
...
@@ -61,9 +61,10 @@ SceneOpenGLTexturePrivate::~SceneOpenGLTexturePrivate()
{
}
void
SceneOpenGLTexturePrivate
::
updateTexture
(
WindowPixmap
*
pixmap
)
void
SceneOpenGLTexturePrivate
::
updateTexture
(
WindowPixmap
*
pixmap
,
const
QRegion
&
region
)
{
Q_UNUSED
(
pixmap
)
Q_UNUSED
(
region
)
}
}
src/platformsupport/scenes/opengl/texture.h
View file @
0f1afdbd
...
...
@@ -33,7 +33,7 @@ private:
SceneOpenGLTexture
(
SceneOpenGLTexturePrivate
&
dd
);
bool
load
(
WindowPixmap
*
pixmap
);
void
updateFromPixmap
(
WindowPixmap
*
pixmap
);
void
updateFromPixmap
(
WindowPixmap
*
pixmap
,
const
QRegion
&
region
);
Q_DECLARE_PRIVATE
(
SceneOpenGLTexture
)
...
...
@@ -46,7 +46,7 @@ public:
~
SceneOpenGLTexturePrivate
()
override
;
virtual
bool
loadTexture
(
WindowPixmap
*
pixmap
)
=
0
;
virtual
void
updateTexture
(
WindowPixmap
*
pixmap
);
virtual
void
updateTexture
(
WindowPixmap
*
pixmap
,
const
QRegion
&
region
);
virtual
OpenGLBackend
*
backend
()
=
0
;
protected:
...
...
src/plugins/platforms/drm/egl_stream_backend.cpp
View file @
0f1afdbd
...
...
@@ -614,7 +614,7 @@ bool EglStreamTexture::loadTexture(WindowPixmap *pixmap)
}
}
void
EglStreamTexture
::
updateTexture
(
WindowPixmap
*
pixmap
)
void
EglStreamTexture
::
updateTexture
(
WindowPixmap
*
pixmap
,
const
QRegion
&
region
)
{
using
namespace
KWaylandServer
;
SurfaceInterface
*
surface
=
pixmap
->
surface
();
...
...
@@ -634,7 +634,7 @@ void EglStreamTexture::updateTexture(WindowPixmap *pixmap)
}
}
else
{
// Not an EGLStream surface
AbstractEglTexture
::
updateTexture
(
pixmap
);
AbstractEglTexture
::
updateTexture
(
pixmap
,
region
);
}
}
...
...
src/plugins/platforms/drm/egl_stream_backend.h
View file @
0f1afdbd
...
...
@@ -82,7 +82,7 @@ class EglStreamTexture : public AbstractEglTexture
public:
~
EglStreamTexture
()
override
;
bool
loadTexture
(
WindowPixmap
*
pixmap
)
override
;
void
updateTexture
(
WindowPixmap
*
pixmap
)
override
;
void
updateTexture
(
WindowPixmap
*
pixmap
,
const
QRegion
&
region
)
override
;
private:
EglStreamTexture
(
SceneOpenGLTexture
*
texture
,
EglStreamBackend
*
backend
);
...
...
src/plugins/scenes/opengl/scene_opengl.cpp
View file @
0f1afdbd
...
...
@@ -1629,7 +1629,7 @@ bool OpenGLWindowPixmap::bind()
{
if
(
!
m_texture
->
isNull
())
{
if
(
needsPixmapUpdate
(
this
))
{
m_texture
->
updateFromPixmap
(
this
);
m_texture
->
updateFromPixmap
(
this
,
toplevel
->
damage
()
);
// mipmaps need to be updated
m_texture
->
setDirty
();
}
...
...
Write
Preview
Supports
Markdown
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