Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions src/_imagingcms.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,10 @@ pyCMSdoTransform(Imaging im, Imaging imOut, cmsHTRANSFORM hTransform) {
return -1;
}

Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS;

// transform color channels only
for (i = 0; i < im->ysize; i++) {
// transform color channels only
for (i = 0; i < im->ysize; i++) {
cmsDoTransform(hTransform, im->image[i], imOut->image[i], im->xsize);
}

Expand All @@ -362,9 +362,9 @@ pyCMSdoTransform(Imaging im, Imaging imOut, cmsHTRANSFORM hTransform) {
// enough available on all platforms, so we polyfill it here for now.
pyCMScopyAux(hTransform, imOut, im);

Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS;

return 0;
return 0;
}

static cmsHTRANSFORM
Expand All @@ -378,17 +378,17 @@ _buildTransform(
) {
cmsHTRANSFORM hTransform;

Py_BEGIN_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS;

/* create the transform */
hTransform = cmsCreateTransform(
hInputProfile,
findLCMStype(sInMode),
hOutputProfile,
findLCMStype(sOutMode),
iRenderingIntent,
cmsFLAGS
);
/* create the transform */
hTransform = cmsCreateTransform(
hInputProfile,
findLCMStype(sInMode),
hOutputProfile,
findLCMStype(sOutMode),
iRenderingIntent,
cmsFLAGS
);

Py_END_ALLOW_THREADS;

Expand All @@ -412,19 +412,19 @@ _buildProofTransform(
) {
cmsHTRANSFORM hTransform;

Py_BEGIN_ALLOW_THREADS

/* create the transform */
hTransform = cmsCreateProofingTransform(
hInputProfile,
findLCMStype(sInMode),
hOutputProfile,
findLCMStype(sOutMode),
hProofProfile,
iRenderingIntent,
iProofIntent,
cmsFLAGS
);
Py_BEGIN_ALLOW_THREADS;

/* create the transform */
hTransform = cmsCreateProofingTransform(
hInputProfile,
findLCMStype(sInMode),
hOutputProfile,
findLCMStype(sOutMode),
hProofProfile,
iRenderingIntent,
iProofIntent,
cmsFLAGS
);

Py_END_ALLOW_THREADS;

Expand Down
14 changes: 8 additions & 6 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,24 +690,26 @@
SetWindowLongPtr(wnd, 0, (LONG_PTR)callback);
SetWindowLongPtr(wnd, sizeof(callback), (LONG_PTR)PyThreadState_Get());

Py_BEGIN_ALLOW_THREADS ShowWindow(wnd, SW_SHOWNORMAL);
Py_BEGIN_ALLOW_THREADS;
ShowWindow(wnd, SW_SHOWNORMAL);

Check warning on line 694 in src/display.c

View check run for this annotation

Codecov / codecov/patch

src/display.c#L693-L694

Added lines #L693 - L694 were not covered by tests
SetForegroundWindow(wnd); /* to make sure it's visible */
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS;

Check warning on line 696 in src/display.c

View check run for this annotation

Codecov / codecov/patch

src/display.c#L696

Added line #L696 was not covered by tests

return Py_BuildValue(F_HANDLE, wnd);
return Py_BuildValue(F_HANDLE, wnd);

Check warning on line 698 in src/display.c

View check run for this annotation

Codecov / codecov/patch

src/display.c#L698

Added line #L698 was not covered by tests
}

PyObject *
PyImaging_EventLoopWin32(PyObject *self, PyObject *args) {
MSG msg;

Py_BEGIN_ALLOW_THREADS while (mainloop && GetMessage(&msg, NULL, 0, 0)) {
Py_BEGIN_ALLOW_THREADS;

Check warning on line 705 in src/display.c

View check run for this annotation

Codecov / codecov/patch

src/display.c#L705

Added line #L705 was not covered by tests
while (mainloop && GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Py_END_ALLOW_THREADS
Py_END_ALLOW_THREADS;

Check warning on line 710 in src/display.c

View check run for this annotation

Codecov / codecov/patch

src/display.c#L710

Added line #L710 was not covered by tests

Py_INCREF(Py_None);
Py_INCREF(Py_None);

Check warning on line 712 in src/display.c

View check run for this annotation

Codecov / codecov/patch

src/display.c#L712

Added line #L712 was not covered by tests
return Py_None;
}

Expand Down
Loading