summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-22 13:18:50 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-22 13:18:50 (GMT)
commit71cc2f69171f5dd6d8ae094239230362fc8db081 (patch)
treed449ceb9fb5e387d746df51caaf832b04103b47a
parent07f131927faa09402589da7b4bfb516482f59e46 (diff)
parentc4bea746a3a94e8484b88a3a337e17591ce1d3c8 (diff)
downloadQt-71cc2f69171f5dd6d8ae094239230362fc8db081.zip
Qt-71cc2f69171f5dd6d8ae094239230362fc8db081.tar.gz
Qt-71cc2f69171f5dd6d8ae094239230362fc8db081.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Improve the conversion from indexted to RGB16 Avoid qMin() for each pixel when converting indexed colors in-place Premultiply the color table instead of each pixel for image conversion Switch the default value for configure's -separate-debug-info to "no". Docs: Additional HTML extraction marks for enumerations.
-rwxr-xr-xconfigure4
-rw-r--r--src/gui/image/qimage.cpp44
-rw-r--r--tools/qdoc3/htmlgenerator.cpp6
3 files changed, 40 insertions, 14 deletions
diff --git a/configure b/configure
index b92a3f7..ae23509 100755
--- a/configure
+++ b/configure
@@ -733,7 +733,7 @@ CFG_OPENSSL=auto
CFG_PTMALLOC=no
CFG_STL=auto
CFG_PRECOMPILE=auto
-CFG_SEPARATE_DEBUG_INFO=auto
+CFG_SEPARATE_DEBUG_INFO=no
CFG_SEPARATE_DEBUG_INFO_NOCOPY=no
CFG_REDUCE_EXPORTS=auto
CFG_MMX=auto
@@ -2307,7 +2307,7 @@ fi
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
echo
echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qt for Embedded Linux"
- echo "By default, Qt is built in release mode with separate debug information, so"
+ echo "Qt can be built in release mode with separate debug information, so"
echo "-debug-and-release is not necessary anymore"
echo
fi
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index e5930ac..713e765 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2343,8 +2343,15 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve
data->colortable.resize(256);
for (int i = 0; i < 256; ++i)
data->colortable[i] = qRgb(i, i, i);
+ } else {
+ for (int i = 0; i < data->colortable.size(); ++i)
+ data->colortable[i] = PREMUL(data->colortable.at(i));
+
+ // Fill the rest of the table in case src_data > colortable.size()
+ const int oldSize = data->colortable.size();
+ const QRgb lastColor = data->colortable.at(oldSize - 1);
+ data->colortable.insert(oldSize, 256 - oldSize, lastColor);
}
- const int tableSize = data->colortable.size() - 1;
for (int i = 0; i < data->height; ++i) {
src_data -= src_pad;
@@ -2352,11 +2359,11 @@ static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConve
for (int pixI = 0; pixI < width; ++pixI) {
--src_data;
--dest_data;
- const uint pixel = data->colortable[qMin<int>(tableSize, *src_data)];
- *dest_data = (quint32) PREMUL(pixel);
+ *dest_data = data->colortable.at(*src_data);
}
}
+ data->colortable = QVector<QRgb>();
data->format = QImage::Format_ARGB32_Premultiplied;
data->bytes_per_line = dst_bytes_per_line;
data->depth = depth;
@@ -2388,8 +2395,12 @@ static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversio
data->colortable.resize(256);
for (int i = 0; i < 256; ++i)
data->colortable[i] = qRgb(i, i, i);
+ } else {
+ // Fill the rest of the table in case src_data > colortable.size()
+ const int oldSize = data->colortable.size();
+ const QRgb lastColor = data->colortable.at(oldSize - 1);
+ data->colortable.insert(oldSize, 256 - oldSize, lastColor);
}
- const int tableSize = data->colortable.size() - 1;
for (int i = 0; i < data->height; ++i) {
src_data -= src_pad;
@@ -2397,10 +2408,11 @@ static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversio
for (int pixI = 0; pixI < width; ++pixI) {
--src_data;
--dest_data;
- *dest_data = (quint32) data->colortable[qMin<int>(tableSize, *src_data)];
+ *dest_data = (quint32) data->colortable.at(*src_data);
}
}
+ data->colortable = QVector<QRgb>();
data->format = QImage::Format_RGB32;
data->bytes_per_line = dst_bytes_per_line;
data->depth = depth;
@@ -2428,12 +2440,23 @@ static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConvers
const int width = data->width;
const int src_pad = data->bytes_per_line - width;
const int dest_pad = (dst_bytes_per_line >> 1) - width;
- if (data->colortable.size() == 0) {
- data->colortable.resize(256);
+
+ quint16 colorTableRGB16[256];
+ if (data->colortable.isEmpty()) {
for (int i = 0; i < 256; ++i)
- data->colortable[i] = qRgb(i, i, i);
+ colorTableRGB16[i] = qt_colorConvert<quint16, quint32>(qRgb(i, i, i), 0);
+ } else {
+ // 1) convert the existing colors to RGB16
+ const int tableSize = data->colortable.size();
+ for (int i = 0; i < tableSize; ++i)
+ colorTableRGB16[i] = qt_colorConvert<quint16, quint32>(data->colortable.at(i), 0);
+ data->colortable = QVector<QRgb>();
+
+ // 2) fill the rest of the table in case src_data > colortable.size()
+ const quint16 lastColor = colorTableRGB16[tableSize - 1];
+ for (int i = tableSize; i < 256; ++i)
+ colorTableRGB16[i] = lastColor;
}
- const int tableSize = data->colortable.size() - 1;
for (int i = 0; i < data->height; ++i) {
src_data -= src_pad;
@@ -2441,8 +2464,7 @@ static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConvers
for (int pixI = 0; pixI < width; ++pixI) {
--src_data;
--dest_data;
- const uint pixel = data->colortable[qMin<int>(tableSize, *src_data)];
- *dest_data = qt_colorConvert<quint16, quint32>(pixel, 0);
+ *dest_data = colorTableRGB16[*src_data];
}
}
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 9977df0..e840a7f 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -4415,8 +4415,8 @@ void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType
out() << "$$$" + func->name() + func->rawParameters().remove(' ');
}
} else if (node->type() == Node::Property) {
- const PropertyNode *prop = static_cast<const PropertyNode *>(node);
out() << "-prop";
+ const PropertyNode *prop = static_cast<const PropertyNode *>(node);
const NodeList &list = prop->functions();
foreach (const Node *propFuncNode, list) {
if (propFuncNode->type() == Node::Function) {
@@ -4424,6 +4424,10 @@ void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType
out() << "$$$" + func->name() + func->rawParameters().remove(' ');
}
}
+ } else if (node->type() == Node::Enum) {
+ const EnumNode *enumNode = static_cast<const EnumNode *>(node);
+ foreach (const EnumItem &item, enumNode->items())
+ out() << "$$$" + item.name();
}
} else if (markType == BriefMark) {
out() << "-brief";