Skip to content

Commit

Permalink
get rid of QPicture
Browse files Browse the repository at this point in the history
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
  • Loading branch information
Ivailo Monev committed Nov 11, 2016
1 parent 1625dbb commit deff95c
Show file tree
Hide file tree
Showing 39 changed files with 67 additions and 2,214 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ set(CPACK_PACKAGE_VERSION_MAJOR "4")
set(CPACK_PACKAGE_VERSION_MINOR "9")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_SET_DESTDIR TRUE)
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git;${CPACK_SOURCE_IGNORE_FILES}")
set(CPACK_SOURCE_IGNORE_FILES "/build/;/minsize/;/.git;${CPACK_SOURCE_IGNORE_FILES}")
set(CPACK_STRIP_FILES TRUE)
set(CPACK_GENERATOR "TXZ")
set(CPACK_SOURCE_GENERATOR "TXZ")
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ There are several things you should be aware before considering Katie:
- OpenVG is no longer supported graphics output
- Blitter is no longer supported painting engine
- native graphics system is no more, rasterizer is just as fast as native
- QPictureIO and plugins for it are no longer supported
- QPicture, QPictureIO and plugins for it are no longer supported
- QML debugger and inspector have been removed, potentially dangerous
- no SIMD, zero performance impact with decent compiler
- state machine is no more
Expand Down
4 changes: 2 additions & 2 deletions src/core/global/qconfig.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#define QT_NO_DIRECTPAINTER
#define QT_NO_COP
#define QT_NO_BLITTABLE
#define QT_NO_PICTURE
#define QT_NO_PICTUREIO
#define QT_NO_SOFTKEYMANAGER
#define QT_NO_SXE
Expand Down Expand Up @@ -225,7 +226,6 @@
#cmakedefine QT_NO_NSL
#cmakedefine QT_NO_PAINT_DEBUG
#cmakedefine QT_NO_PDF
#cmakedefine QT_NO_PICTURE
#cmakedefine QT_NO_PLUGIN_CHECK
#cmakedefine QT_NO_PRINTDIALOG
#cmakedefine QT_NO_PRINTER
Expand Down Expand Up @@ -530,7 +530,7 @@
#endif

// QPrinter
#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE))
#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_TEMPORARYFILE))
#define QT_NO_PRINTER
#endif

Expand Down
21 changes: 10 additions & 11 deletions src/core/global/qnamespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -1464,17 +1464,16 @@ typedef bool (*qInternalCallback)(void **);
class Q_CORE_EXPORT QInternal {
public:
enum PaintDeviceFlags {
UnknownDevice = 0x00,
Widget = 0x01,
Pixmap = 0x02,
Image = 0x03,
Printer = 0x04,
Picture = 0x05,
Pbuffer = 0x06, // GL pbuffer
FramebufferObject = 0x07, // GL framebuffer object
CustomRaster = 0x08,
PaintBuffer = 0x09,
OpenGL = 0x0a
UnknownDevice = 0,
Widget = 1,
Pixmap = 2,
Image = 3,
Printer = 4,
Pbuffer = 5, // GL pbuffer
FramebufferObject = 6, // GL framebuffer object
CustomRaster = 7,
PaintBuffer = 8,
OpenGL = 9
};
enum RelayoutType {
RelayoutNormal,
Expand Down
1 change: 0 additions & 1 deletion src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ set(GUI_PUBLIC_HEADERS
QPalette
QPanGesture
QPen
QPicture
QPixmap
QPixmapCache
QPlainTextDocumentLayout
Expand Down
10 changes: 5 additions & 5 deletions src/gui/graphicsview/qgraphicsitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5140,11 +5140,11 @@ QRegion QGraphicsItem::boundingRegion(const QTransform &itemToDeviceTransform) c
// ### Ideally we would have a better way to generate this region,
// preferably something in the lines of QPainterPath::toRegion(QTransform)
// coupled with a way to generate a painter path from a set of painter
// operations (e.g., QPicture::toPainterPath() or so). The current
// approach generates a bitmap with the size of the item's bounding rect
// in device coordinates, scaled by b.r.granularity, then paints the item
// into the bitmap, converts the result to a QRegion and scales the region
// back to device space with inverse granularity.
// operations. The current approach generates a bitmap with the size of
// the item's bounding rect in device coordinates, scaled by
// b.r.granularity, then paints the item into the bitmap, converts the
// result to a QRegion and scales the region back to device space with
// inverse granularity.
qreal granularity = boundingRegionGranularity();
QRect deviceRect = itemToDeviceTransform.mapRect(boundingRect()).toRect();
_q_adjustRect(&deviceRect);
Expand Down
5 changes: 1 addition & 4 deletions src/gui/graphicsview/qgraphicsscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1722,10 +1722,7 @@ void QGraphicsScene::render(QPainter *painter, const QRectF &target, const QRect
// Default target rect = device rect
QRectF targetRect = target;
if (targetRect.isNull()) {
if (painter->device()->devType() == QInternal::Picture)
targetRect = sourceRect;
else
targetRect.setRect(0, 0, painter->device()->width(), painter->device()->height());
targetRect.setRect(0, 0, painter->device()->width(), painter->device()->height());
}

// Find the ideal x / y scaling ratio to fit \a source into \a target.
Expand Down
5 changes: 1 addition & 4 deletions src/gui/graphicsview/qgraphicsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2060,10 +2060,7 @@ void QGraphicsView::render(QPainter *painter, const QRectF &target, const QRect
// Default target rect = device rect
QRectF targetRect = target;
if (target.isNull()) {
if (painter->device()->devType() == QInternal::Picture)
targetRect = sourceRect;
else
targetRect.setRect(0, 0, painter->device()->width(), painter->device()->height());
targetRect.setRect(0, 0, painter->device()->width(), painter->device()->height());
}

// Find the ideal x / y scaling ratio to fit \a source into \a target.
Expand Down
5 changes: 0 additions & 5 deletions src/gui/image/image.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ set(GUI_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/image/qimagereader.h
${CMAKE_CURRENT_SOURCE_DIR}/image/qimagewriter.h
${CMAKE_CURRENT_SOURCE_DIR}/image/qmovie.h
${CMAKE_CURRENT_SOURCE_DIR}/image/qpaintengine_pic_p.h
${CMAKE_CURRENT_SOURCE_DIR}/image/qpicture.h
${CMAKE_CURRENT_SOURCE_DIR}/image/qpicture_p.h
${CMAKE_CURRENT_SOURCE_DIR}/image/qpixmap.h
${CMAKE_CURRENT_SOURCE_DIR}/image/qpixmap_raster_p.h
${CMAKE_CURRENT_SOURCE_DIR}/image/qpixmapcache.h
Expand All @@ -38,8 +35,6 @@ set(GUI_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/image/qimageiohandler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/image/qimagereader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/image/qimagewriter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/image/qpaintengine_pic.cpp
${CMAKE_CURRENT_SOURCE_DIR}/image/qpicture.cpp
${CMAKE_CURRENT_SOURCE_DIR}/image/qpixmap.cpp
${CMAKE_CURRENT_SOURCE_DIR}/image/qpixmapcache.cpp
${CMAKE_CURRENT_SOURCE_DIR}/image/qpixmapdata.cpp
Expand Down
10 changes: 4 additions & 6 deletions src/gui/image/qimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,10 @@ bool QImageData::checkForAlphaPixels() const
can be used as a paint device.
Qt provides four classes for handling image data: QImage, QPixmap,
QBitmap and QPicture. QImage is designed and optimized for I/O,
and for direct pixel access and manipulation, while QPixmap is
designed and optimized for showing images on screen. QBitmap is
only a convenience class that inherits QPixmap, ensuring a
depth of 1. Finally, the QPicture class is a paint device that
records and replays QPainter commands.
and QBitmap. QImage is designed and optimized for I/O, and for
direct pixel access and manipulation, while QPixmap is designed
and optimized for showing images on screen. QBitmap is only a
convenience class that inherits QPixmap, ensuring a depth of 1.
Because QImage is a QPaintDevice subclass, QPainter can be used to
draw directly onto images. When using QPainter on a QImage, the
Expand Down
Loading

0 comments on commit deff95c

Please sign in to comment.