Changeset View
Changeset View
Standalone View
Standalone View
krita/ui/canvas/kis_canvas2.cpp
Show First 20 Lines • Show All 478 Lines • ▼ Show 20 Line(s) | 473 | { | |||
---|---|---|---|---|---|
479 | } | 479 | } | ||
480 | 480 | | |||
481 | startResizingImage(); | 481 | startResizingImage(); | ||
482 | 482 | | |||
483 | emit imageChanged(image); | 483 | emit imageChanged(image); | ||
484 | setLodAllowedInCanvas(m_d->lodAllowedInCanvas); | 484 | setLodAllowedInCanvas(m_d->lodAllowedInCanvas); | ||
485 | } | 485 | } | ||
486 | 486 | | |||
487 | void KisCanvas2::disconnectCurrentCanvas() | | |||
488 | { | | |||
489 | m_d->canvasWidget->disconnectCurrentCanvas(); | | |||
490 | } | | |||
491 | | ||||
492 | void KisCanvas2::resetCanvas(bool useOpenGL) | 487 | void KisCanvas2::resetCanvas(bool useOpenGL) | ||
493 | { | 488 | { | ||
494 | // we cannot reset the canvas before it's created, but this method might be called, | 489 | // we cannot reset the canvas before it's created, but this method might be called, | ||
495 | // for instance when setting the monitor profile. | 490 | // for instance when setting the monitor profile. | ||
496 | if (!m_d->canvasWidget) { | 491 | if (!m_d->canvasWidget) { | ||
497 | return; | 492 | return; | ||
498 | } | 493 | } | ||
499 | #ifdef HAVE_OPENGL | 494 | #ifdef HAVE_OPENGL | ||
500 | KisConfig cfg; | 495 | KisConfig cfg; | ||
501 | bool needReset = (m_d->currentCanvasIsOpenGL != useOpenGL) || | 496 | bool needReset = (m_d->currentCanvasIsOpenGL != useOpenGL) || | ||
502 | (m_d->currentCanvasIsOpenGL && | 497 | (m_d->currentCanvasIsOpenGL && | ||
503 | m_d->openGLFilterMode != cfg.openGLFilteringMode()); | 498 | m_d->openGLFilterMode != cfg.openGLFilteringMode()); | ||
504 | 499 | | |||
505 | if (needReset) { | 500 | if (needReset) { | ||
506 | disconnectCurrentCanvas(); | | |||
507 | createCanvas(useOpenGL); | 501 | createCanvas(useOpenGL); | ||
508 | connectCurrentCanvas(); | 502 | connectCurrentCanvas(); | ||
509 | notifyZoomChanged(); | 503 | notifyZoomChanged(); | ||
510 | } | 504 | } | ||
511 | #else | 505 | #else | ||
512 | Q_UNUSED(useOpenGL) | 506 | Q_UNUSED(useOpenGL) | ||
513 | #endif | 507 | #endif | ||
514 | 508 | | |||
▲ Show 20 Lines • Show All 408 Lines • Show Last 20 Lines |