mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Smart Pointers: Add a new enum for indicating if a smart point should increment a reference count or not
This commit is contained in:
parent
8931d45fe9
commit
e68627c9ed
68 changed files with 243 additions and 160 deletions
|
|
@ -216,8 +216,8 @@ private:
|
|||
explicit OwningLayer (const D2D1_LAYER_PARAMETERS1& p) : params (p) {}
|
||||
|
||||
D2D1_LAYER_PARAMETERS1 params;
|
||||
ComSmartPtr<ID2D1Geometry> geometry = params.geometricMask != nullptr ? addComSmartPtrOwner (params.geometricMask) : nullptr;
|
||||
ComSmartPtr<ID2D1Brush> brush = params.opacityBrush != nullptr ? addComSmartPtrOwner (params.opacityBrush) : nullptr;
|
||||
ComSmartPtr<ID2D1Geometry> geometry { params.geometricMask, IncrementRef::yes };
|
||||
ComSmartPtr<ID2D1Brush> brush { params.opacityBrush, IncrementRef::yes };
|
||||
};
|
||||
|
||||
struct Layer
|
||||
|
|
|
|||
|
|
@ -150,7 +150,8 @@ public:
|
|||
if (FAILED (factory->GetSystemFontFallback (fallback.resetAndGetPointerAddress())) || fallback == nullptr)
|
||||
return {};
|
||||
|
||||
auto analysisSource = becomeComSmartPtrOwner (new AnalysisSource (c, language));
|
||||
ComSmartPtr analysisSource { new AnalysisSource (c, language), IncrementRef::no };
|
||||
|
||||
const auto originalName = getLocalisedFamilyName (*dwFont);
|
||||
|
||||
const auto mapped = factories->getFonts().mapCharacters (fallback,
|
||||
|
|
|
|||
|
|
@ -1067,7 +1067,8 @@ DirectWriteCustomFontCollectionLoader::~DirectWriteCustomFontCollectionLoader()
|
|||
|
||||
Uuid DirectWriteCustomFontCollectionLoader::addRawFontData (Span<const std::byte> blob)
|
||||
{
|
||||
const auto loader = becomeComSmartPtrOwner (new MemoryFontFileLoader { { blob.data(), blob.size() } });
|
||||
ComSmartPtr loader { new MemoryFontFileLoader { { blob.data(), blob.size() } },
|
||||
IncrementRef::no };
|
||||
|
||||
factory.RegisterFontFileLoader (loader);
|
||||
|
||||
|
|
@ -1148,7 +1149,9 @@ Direct2DFactories::Direct2DFactories()
|
|||
}) },
|
||||
collectionLoader { std::invoke ([&]() -> ComSmartPtr<DirectWriteCustomFontCollectionLoader>
|
||||
{
|
||||
auto result = becomeComSmartPtrOwner (new DirectWriteCustomFontCollectionLoader { *directWriteFactory });
|
||||
ComSmartPtr result { new DirectWriteCustomFontCollectionLoader { *directWriteFactory },
|
||||
IncrementRef::no };
|
||||
|
||||
directWriteFactory->RegisterFontCollectionLoader (result);
|
||||
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue