| 102 | // clip image |
| 103 | struct TestClipImage : public TestBase { |
| 104 | virtual void run( fli::cairo::Context &ctx ) { |
| 105 | int w, h; |
| 106 | |
| 107 | ctx.arc( 128.0, 128.0, 76.8, 0, 2 * M_PI ); |
| 108 | ctx.clip(); |
| 109 | ctx.newPath(); // path not consumed by clip() |
| 110 | |
| 111 | // fli::shared_ptr<fli::cairo::SurfaceImage> image( fli::cairo::SurfaceImage::createFromPng( "/Users/andrewfb/Code/dt/libdt_2.0/test/fullCairoTest/data/romedalen.png" ) ); |
| 112 | Surface beyonceSurface( loadImage( app::App::loadResource( "romedalen.png", RES_ROMEDALEN_PNG, "PNG" ) ), SurfaceConstraintsCairo() ); |
| 113 | fli::shared_ptr<fli::cairo::SurfaceImage> image( new cairo::SurfaceImage( beyonceSurface ) ); |
| 114 | w = image->getWidth(); |
| 115 | h = image->getHeight(); |
| 116 | |
| 117 | ctx.scale( 256.0 / w, 256.0 / h ); |
| 118 | |
| 119 | ctx.setSourceSurface( *image, 0, 0 ); |
| 120 | ctx.paint(); |
| 121 | } |
| 122 | }; |
| 123 | |
| 124 | // curve rectangle |
nothing calls this directly
no test coverage detected