mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-09-22 13:01:05 +03:00
graphics: migrate drawables to shared ownership
- introduce DrawablePtr and per-consumer createInstance() semantics
- add TextureDrawable wrappers backed by shared TexturePtr handles
- migrate regions, sprites, nine-patches, state lists, skins, groups, gradients,
UI widgets, tools, modules, ecode, and eeiv to shared drawable ownership
- remove ownIt flags, manual drawable deletion, and unload-based lifetime handling
- replace drawable callback IDs with RAII change connections
- move Variant drawable storage outside its scalar union
- split UIIcon source lookup from explicit drawable instance creation
- retain icon instances used by rendering loops instead of cloning per frame
- avoid shared source mutation in texture-region consumers
- use drawable type tags instead of RTTI casts
- fix nearest-size UIIcon lookup
- document the drawable source/instance contract and add ownership tests
This commit is contained in:
@@ -1303,7 +1303,7 @@ bool GitPlugin::onCreateContextMenu( UICodeEditor*, UIPopUpMenu* menu, const Vec
|
||||
const std::string& icon = "" ) {
|
||||
subMenu
|
||||
->add( i18n( txtKey, txtVal ),
|
||||
!icon.empty() ? findIcon( icon )->getSize( PixelDensity::dpToPxI( 12 ) )
|
||||
!icon.empty() ? findIcon( icon )->createDrawable( PixelDensity::dpToPxI( 12 ) )
|
||||
: nullptr,
|
||||
KeyBindings::keybindFormat( mKeyBindings[txtKey] ) )
|
||||
->setId( txtKey );
|
||||
@@ -1314,7 +1314,7 @@ bool GitPlugin::onCreateContextMenu( UICodeEditor*, UIPopUpMenu* menu, const Vec
|
||||
menu->addSubMenu( i18n( "git", "Git" ),
|
||||
mManager->getUISceneNode()
|
||||
->findIcon( "source-control" )
|
||||
->getSize( PixelDensity::dpToPxI( 12 ) ),
|
||||
->createDrawable( PixelDensity::dpToPxI( 12 ) ),
|
||||
subMenu );
|
||||
|
||||
return false;
|
||||
@@ -1453,7 +1453,7 @@ void GitPlugin::buildSidePanelTab() {
|
||||
return;
|
||||
UIIcon* icon = findIcon( "source-control" );
|
||||
mTab = mSidePanel->add( i18n( "source_control", "Source Control" ), mTabContents,
|
||||
icon ? icon->getSize( PixelDensity::dpToPx( 12 ) ) : nullptr );
|
||||
icon ? icon->createDrawable( PixelDensity::dpToPx( 12 ) ) : nullptr );
|
||||
mTab->setId( "source_control_tab" );
|
||||
mTab->setTextAsFallback( true );
|
||||
return;
|
||||
@@ -1526,7 +1526,7 @@ void GitPlugin::buildSidePanelTab() {
|
||||
String::format( STYLE, color, color ), nullptr, String::hash( "git_plugin_style" ) );
|
||||
|
||||
mTab = mSidePanel->add( i18n( "source_control", "Source Control" ), mTabContents,
|
||||
icon ? icon->getSize( PixelDensity::dpToPx( 12 ) ) : nullptr );
|
||||
icon ? icon->createDrawable( PixelDensity::dpToPx( 12 ) ) : nullptr );
|
||||
mTab->setId( "source_control_tab" );
|
||||
mTab->setTextAsFallback( true );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user