Changeset 53611 in webkit
- Timestamp:
- Jan 21, 2010 12:25:21 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53610 r53611 1 2010-01-21 No'am Rosenthal <noam.rosenthal@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] Adding QPixmap/QImage support for the Qt hybrid layer 6 Allows accesing QPixmap and QImage based arguments from Qt signals, 7 slots and properties 8 This is done by an intermediate object that can be turned into 9 web-based objects by calling either toHTMLImageElement() or 10 toDataURL() 11 https://bugs.webkit.org/show_bug.cgi?id=32461 12 13 Tests are in WebKit/qt/tests/hybridPixmap 14 15 * WebCore.pro: 16 * bridge/qt/qt_pixmapruntime.cpp: Added. 17 (JSC::Bindings::QtPixmapWidthField::name): "width" 18 (JSC::Bindings::QtPixmapWidthField::valueFromInstance): width of 19 pixmap 20 (JSC::Bindings::QtPixmapWidthField::setValueToInstance): nothing 21 (JSC::Bindings::QtPixmapHeightField::name): "height" 22 (JSC::Bindings::QtPixmapHeightField::valueFromInstance): height of 23 pixmap 24 (JSC::Bindings::QtPixmapHeightField::setValueToInstance): nothing 25 (JSC::Bindings::QtPixmapRuntimeMethod::numParameters): 0 26 (JSC::Bindings::QtPixmapCreateElementMethod::name): toHTMLImageElement 27 (JSC::Bindings::QtPixmapCreateElementMethod::invoke): creates an HTML 28 element from the QPixmap 29 (JSC::Bindings::QtPixmapToDataUrlMethod::name): "toDataURL" 30 (JSC::Bindings::QtPixmapToDataUrlMethod::invoke): encodes the image to 31 a base64 data url 32 (JSC::Bindings::QtPixmapToStringMethod::name): "toString" 33 (JSC::Bindings::QtPixmapToStringMethod::invoke): [Qt Native Pixmap 34 w,h] 35 36 (JSC::Bindings::QtPixmapRuntimeObjectImp::createStructure): 37 runtime-object broilerplate 38 (JSC::Bindings::QtPixmapRuntimeObjectImp::classInfo): ditto 39 (JSC::Bindings::QtPixmapRuntimeObjectImp::QtPixmapRuntimeObjectImp): 40 ditto 41 (JSC::Bindings::): ditto 42 (JSC::Bindings::QtPixmapClass::QtPixmapClass): class for the 43 intermediate pixmap-holder 44 (JSC::Bindings::QtPixmapInstance::getClass): ditto 45 (JSC::Bindings::QtPixmapInstance::invokeMethod): ditto 46 (JSC::Bindings::QtPixmapClass::methodsNamed): toHTMLImageElement, 47 toDataURL 48 (JSC::Bindings::QtPixmapClass::fieldNamed): width, height 49 (JSC::Bindings::QtPixmapInstance::getPropertyNames): 50 toHTMLImageElement, toDataURL, width, height 51 (JSC::Bindings::QtPixmapInstance::defaultValue): nothing 52 (JSC::Bindings::QtPixmapInstance::valueOf): toString 53 (JSC::Bindings::data): holds a QVariant of type QImage/QPixmap 54 (JSC::Bindings::QtPixmapInstance::width): width of the image/pixmap 55 (JSC::Bindings::QtPixmapInstance::height): height of the image/pixmap 56 (JSC::Bindings::QtPixmapInstance::toPixmap): converts to a QPixmap 57 (JSC::Bindings::QtPixmapInstance::toImage): converts to a QImage 58 (JSC::Bindings::QtPixmapInstance::variantFromObject): makes sure this 59 is the right type of object, and creates a QVariant 60 (JSC::Bindings::QtPixmapInstance::createRuntimeObject): creates a new 61 intermediate pixmap holder from a QVariant 62 (JSC::Bindings::QtPixmapInstance::canHandle): returns true if a 63 QPixmap/QImage is required 64 * bridge/qt/qt_pixmapruntime.h: Added. 65 * bridge/qt/qt_runtime.cpp: hooks for the bridge 66 (JSC::Bindings::convertValueToQVariant): handle QPixmap/QImage if the 67 object is the intermediate pixmap holder or an HTMLImageElement 68 (JSC::Bindings::convertQVariantToValue): creates the intermediate 69 object from a QVariant of type QImage/QPixmap 70 1 71 2010-01-21 Luiz Agostini <luiz.agostini@openbossa.org> 2 72 -
trunk/WebCore/WebCore.pro
r53574 r53611 1043 1043 bridge/qt/qt_instance.h \ 1044 1044 bridge/qt/qt_runtime.h \ 1045 bridge/qt/qt_pixmapruntime.h \ 1045 1046 bridge/runtime_array.h \ 1046 1047 bridge/runtime_method.h \ … … 1944 1945 bridge/qt/qt_class.cpp \ 1945 1946 bridge/qt/qt_instance.cpp \ 1947 bridge/qt/qt_pixmapruntime.cpp \ 1946 1948 bridge/qt/qt_runtime.cpp \ 1947 1949 page/qt/DragControllerQt.cpp \ -
trunk/WebCore/bridge/qt/qt_runtime.cpp
r53541 r53611 44 44 #include "qstringlist.h" 45 45 #include "qt_instance.h" 46 #include "qt_pixmapruntime.h" 46 47 #include "qvarlengtharray.h" 47 48 #include <JSFunction.h> … … 720 721 } 721 722 break; 723 } else if (QtPixmapInstance::canHandle(static_cast<QMetaType::Type>(hint))) { 724 ret = QtPixmapInstance::variantFromObject(object, static_cast<QMetaType::Type>(hint)); 722 725 } else if (hint == (QMetaType::Type) qMetaTypeId<QVariant>()) { 723 726 if (value.isUndefinedOrNull()) { … … 848 851 return QtInstance::getQtInstance(obj, root, QScriptEngine::QtOwnership)->createRuntimeObject(exec); 849 852 } 853 854 if (QtPixmapInstance::canHandle(static_cast<QMetaType::Type>(variant.type()))) 855 return QtPixmapInstance::createRuntimeObject(exec, root, variant); 850 856 851 857 if (type == QMetaType::QVariantMap) { -
trunk/WebKit/qt/ChangeLog
r53610 r53611 1 2010-01-21 No'am Rosenthal <noam.rosenthal@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] Adding QPixmap/QImage support for the Qt hybrid layer 6 https://bugs.webkit.org/show_bug.cgi?id=32461 7 8 * tests/hybridPixmap: Added. 9 * tests/hybridPixmap/hybridPixmap.pro: Added. 10 * tests/hybridPixmap/resources.qrc: Added. 11 * tests/hybridPixmap/test.html: Added. 12 * tests/hybridPixmap/tst_hybridPixmap.cpp: Added. 13 (tst_hybridPixmap::tst_hybridPixmap): tests most of the use cases for 14 hybrid pixmap/image manipulation 15 (tst_hybridPixmap::init): QTestLib initialization 16 (tst_hybridPixmap::cleanup): QTestLib cleanup 17 (tst_hybridPixmap::hybridPixmap): run the html file 18 * tests/hybridPixmap/widget.cpp: Added. 19 (Widget::Widget): 20 (Widget::refreshJS): 21 (Widget::start): 22 (Widget::completeTest): 23 (Widget::setPixmap): 24 (Widget::pixmap): 25 (Widget::setImage): 26 (Widget::image): 27 (Widget::~Widget): 28 (Widget::changeEvent): 29 (Widget::compare): 30 (Widget::imageSlot): 31 (Widget::pixmapSlot): 32 (Widget::randomSlot): 33 * tests/hybridPixmap/widget.h: Added. 34 * tests/hybridPixmap/widget.ui: Added. 35 * tests/tests.pro: 36 1 37 2010-01-21 Luiz Agostini <luiz.agostini@openbossa.org> 2 38 -
trunk/WebKit/qt/tests/tests.pro
r52444 r53611 1 1 2 2 TEMPLATE = subdirs 3 SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory qwebinspector 3 SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory qwebinspector hybridPixmap 4 4 greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting benchmarks/loading
Note: See TracChangeset
for help on using the changeset viewer.