Changeset 561 for trunk/src/plugins/imageformats/gif
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/plugins/imageformats/gif/gif.pro
r2 r561 9 9 target.path += $$[QT_INSTALL_PLUGINS]/imageformats 10 10 INSTALLS += target 11 12 symbian:TARGET.UID3=0x2001E61A -
trunk/src/plugins/imageformats/gif/main.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the plugins of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/plugins/imageformats/gif/qgifhandler.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the plugins of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 54 54 55 55 #define Q_TRANSPARENT 0x00ffffff 56 57 // avoid going through QImage::scanLine() which calls detach 58 #define FAST_SCAN_LINE(bits, bpl, y) (bits + (y) * bpl) 59 56 60 57 61 /* … … 136 140 bool out_of_bounds; 137 141 bool digress; 138 void nextY( QImage *image);142 void nextY(unsigned char *bits, int bpl); 139 143 void disposePrevious(QImage *image); 140 144 }; … … 233 237 // CompuServe Incorporated." 234 238 239 image->detach(); 240 int bpl = image->bytesPerLine(); 241 unsigned char *bits = image->bits(); 242 235 243 #define LM(l, m) (((m)<<8)|l) 236 244 digress = false; 237 int initial = length;245 const int initial = length; 238 246 while (!digress && length) { 239 247 length--; … … 334 342 335 343 QImage::Format format = trans_index >= 0 ? QImage::Format_ARGB32 : QImage::Format_RGB32; 336 if (image->isNull() || (image->size() != QSize(swidth, sheight)) || image->format() != format) {344 if (image->isNull()) { 337 345 (*image) = QImage(swidth, sheight, format); 338 memset(image->bits(), 0, image->numBytes()); 346 bpl = image->bytesPerLine(); 347 bits = image->bits(); 348 memset(bits, 0, image->byteCount()); 339 349 340 350 // ### size of the upcoming frame, should rather … … 394 404 qMax(backingstore.height(), h), 395 405 QImage::Format_RGB32); 396 memset( image->bits(), 0, image->numBytes());406 memset(bits, 0, image->byteCount()); 397 407 } 408 const int dest_bpl = backingstore.bytesPerLine(); 409 unsigned char *dest_data = backingstore.bits(); 398 410 for (int ln=0; ln<h; ln++) { 399 memcpy( backingstore.scanLine(ln),400 image->scanLine(t+ln)+l, w*sizeof(QRgb));411 memcpy(FAST_SCAN_LINE(dest_data, dest_bpl, ln), 412 FAST_SCAN_LINE(bits, bpl, t+ln) + l, w*sizeof(QRgb)); 401 413 } 402 414 } … … 471 483 firstcode=oldcode=code; 472 484 if (!out_of_bounds && image->height() > y && firstcode!=trans_index) 473 ((QRgb*) image->scanLine(y))[x] = color(firstcode);485 ((QRgb*)FAST_SCAN_LINE(bits, bpl, y))[x] = color(firstcode); 474 486 x++; 475 487 if (x>=swidth) out_of_bounds = true; … … 478 490 x=left; 479 491 out_of_bounds = left>=swidth || y>=sheight; 480 nextY( image);492 nextY(bits, bpl); 481 493 } 482 494 } else { … … 516 528 QRgb *line = 0; 517 529 if (!out_of_bounds && h > y) 518 line = (QRgb*) image->scanLine(y);530 line = (QRgb*)FAST_SCAN_LINE(bits, bpl, y); 519 531 while (sp>stack) { 520 532 const uchar index = *(--sp); … … 530 542 x=left; 531 543 out_of_bounds = left>=swidth || y>=sheight; 532 nextY( image);544 nextY(bits, bpl); 533 545 if (!out_of_bounds && h > y) 534 line = (QRgb*) image->scanLine(y);546 line = (QRgb*)FAST_SCAN_LINE(bits, bpl, y); 535 547 } 536 548 } … … 645 657 } 646 658 647 void QGIFFormat::nextY( QImage *image)659 void QGIFFormat::nextY(unsigned char *bits, int bpl) 648 660 { 649 661 int my; … … 661 673 if (trans_index < 0) { 662 674 for (i=1; i<=my; i++) { 663 memcpy( image->scanLine(y+i)+left*sizeof(QRgb), image->scanLine(y)+left*sizeof(QRgb),675 memcpy(FAST_SCAN_LINE(bits, bpl, y+i)+left*sizeof(QRgb), FAST_SCAN_LINE(bits, bpl, y)+left*sizeof(QRgb), 664 676 (right-left+1)*sizeof(QRgb)); 665 677 } … … 690 702 if (trans_index < 0) { 691 703 for (i=1; i<=my; i++) { 692 memcpy( image->scanLine(y+i)+left*sizeof(QRgb), image->scanLine(y)+left*sizeof(QRgb),704 memcpy(FAST_SCAN_LINE(bits, bpl, y+i)+left*sizeof(QRgb), FAST_SCAN_LINE(bits, bpl, y)+left*sizeof(QRgb), 693 705 (right-left+1)*sizeof(QRgb)); 694 706 } … … 714 726 if (trans_index < 0) { 715 727 for (i=1; i<=my; i++) { 716 memcpy( image->scanLine(y+i)+left*sizeof(QRgb), image->scanLine(y)+left*sizeof(QRgb),728 memcpy(FAST_SCAN_LINE(bits, bpl, y+i)+left*sizeof(QRgb), FAST_SCAN_LINE(bits, bpl, y)+left*sizeof(QRgb), 717 729 (right-left+1)*sizeof(QRgb)); 718 730 } -
trunk/src/plugins/imageformats/gif/qgifhandler.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the plugins of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 **
Note:
See TracChangeset
for help on using the changeset viewer.