Changeset View
Changeset View
Standalone View
Standalone View
autotests/client/test_wayland_outputmanagement.cpp
Show First 20 Lines • Show All 244 Lines • ▼ Show 20 Line(s) | 244 | if (c->transformChanged()) { | |||
---|---|---|---|---|---|
245 | outputdevice->setTransform(c->transform()); | 245 | outputdevice->setTransform(c->transform()); | ||
246 | } | 246 | } | ||
247 | if (c->positionChanged()) { | 247 | if (c->positionChanged()) { | ||
248 | outputdevice->setGlobalPosition(c->position()); | 248 | outputdevice->setGlobalPosition(c->position()); | ||
249 | } | 249 | } | ||
250 | if (c->scaleChanged()) { | 250 | if (c->scaleChanged()) { | ||
251 | outputdevice->setScaleF(c->scaleF()); | 251 | outputdevice->setScaleF(c->scaleF()); | ||
252 | } | 252 | } | ||
253 | if (c->colorCurvesChanged()) { | ||||
254 | outputdevice->setColorCurves(c->colorCurves()); | ||||
255 | } | ||||
253 | } | 256 | } | ||
254 | } | 257 | } | ||
255 | 258 | | |||
256 | void TestWaylandOutputManagement::createOutputDevices() | 259 | void TestWaylandOutputManagement::createOutputDevices() | ||
257 | { | 260 | { | ||
258 | QCOMPARE(m_omSpy->count(), 1); | 261 | QCOMPARE(m_omSpy->count(), 1); | ||
259 | QCOMPARE(m_registry->interfaces(KWayland::Client::Registry::Interface::OutputDevice).count(), m_serverOutputs.count()); | 262 | QCOMPARE(m_registry->interfaces(KWayland::Client::Registry::Interface::OutputDevice).count(), m_serverOutputs.count()); | ||
260 | 263 | | |||
261 | auto output = new KWayland::Client::OutputDevice(); | 264 | auto output = new KWayland::Client::OutputDevice(); | ||
262 | QVERIFY(!output->isValid()); | 265 | QVERIFY(!output->isValid()); | ||
263 | QCOMPARE(output->geometry(), QRect()); | 266 | QCOMPARE(output->geometry(), QRect()); | ||
264 | QCOMPARE(output->globalPosition(), QPoint()); | 267 | QCOMPARE(output->globalPosition(), QPoint()); | ||
265 | QCOMPARE(output->manufacturer(), QString()); | 268 | QCOMPARE(output->manufacturer(), QString()); | ||
266 | QCOMPARE(output->model(), QString()); | 269 | QCOMPARE(output->model(), QString()); | ||
267 | QCOMPARE(output->physicalSize(), QSize()); | 270 | QCOMPARE(output->physicalSize(), QSize()); | ||
268 | QCOMPARE(output->pixelSize(), QSize()); | 271 | QCOMPARE(output->pixelSize(), QSize()); | ||
269 | QCOMPARE(output->refreshRate(), 0); | 272 | QCOMPARE(output->refreshRate(), 0); | ||
270 | QCOMPARE(output->scale(), 1); | 273 | QCOMPARE(output->scale(), 1); | ||
274 | QCOMPARE(output->colorCurves().red, QVector<quint16>()); | ||||
275 | QCOMPARE(output->colorCurves().green, QVector<quint16>()); | ||||
276 | QCOMPARE(output->colorCurves().blue, QVector<quint16>()); | ||||
271 | QCOMPARE(output->subPixel(), KWayland::Client::OutputDevice::SubPixel::Unknown); | 277 | QCOMPARE(output->subPixel(), KWayland::Client::OutputDevice::SubPixel::Unknown); | ||
272 | QCOMPARE(output->transform(), KWayland::Client::OutputDevice::Transform::Normal); | 278 | QCOMPARE(output->transform(), KWayland::Client::OutputDevice::Transform::Normal); | ||
273 | QCOMPARE(output->enabled(), OutputDevice::Enablement::Enabled); | 279 | QCOMPARE(output->enabled(), OutputDevice::Enablement::Enabled); | ||
274 | QCOMPARE(output->edid(), QByteArray()); | 280 | QCOMPARE(output->edid(), QByteArray()); | ||
275 | QCOMPARE(output->uuid(), QByteArray()); | 281 | QCOMPARE(output->uuid(), QByteArray()); | ||
276 | 282 | | |||
277 | QSignalSpy outputChanged(output, &KWayland::Client::OutputDevice::changed); | 283 | QSignalSpy outputChanged(output, &KWayland::Client::OutputDevice::changed); | ||
278 | QVERIFY(outputChanged.isValid()); | 284 | QVERIFY(outputChanged.isValid()); | ||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Line(s) | 394 | { | |||
400 | }); | 406 | }); | ||
401 | QSignalSpy serverApplySpy(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested); | 407 | QSignalSpy serverApplySpy(m_outputManagementInterface, &OutputManagementInterface::configurationChangeRequested); | ||
402 | QVERIFY(serverApplySpy.isValid()); | 408 | QVERIFY(serverApplySpy.isValid()); | ||
403 | 409 | | |||
404 | config->setMode(output, m_modes.first().id); | 410 | config->setMode(output, m_modes.first().id); | ||
405 | config->setTransform(output, OutputDevice::Transform::Rotated90); | 411 | config->setTransform(output, OutputDevice::Transform::Rotated90); | ||
406 | config->setPosition(output, QPoint(13, 37)); | 412 | config->setPosition(output, QPoint(13, 37)); | ||
407 | config->setScale(output, 2); | 413 | config->setScale(output, 2); | ||
414 | const auto zeroVector = QVector<quint16>(256, 0); | ||||
415 | config->setColorCurves(output, zeroVector, zeroVector, zeroVector); | ||||
408 | config->setEnabled(output, OutputDevice::Enablement::Disabled); | 416 | config->setEnabled(output, OutputDevice::Enablement::Disabled); | ||
409 | config->apply(); | 417 | config->apply(); | ||
410 | 418 | | |||
411 | QVERIFY(serverApplySpy.wait(200)); | 419 | QVERIFY(serverApplySpy.wait(200)); | ||
412 | QCOMPARE(serverApplySpy.count(), 1); | 420 | QCOMPARE(serverApplySpy.count(), 1); | ||
413 | 421 | | |||
414 | configurationInterface->setApplied(); | 422 | configurationInterface->setApplied(); | ||
415 | 423 | | |||
416 | QSignalSpy configAppliedSpy(config, &OutputConfiguration::applied); | 424 | QSignalSpy configAppliedSpy(config, &OutputConfiguration::applied); | ||
417 | QVERIFY(configAppliedSpy.isValid()); | 425 | QVERIFY(configAppliedSpy.isValid()); | ||
418 | QVERIFY(configAppliedSpy.wait(200)); | 426 | QVERIFY(configAppliedSpy.wait(200)); | ||
419 | QCOMPARE(configAppliedSpy.count(), 1); | 427 | QCOMPARE(configAppliedSpy.count(), 1); | ||
420 | QCOMPARE(outputChangedSpy.count(), 5); | 428 | QCOMPARE(outputChangedSpy.count(), 5); | ||
421 | 429 | | |||
422 | config->setMode(output, m_modes.at(1).id); | 430 | config->setMode(output, m_modes.at(1).id); | ||
423 | config->setTransform(output, OutputDevice::Transform::Normal); | 431 | config->setTransform(output, OutputDevice::Transform::Normal); | ||
424 | config->setPosition(output, QPoint(0, 1920)); | 432 | config->setPosition(output, QPoint(0, 1920)); | ||
425 | config->setScale(output, 1); | 433 | config->setScale(output, 1); | ||
434 | const auto oneVector = QVector<quint16>(256, 1); | ||||
435 | config->setColorCurves(output, oneVector, oneVector, oneVector); | ||||
426 | config->setEnabled(output, OutputDevice::Enablement::Enabled); | 436 | config->setEnabled(output, OutputDevice::Enablement::Enabled); | ||
427 | config->apply(); | 437 | config->apply(); | ||
428 | 438 | | |||
429 | QVERIFY(serverApplySpy.wait(200)); | 439 | QVERIFY(serverApplySpy.wait(200)); | ||
430 | QCOMPARE(serverApplySpy.count(), 2); | 440 | QCOMPARE(serverApplySpy.count(), 2); | ||
431 | 441 | | |||
432 | configurationInterface->setApplied(); | 442 | configurationInterface->setApplied(); | ||
433 | 443 | | |||
▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines |