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

Function renderCairoToTexture

samples/_svg/SimpleViewer/src/SimpleViewerApp.cpp:43–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43gl::TextureRef renderCairoToTexture( svg::DocRef doc )
44{
45 cairo::SurfaceImage srf( 640, 480, true );
46 if( doc->getWidth() && doc->getHeight() )
47 srf = cairo::SurfaceImage( doc->getWidth(), doc->getHeight(), true );
48 else
49 srf = cairo::SurfaceImage( 640, 480, true );
50
51 cairo::Context ctx( srf );
52 ctx.render( *doc );
53 ctx.flush();
54
55 return gl::Texture::create( srf.getSurface() );
56}
57
58void SimpleViewerApp::load( fs::path path )
59{

Callers 1

loadMethod · 0.85

Calls 7

SurfaceImageClass · 0.85
createFunction · 0.50
getWidthMethod · 0.45
getHeightMethod · 0.45
renderMethod · 0.45
flushMethod · 0.45
getSurfaceMethod · 0.45

Tested by

no test coverage detected