Reviewing merge request #642: Patch to QTBUG-10471

It seems that qt_ft_grays_raster.raster_render(...) in QRasterPaintEnginePrivate::rasterize(...) doesn't return the error code -6 when data buffer needs to have more memory allocated to it, but returns -3 instead. I fixed the problem by investigating qgrayraster.c and qrasterdefs_p.h and changing things a little bit.
What I did was:
1. Simplifying function signatures of QT_FT_* functions pointers
2. Redefining ErrRaster_OutOfMemory, since it was not defined anywhere and the -6 value was just thrown in the code with a reference to a (seemingly non-existent) qblackraster.c
3. Guaranteeing that any initial raster pool size set below the minimum value of 4096 (size of TWorker + size of TCell, etc) is reallocated with the error code ErrRaster_OutOfMemory being signaled, and not ErrRaster_InvalidArgument as happened before.

Tested with tst_qpainter of /tests/auto/. Notice that the largeImagePainting test is the only one that requires reallocation of memory (to 8192). All tests worked.

Commits that would be merged:

Version 3
  • Version 1
  • Version 2
  • Version 3
  • 084c5c6
  • 4422366
  • Patch to QTBUG-10471

  • 6201c5c
  • Latest version of patch to QTBUG-10471

Showing 084c5c6-4422366

Comments

This patch does not apply cleanly to current master for me.
Carolina: you might want to run rebase?

Benjamin/other: I'd suggest revise&resubmit based on that

Back to Carolina: I think the better solution would be to find the core of the problem rather than working around it, but I’ll admit to having skimmed over this

Ok, I’ll try rebasing. But this notwithstanding, would you know where the implementation of the raster_render method is?

Also, commit cf1ead2 is the patch for QTBUG-10215, which generated QTBUG-10471 (the one I'm actually targeting here). I included the patch for QTBUG-10215 here just because it is necessary for c2f1c10. So maybe that’s why it didn’t apply?

→ State changed from New to Revise and resubmit

Done.

+     QDataBuffer(int res)

i'd prefer
QDataBuffer(int res) : capacity(res), buffer(0), siz(0)
{

if (capacity)
    buffer = (Type*) qMalloc(capacity * sizeof(Type));  

}
for better readability

Carolina: raster_render in qt_ft_grays_raster points to gray_raster_render in qgrayraster.c. Looking at the code there it seems that -6 is returned for render pool overflow, whereas -3 is returned in some other circumstances (ErrRaster_Invalid_Argument)

This patch seems to be including another patch which touches upon QDataBuffer and other classes. Please create the patch against a recent 4.7.

→ State changed from Revise and resubmit to New

Updated merge request, and modified the request summary with new modifications.

→ State changed from New to Reviewing

→ State changed from Reviewing to Merged

Squashed the two commits into one, fixed some indentation / white space at line ending issues and pushed it to 4.7 in oslo-staging-2, thanks for the contribution!

Add a new comment:

Login or create an account to post a comment

How to apply this merge request to your repository