mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Direct2D: Make protected members of Pimpl private/public as appropriate
This commit is contained in:
parent
170b463400
commit
0071f4741c
2 changed files with 28 additions and 27 deletions
|
|
@ -557,19 +557,6 @@ public:
|
|||
|
||||
struct Direct2DGraphicsContext::Pimpl : private DxgiAdapterListener
|
||||
{
|
||||
protected:
|
||||
Direct2DGraphicsContext& owner;
|
||||
SharedResourcePointer<DirectX> directX;
|
||||
SharedResourcePointer<Direct2DFactories> directWrite;
|
||||
|
||||
std::optional<Direct2DDeviceResources> deviceResources;
|
||||
|
||||
std::vector<std::unique_ptr<Direct2DGraphicsContext::SavedState>> savedClientStates;
|
||||
|
||||
virtual bool prepare();
|
||||
virtual void teardown();
|
||||
virtual bool checkPaintReady();
|
||||
|
||||
public:
|
||||
explicit Pimpl (Direct2DGraphicsContext& ownerIn);
|
||||
~Pimpl() override;
|
||||
|
|
@ -577,6 +564,15 @@ public:
|
|||
virtual SavedState* startFrame();
|
||||
virtual HRESULT finishFrame();
|
||||
|
||||
virtual bool prepare();
|
||||
virtual void teardown();
|
||||
virtual bool checkPaintReady();
|
||||
|
||||
virtual RectangleList<int> getPaintAreas() const = 0;
|
||||
virtual Rectangle<int> getFrameSize() const = 0;
|
||||
virtual ComSmartPtr<ID2D1DeviceContext1> getDeviceContext() const = 0;
|
||||
virtual ComSmartPtr<ID2D1Image> getDeviceContextTarget() const = 0;
|
||||
|
||||
SavedState* getCurrentSavedState() const;
|
||||
SavedState* pushFirstSavedState (Rectangle<int> initialClipRegion);
|
||||
|
||||
|
|
@ -585,30 +581,30 @@ public:
|
|||
|
||||
void popAllSavedStates();
|
||||
|
||||
virtual RectangleList<int> getPaintAreas() const = 0;
|
||||
virtual Rectangle<int> getFrameSize() const = 0;
|
||||
virtual ComSmartPtr<ID2D1DeviceContext1> getDeviceContext() const = 0;
|
||||
virtual ComSmartPtr<ID2D1Image> getDeviceContextTarget() const = 0;
|
||||
|
||||
void setDeviceContextTransform (AffineTransform transform);
|
||||
void resetDeviceContextTransform();
|
||||
|
||||
auto getDirect2DFactory()
|
||||
DxgiAdapter::Ptr getDefaultAdapter() const
|
||||
{
|
||||
return directX->adapters.getDefaultAdapter();
|
||||
}
|
||||
|
||||
auto getDirect2DFactory() const
|
||||
{
|
||||
return directX->getD2DFactory();
|
||||
}
|
||||
|
||||
auto getDirectWriteFactory()
|
||||
auto getDirectWriteFactory() const
|
||||
{
|
||||
return directWrite->getDWriteFactory();
|
||||
}
|
||||
|
||||
auto getDirectWriteFactory4()
|
||||
auto getDirectWriteFactory4() const
|
||||
{
|
||||
return directWrite->getDWriteFactory4();
|
||||
}
|
||||
|
||||
auto& getFontCollection()
|
||||
auto& getFontCollection() const
|
||||
{
|
||||
return directWrite->getFonts();
|
||||
}
|
||||
|
|
@ -662,6 +658,14 @@ private:
|
|||
void adapterCreated (DxgiAdapter::Ptr newAdapter) override;
|
||||
void adapterRemoved (DxgiAdapter::Ptr expiringAdapter) override;
|
||||
|
||||
Direct2DGraphicsContext& owner;
|
||||
SharedResourcePointer<DirectX> directX;
|
||||
SharedResourcePointer<Direct2DFactories> directWrite;
|
||||
|
||||
std::optional<Direct2DDeviceResources> deviceResources;
|
||||
|
||||
std::vector<std::unique_ptr<Direct2DGraphicsContext::SavedState>> savedClientStates;
|
||||
|
||||
#if JUCE_DIRECT2D_METRICS
|
||||
int64 paintStartTicks = 0;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ private:
|
|||
|
||||
bool prepare() override
|
||||
{
|
||||
const auto adapter = directX->adapters.getDefaultAdapter();
|
||||
const auto adapter = getDefaultAdapter();
|
||||
|
||||
if (adapter == nullptr)
|
||||
return false;
|
||||
|
|
@ -163,10 +163,7 @@ private:
|
|||
if (deviceContext == nullptr)
|
||||
return false;
|
||||
|
||||
if (! deviceResources.has_value())
|
||||
deviceResources = Direct2DDeviceResources::create (deviceContext);
|
||||
|
||||
if (! deviceResources.has_value())
|
||||
if (! Pimpl::prepare())
|
||||
return false;
|
||||
|
||||
if (! hwnd || getClientRect().isEmpty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue