Remove mask arg in Scene::paintScreen()
Render backends don't pass anything to the scene.
This commit is contained in:
parent
d2b6d7ee59
commit
3ab2ea40c4
4 changed files with 10 additions and 15 deletions
|
@ -434,10 +434,9 @@ void SceneOpenGL::paint(int screenId, const QRegion &damage, const QList<Topleve
|
|||
GLVertexBuffer::setVirtualScreenScale(scaling);
|
||||
GLRenderTarget::setVirtualScreenScale(scaling);
|
||||
|
||||
int mask = 0;
|
||||
updateProjectionMatrix(geo);
|
||||
|
||||
paintScreen(&mask, damage.intersected(geo), repaint, &update, &valid,
|
||||
paintScreen(damage.intersected(geo), repaint, &update, &valid,
|
||||
renderLoop, projectionMatrix()); // call generic implementation
|
||||
paintCursor(valid);
|
||||
|
||||
|
|
|
@ -87,8 +87,6 @@ void SceneQPainter::paint(int screenId, const QRegion &damage, const QList<Tople
|
|||
|
||||
createStackingOrder(toplevels);
|
||||
|
||||
int mask = 0;
|
||||
|
||||
const QRegion repaint = m_backend->beginFrame(screenId);
|
||||
const QRect geometry = screens()->geometry(screenId);
|
||||
|
||||
|
@ -99,8 +97,7 @@ void SceneQPainter::paint(int screenId, const QRegion &damage, const QList<Tople
|
|||
m_painter->setWindow(geometry);
|
||||
|
||||
QRegion updateRegion, validRegion;
|
||||
paintScreen(&mask, damage.intersected(geometry), repaint, &updateRegion, &validRegion,
|
||||
renderLoop);
|
||||
paintScreen(damage.intersected(geometry), repaint, &updateRegion, &validRegion, renderLoop);
|
||||
paintCursor(updateRegion);
|
||||
|
||||
m_painter->end();
|
||||
|
|
|
@ -143,13 +143,12 @@ void Scene::reallocRepaints()
|
|||
}
|
||||
|
||||
// returns mask and possibly modified region
|
||||
void Scene::paintScreen(int* mask, const QRegion &damage, const QRegion &repaint,
|
||||
void Scene::paintScreen(const QRegion &damage, const QRegion &repaint,
|
||||
QRegion *updateRegion, QRegion *validRegion, RenderLoop *renderLoop,
|
||||
const QMatrix4x4 &projection)
|
||||
{
|
||||
const QSize &screenSize = screens()->size();
|
||||
const QRegion displayRegion(0, 0, screenSize.width(), screenSize.height());
|
||||
*mask = (damage == displayRegion) ? 0 : PAINT_SCREEN_REGION;
|
||||
|
||||
const std::chrono::milliseconds presentTime =
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(renderLoop->nextPresentationTimestamp());
|
||||
|
@ -167,19 +166,19 @@ void Scene::paintScreen(int* mask, const QRegion &damage, const QRegion &repaint
|
|||
QRegion region = damage;
|
||||
|
||||
ScreenPrePaintData pdata;
|
||||
pdata.mask = *mask;
|
||||
pdata.mask = (damage == displayRegion) ? 0 : PAINT_SCREEN_REGION;
|
||||
pdata.paint = region;
|
||||
|
||||
effects->prePaintScreen(pdata, m_expectedPresentTimestamp);
|
||||
*mask = pdata.mask;
|
||||
region = pdata.paint;
|
||||
|
||||
if (*mask & (PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) {
|
||||
int mask = pdata.mask;
|
||||
if (mask & (PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) {
|
||||
// Region painting is not possible with transformations,
|
||||
// because screen damage doesn't match transformed positions.
|
||||
*mask &= ~PAINT_SCREEN_REGION;
|
||||
mask &= ~PAINT_SCREEN_REGION;
|
||||
region = infiniteRegion();
|
||||
} else if (*mask & PAINT_SCREEN_REGION) {
|
||||
} else if (mask & PAINT_SCREEN_REGION) {
|
||||
// make sure not to go outside visible screen
|
||||
region &= displayRegion;
|
||||
} else {
|
||||
|
@ -191,7 +190,7 @@ void Scene::paintScreen(int* mask, const QRegion &damage, const QRegion &repaint
|
|||
repaint_region = repaint;
|
||||
|
||||
ScreenPaintData data(projection, effects->findScreen(painted_screen));
|
||||
effects->paintScreen(*mask, region, data);
|
||||
effects->paintScreen(mask, region, data);
|
||||
|
||||
Q_EMIT frameRendered();
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ protected:
|
|||
void createStackingOrder(const QList<Toplevel *> &toplevels);
|
||||
void clearStackingOrder();
|
||||
// shared implementation, starts painting the screen
|
||||
void paintScreen(int *mask, const QRegion &damage, const QRegion &repaint,
|
||||
void paintScreen(const QRegion &damage, const QRegion &repaint,
|
||||
QRegion *updateRegion, QRegion *validRegion, RenderLoop *renderLoop,
|
||||
const QMatrix4x4 &projection = QMatrix4x4());
|
||||
// Render cursor texture in case hardware cursor is disabled/non-applicable
|
||||
|
|
Loading…
Reference in a new issue