/****************************************************************************** * QSkinny - Copyright (C) The authors * SPDX-License-Identifier: BSD-3-Clause *****************************************************************************/ #include "Image.h" #include #include #include #include #include #include #include #include namespace { class ImageProvider : public QskGraphicImageProvider { public: ImageProvider( const QString& id ) : QskGraphicImageProvider( id, type() ) { } private: static ImageType type() { const auto backend = QQuickWindow::sceneGraphBackend(); return ( backend == "software" ) ? Image : Texture; } }; } int main( int argc, char* argv[] ) { #ifdef ITEM_STATISTICS QskObjectCounter counter( true ); #endif const char providerId[] = "shapes"; QskQml::registerTypes(); qmlRegisterType< Image >( "Images", 1, 0, "Image" ); Qsk::addGraphicProvider( providerId, new SkinnyShapeProvider() ); QGuiApplication app( argc, argv ); SkinnyShortcut::enable( SkinnyShortcut::Quit | SkinnyShortcut::DebugShortcuts ); QQmlApplicationEngine engine( QUrl( "qrc:/qml/images.qml" ) ); // image provider that falls back to the graphic provider above engine.addImageProvider( providerId, new ImageProvider( providerId ) ); return app.exec(); }