| 271 | // image |
| 272 | struct TestImage : public TestBase { |
| 273 | virtual void run( fli::cairo::Context &ctx ) { |
| 274 | Surface beyonceSurface( loadImage( app::App::loadResource( "Beyonce.jpg", RES_BEYONCE_JPG, "JPG" ) ), SurfaceConstraintsCairo() ); |
| 275 | fli::shared_ptr<fli::cairo::SurfaceImage> image( new cairo::SurfaceImage( beyonceSurface ) ); |
| 276 | |
| 277 | |
| 278 | ctx.translate( 128.0, 128.0 ); |
| 279 | ctx.rotate( 45 * M_PI / 180 ); |
| 280 | ctx.scale( 256.0 / image->getWidth(), 256.0 / image->getHeight() ); |
| 281 | ctx.translate( -0.5 * image->getWidth(), -0.5 * image->getHeight() ); |
| 282 | |
| 283 | ctx.setSourceSurface( *image, 0, 0 ); |
| 284 | ctx.paint(); |
| 285 | } |
| 286 | }; |
| 287 | |
| 288 | // image pattern |
nothing calls this directly
no test coverage detected