summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qpixelformat.h
Commit message (Collapse)AuthorAgeFilesLines
* Add qtguiglobal.h and qtguiglobal_p.hLars Knoll2016-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | The new modular configuration system requires one global header per module, that is included by all other files in this module. A similar scheme and naming convention is already being used for many other modules (e.g. printsupport, qml, quick). That header will later on #include the configuration file for Qt Gui. For now it defines the Q_GUI_EXPORT macro for this library. In addition, add a private global header, qtguiglobal_p.h, that can later on include the private config header for Qt Gui for things we don't want to export to the world. Change-Id: Id9ce2a4f3d2962c3592c35e3d080574789195f24 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-18/+10
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Add Grayscale8 and Alpha8 formats to QImage and drawingAllan Sandfeld Jensen2014-09-171-1/+18
|/ | | | | | | | | | | | Extend the QImage format with two 8-bit grayscale and alpha formats. These formats have the advantage over Indexed8 that they have simpler conversion and can be rendered to by the raster engine. [ChangeLog][QtGui][QImage] Added support grayscale and alpha 8-bit formats which can also be rendered to. Change-Id: I4343c80a92a3dda196aa38d0c3ea251b094fc274 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix compilation of QPixelFormat with old clangFrederik Gladhorn2014-08-151-1/+3
| | | | | | | | | | | | The enum would break on old clang trying to cast it to strings when building webkit. In file included from /work/build/qt/qtbase/lib/QtGui.framework/Versions/5/Headers/qimage.h:48: /work/build/qt/qtbase/lib/QtGui.framework/Headers/qpixelformat.h:78:33: error: use of overloaded operator '+' is ambiguous (with operand types 'int' and 'QPixelFormat::FieldWidth') Change-Id: I614cf89d0832dea505001d55188b4c748e948ef9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QPixelFormat: don't inherit itMarc Mutz2014-08-091-173/+107
| | | | | | | | | | | | | | | | | | | | | Instead of abusing inheritance to provide convenience constructors, use simple inline constructor functions. The name got a lower-case q to indicate a free function. The usual fromXYZ() static methods were deemed not fitting in this case in the initial round of review, since they implied some kind of conversion while these functions are simply constructors of formsts, which contain no data. This also solves the problem that some of these ctors could have been called with just one argument and were therefore candidates for hidden QPixelFormat temporary injection. QPixelFormatRgb was renamed to qPixelFormatRgba to explain the third argument at the call site better. There seem to be no users of this class in qt5.git at this time. Change-Id: Ib4fe8ceb2d30744127b116a748724a3406400eb8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPixelFormat is better taken by-valueMarc Mutz2014-08-091-2/+2
| | | | | | | Being a better quint64, it can be passed in registers, so take them as value args. Change-Id: I8eb96a2594d910b538b651fb3ca567c0c124dd3a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* QPixelFormat: implement some oneliners in the class bodyMarc Mutz2014-08-091-15/+6
| | | | | | | | There's little point in duplicating the complex declaration (thanks to C++11), just define the relational operators and the default ctor where they're declared. Change-Id: Ie91545b2581c89edd434c911eb05705e2d16debe Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QPixelFormat: don't use bit fieldsMarc Mutz2014-08-091-101/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC at least is generating horrible code for them, so do the bit twiddling ourselves. This is not premature optimization, because it might be the seed for a QBitField class, as suggested by Andrei Alexandrescu on GN2013. The assembler code of default and copy ctors is unchanged between the old and new versions. Accessors such as redSize() are virtually identical (with an and and a mov exchanging place). The interesting thing is what happend in operator== and the set-all-fields ctor. These are the disassemblies of functions wrapping op== and the ctor, resp.: bool pf_comparison(QPixelFormat, QPixelFormat): .cfi_startproc | .cfi_startproc movl %esi, %edx | cmpq %rsi, %rdi xorl %eax, %eax | sete %al xorl %edi, %edx | ret andl $15, %edx | .cfi_endproc jne .L53 | movl %esi, %edx | xorl %edi, %edx | testw $1008, %dx | jne .L53 | movl %esi, %edx | pushq %rbx | .cfi_def_cfa_offset 16 | .cfi_offset 3, -16 | movl %edi, %ebx | movzbl %dh, %ecx | movzbl %bh, %edx | xorl %ecx, %edx | andl $252, %edx | jne .L40 | movq %rdi, %rcx | movq %rsi, %rdx | shrq $16, %rcx | shrq $16, %rdx | movl %ecx, %ebx | xorl %edx, %ebx | movl %ebx, %r8d | andl $63, %r8d | jne .L40 | xorl %ecx, %edx | testw $4032, %dx | jne .L40 | movq %rsi, %rcx | movabsq $16911433728, %rdx | xorq %rdi, %rcx | testq %rdx, %rcx | jne .L40 | movq %rdi, %rdx | movq %rsi, %rcx | shrq $32, %rdx | shrq $32, %rcx | movl %edx, %ebx | xorl %ecx, %ebx | movl %ebx, %r8d | andl $252, %r8d | jne .L40 | movq %rsi, %r9 | movq %rdi, %r8 | shrq $40, %r9 | shrq $40, %r8 | xorl %r9d, %r8d | andl $127, %r8d | jne .L40 | xorl %ecx, %edx | andl $98304, %edx | jne .L40 | movq %rsi, %rcx | movq %rdi, %rdx | shrq $48, %rcx | shrq $48, %rdx | xorl %ecx, %edx | andl $126, %edx | jne .L40 | shrq $48, %rdi | movq %rcx, %rax | xorl %edi, %eax | testw $-128, %ax | sete %al | .p2align 4,,10 | .p2align 3 | .L40: | popq %rbx | .cfi_restore 3 | .cfi_def_cfa_offset 8 | .L53: | rep | ret | .cfi_endproc | That one is pretty obvious. Hint: the right one is the new version. QPixelFormat pf_unwieldy_ctor(QPixelFormat::ColorModel, ...) .cfi_startproc | .cfi_startproc movq %rbp, -32(%rsp) | movq %rbx, -40(%rsp) movq %r12, -24(%rsp) | .cfi_offset 3, -48 andl $15, %edi | movzbl 8(%rsp), %ebx movq %r13, -16(%rsp) | andl $63, %esi movq %r14, -8(%rsp) | movq %rbp, -32(%rsp) andl $63, %esi | movq %r12, -24(%rsp) movl 48(%rsp), %r11d | andl $63, %edx movzbl 8(%rsp), %r10d | .cfi_offset 6, -40 andl $63, %edx | .cfi_offset 12, -32 .cfi_offset 6, -40 | movl 16(%rsp), %ebp .cfi_offset 12, -32 | movl 32(%rsp), %r11d .cfi_offset 13, -24 | andl $63, %ecx .cfi_offset 14, -16 | movl 40(%rsp), %r10d movzbl 16(%rsp), %r14d | movq %r13, -16(%rsp) movzbl 24(%rsp), %r13d | andl $63, %r8d andl $63, %ecx | andl $63, %ebx movzbl 32(%rsp), %r12d | .cfi_offset 13, -24 movzbl 40(%rsp), %ebp | movl 48(%rsp), %r13d andl $63, %r8d | andl $63, %r9d movl %r11d, %eax | movq %rbx, %r12 movq %rbx, -40(%rsp) | movl 24(%rsp), %ebx .cfi_offset 3, -48 | andl $1, %ebp andl $63, %r9d | andl $1, %r11d andl $3, %eax | andl $15, %r10d andl $63, %r10d | movq %rdi, %rax xorl %ebx, %ebx | andl $15, %eax andl $1, %r14d | salq $4, %rsi andl $1, %r13d | salq $10, %rdx andl $1, %r12d | andl $1, %ebx andl $15, %ebp | salq $16, %rcx cmpl $2, %r11d | salq $22, %r8 cmovne %eax, %ebx | salq $28, %r9 andl $63, %esi | salq $34, %r12 movq %rdi, %rax | salq $40, %rbp salq $4, %rsi | salq $41, %rbx andl $15, %eax | salq $42, %r11 andl $63, %edx | salq $43, %r10 salq $10, %rdx | cmpl $2, %r13d orq %rsi, %rax | movq %r14, -8(%rsp) andl $63, %ecx | .cfi_offset 14, -16 salq $16, %rcx | movzbl 56(%rsp), %r14d orq %rdx, %rax | je .L45 andl $63, %r8d | andl $3, %r13d orq %rcx, %rax | salq $47, %r13 salq $22, %r8 |.L44: andl $63, %r9d | orq %rsi, %rax salq $28, %r9 | orq %rdx, %rax orq %r8, %rax | movq %r14, %rdx andl $63, %r10d | movq -8(%rsp), %r14 movq %r14, %rcx | orq %rcx, %rax salq $34, %r10 | andl $63, %edx orq %r9, %rax | orq %r8, %rax andl $1, %ecx | salq $49, %rdx movq %r13, %rdx | orq %r9, %rax orq %r10, %rax | orq %r12, %rax salq $40, %rcx | movq -24(%rsp), %r12 andl $1, %edx | orq %rbp, %rax movq -16(%rsp), %r13 | movq -32(%rsp), %rbp salq $41, %rdx | orq %rbx, %rax orq %rcx, %rax | movq -40(%rsp), %rbx movq %r12, %rcx | orq %r11, %rax orq %rdx, %rax | orq %r10, %rax andl $1, %ecx | orq %rdx, %rax movq %rbp, %rdx | orq %r13, %rax salq $42, %rcx | movq -16(%rsp), %r13 andl $15, %edx | ret movq -32(%rsp), %rbp | .p2align 4,,10 salq $43, %rdx | .p2align 3 orq %rcx, %rax |.L45: movq %rbx, %rcx | xorl %r13d, %r13d orq %rdx, %rax | jmp .L44 movzbl 56(%rsp), %edx | .cfi_endproc andl $3, %ecx | salq $47, %rcx | movq -40(%rsp), %rbx | movq -24(%rsp), %r12 | movq -8(%rsp), %r14 | andl $63, %edx | orq %rcx, %rax | salq $49, %rdx | orq %rdx, %rax | ret | .cfi_endproc | Without bothering to understand the details, they look pretty similar, with the new version being slightly shorter. But that may not mean anything. Change-Id: I31e84c9109ccd0c7282351b2e2802407a9b360b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Be consistent in GrayScale vs Grayscale namingAllan Sandfeld Jensen2014-08-061-3/+3
| | | | | | | | | The enum GrayScale was renamed Grayscale without similarly changing the helper class for the same enum. Change-Id: Ie1b34a68654f22a843ce4cfc2ddc1bf06af8dea1 Reviewed-by: Axel Rasmussen <axel.rasmussen1@gmail.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* QPixelFormat: have field 'unused' have the correct number of bitsMarc Mutz2014-08-051-1/+2
| | | | | | | 4+6*6+3*1+4+2+6+8 = 63, not 64, so make 'unused' have 9 bits width. Change-Id: I06e66074a09e93538fac01182c5a0d009d9b6583 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QPixelFormat: make data fields private instead of protectedMarc Mutz2014-08-051-1/+1
| | | | | | | The convenience subclasses use the QPixelFormat ctor, not the data fields directly. Change-Id: I011299837cfb3b7006bc8425848989e5739b6082 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Rename QPixelFormat enum value to avoid conflict with X.h.Axel Rasmussen2014-07-141-2/+2
| | | | | | | | | | This commit fixes a potential compile error where pixelformat.h would not compile if X.h from x11proto was included first, since X.h #define's GrayScale as an integer constant. Task-number: QTBUG-40087 Change-Id: I7208a204259c6d3a13b5d0cbc98a76bb54b8b494 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Introducing QPixelFormatJorgen Lind2014-04-231-0/+452
Its purpose in life will be to describe pixel formats [ChangeLog][QtGui] Added QPixelFormat class Change-Id: I74d8f974606520efb3935110ff3d6ddb5ea805a8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>