MCPcopy Create free account
hub / github.com/carbonengine/trinity / DrawToTexture

Method DrawToTexture

trinity/Font/Tr2FontMeasurer.cpp:515–541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513
514
515void Tr2FontMeasurer::DrawToTexture( TriTextureRes* texture )
516{
517 CCP_STATS_ZONE( __FUNCTION__ );
518
519 USE_MAIN_THREAD_RENDER_CONTEXT();
520
521 if( !texture )
522 {
523 return;
524 }
525
526 Tr2TextureAL* const tex = texture->GetTexture();
527 if( !tex || !tex->IsValid() || GetBytesPerPixel( tex->GetFormat() ) != 4 )
528 {
529 return;
530 }
531
532 void* pBits;
533 uint32_t Pitch;
534 CR_RETURN( tex->MapForWriting( Tr2TextureSubresource( 0 ), pBits, Pitch, renderContext ) );
535 ON_BLOCK_EXIT( [&] { tex->UnmapForWriting( renderContext ); } );
536
537 DrawToBuffer( texture->GetWidth(),
538 texture->GetHeight(),
539 pBits,
540 Pitch );
541}
542
543void Tr2FontMeasurer::DrawToHostBitmap( Tr2HostBitmap* hostBitmap )
544{

Callers

nothing calls this directly

Calls 8

GetTextureMethod · 0.45
IsValidMethod · 0.45
GetFormatMethod · 0.45
MapForWritingMethod · 0.45
UnmapForWritingMethod · 0.45
GetWidthMethod · 0.45
GetHeightMethod · 0.45

Tested by

no test coverage detected