Commit e544a5ed authored by Halla Rempt's avatar Halla Rempt
Browse files

Revert "fix spelling error"

This reverts commit b6405a30813bcaf7af003695e860632325039749.
parent 730b062c
......@@ -54,7 +54,6 @@
#include "kis_selection.h"
#include "kis_selection_component.h"
#include "flake/kis_shape_selection.h"
#include "kis_image_config.h"
#include "opengl/kis_opengl_canvas2.h"
#include "opengl/kis_opengl_image_textures.h"
......@@ -95,7 +94,6 @@ public:
KisAbstractCanvasWidget *canvasWidget;
KoShapeManager *shapeManager;
KoColorProfile *monitorProfile;
KoColorConversionTransformation::Intent renderingIntent;
bool currentCanvasIsOpenGL;
bool currentCanvasUsesOpenGLShaders;
KoToolProxy *toolProxy;
......@@ -193,7 +191,7 @@ bool KisCanvas2::snapToGrid() const
void KisCanvas2::pan(QPoint shift)
{
KoCanvasControllerWidget* controller =
dynamic_cast<KoCanvasControllerWidget*>(canvasController());
dynamic_cast<KoCanvasControllerWidget*>(canvasController());
controller->pan(shift);
updateCanvas();
}
......@@ -207,7 +205,7 @@ void KisCanvas2::mirrorCanvas(bool enable)
qreal KisCanvas2::rotationAngle() const
{
return m_d->coordinatesConverter->rotationAngle();
return m_d->coordinatesConverter->rotationAngle();
}
void KisCanvas2::rotateCanvas(qreal angle, bool updateOffset)
......@@ -329,7 +327,7 @@ void KisCanvas2::createQPainterCanvas()
KisQPainterCanvas * canvasWidget = new KisQPainterCanvas(this, m_d->coordinatesConverter, m_d->view);
m_d->prescaledProjection = new KisPrescaledProjection();
m_d->prescaledProjection->setCoordinatesConverter(m_d->coordinatesConverter);
m_d->prescaledProjection->setMonitorProfile(m_d->monitorProfile, m_d->renderingIntent);
m_d->prescaledProjection->setMonitorProfile(monitorProfile());
canvasWidget->setPrescaledProjection(m_d->prescaledProjection);
setCanvasWidget(canvasWidget);
}
......@@ -340,7 +338,7 @@ void KisCanvas2::createOpenGLCanvas()
m_d->currentCanvasIsOpenGL = true;
// XXX: The image isn't done loading here!
m_d->openGLImageTextures = KisOpenGLImageTextures::getImageTextures(m_d->view->image(), m_d->monitorProfile, m_d->renderingIntent);
m_d->openGLImageTextures = KisOpenGLImageTextures::getImageTextures(m_d->view->image(), m_d->monitorProfile);
KisOpenGLCanvas2 * canvasWidget = new KisOpenGLCanvas2(this, m_d->coordinatesConverter, m_d->view, m_d->openGLImageTextures);
m_d->currentCanvasUsesOpenGLShaders = m_d->openGLImageTextures->usingHDRExposureProgram();
setCanvasWidget(canvasWidget);
......@@ -351,10 +349,8 @@ void KisCanvas2::createOpenGLCanvas()
void KisCanvas2::createCanvas(bool useOpenGL)
{
KisConfig cfg;
const KoColorProfile *profile = m_d->view->resourceProvider()->currentDisplayProfile();
m_d->monitorProfile = const_cast<KoColorProfile*>(profile);
m_d->renderingIntent = (KoColorConversionTransformation::Intent)cfg.renderIntent();
if (useOpenGL) {
#ifdef HAVE_OPENGL
......@@ -398,7 +394,7 @@ void KisCanvas2::connectCurrentImage()
SLOT(startResizingImage(qint32, qint32)),
Qt::DirectConnection);
connect(this, SIGNAL(sigContinueResizeImage(qint32, qint32)),
this, SLOT(finishResizingImage(qint32, qint32)));
this, SLOT(finishResisingImage(qint32, qint32)));
startResizingImage(image->width(), image->height());
......@@ -436,8 +432,8 @@ void KisCanvas2::resetCanvas(bool useOpenGL)
KisConfig cfg;
if ( (useOpenGL != m_d->currentCanvasIsOpenGL)
|| ( m_d->currentCanvasIsOpenGL
&& (cfg.useOpenGLShaders() != m_d->currentCanvasUsesOpenGLShaders))) {
|| ( m_d->currentCanvasIsOpenGL
&& (cfg.useOpenGLShaders() != m_d->currentCanvasUsesOpenGLShaders))) {
disconnectCurrentImage();
createCanvas(useOpenGL);
......@@ -445,77 +441,18 @@ void KisCanvas2::resetCanvas(bool useOpenGL)
notifyZoomChanged();
}
#endif
m_d->canvasWidget->widget()->update();
}
void KisCanvas2::startUpdateInPatches(QRect imageRect)
{
if (m_d->currentCanvasIsOpenGL) {
startUpdateCanvasProjection(imageRect);
} else {
KisImageConfig imageConfig;
int patchWidth = imageConfig.updatePatchWidth();
int patchHeight = imageConfig.updatePatchHeight();
for (int y = 0; y < imageRect.height(); y += patchHeight) {
for (int x = 0; x < imageRect.width(); x += patchWidth) {
QRect patchRect(x, y, patchWidth, patchHeight);
startUpdateCanvasProjection(patchRect);
}
}
}
}
void KisCanvas2::setMonitorProfile(KoColorProfile* monitorProfile,
KoColorConversionTransformation::Intent renderingIntent)
{
KisImageWSP image = this->image();
m_d->monitorProfile = monitorProfile;
m_d->renderingIntent = renderingIntent;
image->barrierLock();
if (m_d->currentCanvasIsOpenGL) {
#ifdef HAVE_OPENGL
if (useOpenGL) {
Q_ASSERT(m_d->openGLImageTextures);
m_d->openGLImageTextures->setMonitorProfile(monitorProfile, renderingIntent);
#else
Q_ASSERT_X(0, "KisCanvas2::setMonitorProfile", "Bad use of setMonitorProfile(). It shouldn't have happened =(");
#endif
m_d->openGLImageTextures->setMonitorProfile(monitorProfile());
} else {
Q_ASSERT(m_d->prescaledProjection);
m_d->prescaledProjection->setMonitorProfile(monitorProfile, renderingIntent);
if (image()) {
startUpdateCanvasProjection(image()->bounds());
}
}
startUpdateInPatches(image->bounds());
image->unlock();
}
void KisCanvas2::setDisplayFilter(KisDisplayFilter *displayFilter)
{
KisImageWSP image = this->image();
image->barrierLock();
if (m_d->currentCanvasIsOpenGL) {
#ifdef HAVE_OPENGL
Q_ASSERT(m_d->openGLImageTextures);
m_d->openGLImageTextures->setDisplayFilter(displayFilter);
#endif
}
else {
Q_ASSERT(m_d->prescaledProjection);
m_d->prescaledProjection->setDisplayFilter(displayFilter);
}
startUpdateInPatches(image->bounds());
image->unlock();
m_d->canvasWidget->widget()->update();
}
void KisCanvas2::startResizingImage(qint32 w, qint32 h)
......@@ -523,10 +460,22 @@ void KisCanvas2::startResizingImage(qint32 w, qint32 h)
emit sigContinueResizeImage(w, h);
QRect imageBounds(0, 0, w, h);
startUpdateInPatches(imageBounds);
if (m_d->currentCanvasIsOpenGL) {
startUpdateCanvasProjection(imageBounds);
} else {
// TODO: make configurable from KisImageConfig
const int patchSize = 512;
for (int y = 0; y < h; y += patchSize) {
for (int x = 0; x < w; x += patchSize) {
QRect patchRect(x, y, patchSize, patchSize);
startUpdateCanvasProjection(patchRect);
}
}
}
}
void KisCanvas2::finishResizingImage(qint32 w, qint32 h)
void KisCanvas2::finishResisingImage(qint32 w, qint32 h)
{
if (m_d->currentCanvasIsOpenGL) {
#ifdef HAVE_OPENGL
......@@ -585,7 +534,7 @@ void KisCanvas2::updateCanvasProjection(KisUpdateInfoSP info)
m_d->prescaledProjection->recalculateCache(info);
QRect vRect = m_d->coordinatesConverter->
viewportToWidget(info->dirtyViewportRect()).toAlignedRect();
viewportToWidget(info->dirtyViewportRect()).toAlignedRect();
if (!vRect.isEmpty()) {
m_d->canvasWidget->widget()->update(vRect);
......@@ -673,7 +622,9 @@ bool KisCanvas2::usingHDRExposureProgram()
{
#ifdef HAVE_OPENGL
if (m_d->currentCanvasIsOpenGL) {
return m_d->openGLImageTextures->usingHDRExposureProgram();
if (m_d->openGLImageTextures->usingHDRExposureProgram()) {
return true;
}
}
#endif
return false;
......@@ -772,7 +723,7 @@ KoFavoriteResourceManager* KisCanvas2::favoriteResourceManager()
bool KisCanvas2::handlePopupPaletteIsVisible()
{
if (favoriteResourceManager()
&& favoriteResourceManager()->isPopupPaletteVisible()) {
&& favoriteResourceManager()->isPopupPaletteVisible()) {
favoriteResourceManager()->slotShowPopupPalette();
return true;
......
......@@ -25,7 +25,6 @@
#include <QSize>
#include <QString>
#include <KoColorSpace.h>
#include <KoCanvasBase.h>
#include <krita_export.h>
#include <kis_types.h>
......@@ -41,7 +40,6 @@ class KisCanvasDecoration;
class KisView2;
class KisPaintopBox;
class KoFavoriteResourceManager;
class KisDisplayFilter;
enum KisCanvasType {
QPAINTER,
......@@ -172,17 +170,8 @@ public slots:
void startUpdateCanvasProjection(const QRect & rc);
void updateCanvasProjection(KisUpdateInfoSP info);
void startUpdateInPatches(QRect imageRect);
void setMonitorProfile(KoColorProfile* monitorProfile,
KoColorConversionTransformation::Intent renderingIntent);
void setDisplayFilter(KisDisplayFilter *displayFilter);
void startResizingImage(qint32 w, qint32 h);
void finishResizingImage(qint32 w, qint32 h);
void finishResisingImage(qint32 w, qint32 h);
/// adjust the origin of the document
void adjustOrigin();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment