diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-02-24 13:25:29 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-04-01 13:53:29 (GMT) |
commit | 792dff08e362b050463ecbd976617acb0ed1a105 (patch) | |
tree | 501e64c6f11c2c92204abfdeb052172577fd3232 /src/gui/painting | |
parent | 3879372da9164d7bc6c00b4a00f2dfc03ce7e33e (diff) | |
download | Qt-792dff08e362b050463ecbd976617acb0ed1a105.zip Qt-792dff08e362b050463ecbd976617acb0ed1a105.tar.gz Qt-792dff08e362b050463ecbd976617acb0ed1a105.tar.bz2 |
Ensure that fetchPixel is inlined in RGB32 cases in fetchTransformedBilinear.
Reviewed-by: Samuel
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 484d87f..f8c5475 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -766,12 +766,12 @@ const uint * QT_FASTCALL fetchTransformed(uint *buffer, const Operator *, const return buffer; } -template<TextureBlendType blendType> /* BlendTransformedBilinear or BlendTransformedBilinearTiled */ +template<TextureBlendType blendType, QImage::Format format> /* blendType = BlendTransformedBilinear or BlendTransformedBilinearTiled */ Q_STATIC_TEMPLATE_FUNCTION const uint * QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *, const QSpanData *data, int y, int x, int length) { - FetchPixelProc fetch = fetchPixelProc[data->texture.format]; + FetchPixelProc fetch = (format != QImage::Format_Invalid) ? FetchPixelProc(qt_fetchPixel<format>) : fetchPixelProc[data->texture.format]; int image_width = data->texture.width; int image_height = data->texture.height; @@ -1026,39 +1026,39 @@ static const SourceFetchProc sourceFetch[NBlendTypes][QImage::NImageFormats] = { }, { 0, // Bilinear - fetchTransformedBilinear<BlendTransformedBilinear>, // Mono - fetchTransformedBilinear<BlendTransformedBilinear>, // MonoLsb - fetchTransformedBilinear<BlendTransformedBilinear>, // Indexed8 - fetchTransformedBilinear<BlendTransformedBilinear>, // RGB32 - fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB32 - fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB32_Premultiplied - fetchTransformedBilinear<BlendTransformedBilinear>, // RGB16 - fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB8565_Premultiplied - fetchTransformedBilinear<BlendTransformedBilinear>, // RGB666 - fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB6666_Premultiplied - fetchTransformedBilinear<BlendTransformedBilinear>, // RGB555 - fetchTransformedBilinear<BlendTransformedBilinear>, // ARGB8555_Premultiplied - fetchTransformedBilinear<BlendTransformedBilinear>, // RGB888 - fetchTransformedBilinear<BlendTransformedBilinear>, // RGB444 - fetchTransformedBilinear<BlendTransformedBilinear> // ARGB4444_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // Mono + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // MonoLsb + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // Indexed8 + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_ARGB32_Premultiplied>, // RGB32 + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_ARGB32>, // ARGB32 + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_ARGB32_Premultiplied>, // ARGB32_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // RGB16 + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // ARGB8565_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // RGB666 + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // ARGB6666_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // RGB555 + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // ARGB8555_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // RGB888 + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid>, // RGB444 + fetchTransformedBilinear<BlendTransformedBilinear, QImage::Format_Invalid> // ARGB4444_Premultiplied }, { 0, // BilinearTiled - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // Mono - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // MonoLsb - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // Indexed8 - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB32 - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB32 - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB32_Premultiplied - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB16 - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB8565_Premultiplied - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB666 - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB6666_Premultiplied - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB555 - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // ARGB8555_Premultiplied - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB888 - fetchTransformedBilinear<BlendTransformedBilinearTiled>, // RGB444 - fetchTransformedBilinear<BlendTransformedBilinearTiled> // ARGB4444_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // Mono + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // MonoLsb + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // Indexed8 + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_ARGB32_Premultiplied>, // RGB32 + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_ARGB32>, // ARGB32 + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_ARGB32_Premultiplied>, // ARGB32_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // RGB16 + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // ARGB8565_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // RGB666 + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // ARGB6666_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // RGB555 + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // ARGB8555_Premultiplied + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // RGB888 + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid>, // RGB444 + fetchTransformedBilinear<BlendTransformedBilinearTiled, QImage::Format_Invalid> // ARGB4444_Premultiplied }, }; |