MCPcopy Create free account
hub / github.com/cinder/Cinder / run

Method run

test/cairoTest/cairoTest.cpp:104–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102// clip image
103struct 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

Callers

nothing calls this directly

Calls 11

loadImageFunction · 0.85
loadResourceFunction · 0.85
clipMethod · 0.80
newPathMethod · 0.80
setSourceSurfaceMethod · 0.80
paintMethod · 0.80
arcMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
scaleMethod · 0.45

Tested by

no test coverage detected