mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Gfx: Move WIC files to Util
This commit is contained in:
parent
3827353c08
commit
ad9149b143
@ -19,7 +19,7 @@
|
|||||||
#include "CanvasD2D.h"
|
#include "CanvasD2D.h"
|
||||||
#include "TextFormatD2D.h"
|
#include "TextFormatD2D.h"
|
||||||
#include "Util/DWriteFontCollectionLoader.h"
|
#include "Util/DWriteFontCollectionLoader.h"
|
||||||
#include "WICBitmapLockGDIP.h"
|
#include "Util/WICBitmapLockGDIP.h"
|
||||||
#include "../../Library/Litestep.h"
|
#include "../../Library/Litestep.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
@ -411,7 +411,7 @@ void CanvasD2D::DrawBitmap(Gdiplus::Bitmap* bitmap, const Gdiplus::Rect& dstRect
|
|||||||
// The D2D DrawBitmap seems to perform exactly like Gdiplus::Graphics::DrawImage since we are
|
// The D2D DrawBitmap seems to perform exactly like Gdiplus::Graphics::DrawImage since we are
|
||||||
// not using a hardware accelerated render target. Nevertheless, we will use it to avoid
|
// not using a hardware accelerated render target. Nevertheless, we will use it to avoid
|
||||||
// the EndDraw() call needed for GDI+ drawing.
|
// the EndDraw() call needed for GDI+ drawing.
|
||||||
WICBitmapLockGDIP* bitmapLock = new WICBitmapLockGDIP();
|
Util::WICBitmapLockGDIP* bitmapLock = new Util::WICBitmapLockGDIP();
|
||||||
Gdiplus::Status status = bitmap->LockBits(
|
Gdiplus::Status status = bitmap->LockBits(
|
||||||
&srcRect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, bitmapLock->GetBitmapData());
|
&srcRect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, bitmapLock->GetBitmapData());
|
||||||
if (status == Gdiplus::Ok)
|
if (status == Gdiplus::Ok)
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "Canvas.h"
|
#include "Canvas.h"
|
||||||
#include "FontCollectionD2D.h"
|
#include "FontCollectionD2D.h"
|
||||||
#include "TextFormatD2D.h"
|
#include "TextFormatD2D.h"
|
||||||
#include "WICBitmapDIB.h"
|
#include "Util/WICBitmapDIB.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <GdiPlus.h>
|
#include <GdiPlus.h>
|
||||||
#include <d2d1.h>
|
#include <d2d1.h>
|
||||||
@ -90,7 +90,7 @@ private:
|
|||||||
D2D1_MATRIX_3X2_F GetCurrentTransform();
|
D2D1_MATRIX_3X2_F GetCurrentTransform();
|
||||||
|
|
||||||
ID2D1RenderTarget* m_Target;
|
ID2D1RenderTarget* m_Target;
|
||||||
WICBitmapDIB m_Bitmap;
|
Util::WICBitmapDIB m_Bitmap;
|
||||||
|
|
||||||
// GDI+ objects that share the pixel data of m_Bitmap.
|
// GDI+ objects that share the pixel data of m_Bitmap.
|
||||||
Gdiplus::Graphics* m_GdipGraphics;
|
Gdiplus::Graphics* m_GdipGraphics;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
namespace Gfx {
|
namespace Gfx {
|
||||||
|
namespace Util {
|
||||||
|
|
||||||
WICBitmapDIB::WICBitmapDIB() :
|
WICBitmapDIB::WICBitmapDIB() :
|
||||||
m_DIBSectionBuffer(),
|
m_DIBSectionBuffer(),
|
||||||
@ -131,4 +132,5 @@ IFACEMETHODIMP WICBitmapDIB::SetResolution(double dpiX, double dpiY)
|
|||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Util
|
||||||
} // namespace Gfx
|
} // namespace Gfx
|
@ -24,6 +24,7 @@
|
|||||||
#include <wincodec.h>
|
#include <wincodec.h>
|
||||||
|
|
||||||
namespace Gfx {
|
namespace Gfx {
|
||||||
|
namespace Util {
|
||||||
|
|
||||||
// Allows the use of a DIB section (HBITMAP) in Direct2D as a WIC bitmap. It is assumed that this
|
// Allows the use of a DIB section (HBITMAP) in Direct2D as a WIC bitmap. It is assumed that this
|
||||||
// class is used only with 32bpp PARGB bitmaps and using a sigle thread.
|
// class is used only with 32bpp PARGB bitmaps and using a sigle thread.
|
||||||
@ -67,7 +68,7 @@ private:
|
|||||||
UINT m_H;
|
UINT m_H;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Util
|
||||||
} // namespace Gfx
|
} // namespace Gfx
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -18,9 +18,9 @@
|
|||||||
|
|
||||||
#include "WICBitmapLockDIB.h"
|
#include "WICBitmapLockDIB.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "../../Library/Litestep.h"
|
|
||||||
|
|
||||||
namespace Gfx {
|
namespace Gfx {
|
||||||
|
namespace Util {
|
||||||
|
|
||||||
WICBitmapLockDIB::WICBitmapLockDIB(WICBitmapDIB* bitmap, const WICRect* lockRect) :
|
WICBitmapLockDIB::WICBitmapLockDIB(WICBitmapDIB* bitmap, const WICRect* lockRect) :
|
||||||
m_Bitmap(bitmap),
|
m_Bitmap(bitmap),
|
||||||
@ -82,10 +82,10 @@ IFACEMETHODIMP WICBitmapLockDIB::GetDataPointer(UINT* pcbBufferSize, BYTE** ppbD
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IFACEMETHODIMP WICBitmapLockDIB::GetPixelFormat(WICPixelFormatGUID* pPixelFormat)
|
IFACEMETHODIMP WICBitmapLockDIB::GetPixelFormat(WICPixelFormatGUID* pPixelFormat)
|
||||||
{
|
{
|
||||||
return m_Bitmap->GetPixelFormat(pPixelFormat);
|
return m_Bitmap->GetPixelFormat(pPixelFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Util
|
||||||
} // namespace Gfx
|
} // namespace Gfx
|
@ -25,6 +25,7 @@
|
|||||||
#include "WICBitmapDIB.h"
|
#include "WICBitmapDIB.h"
|
||||||
|
|
||||||
namespace Gfx {
|
namespace Gfx {
|
||||||
|
namespace Util {
|
||||||
|
|
||||||
// Implements the IWICBitmapLock interface for use with WICBitmapDIB. It is assumed that this
|
// Implements the IWICBitmapLock interface for use with WICBitmapDIB. It is assumed that this
|
||||||
// class is used only with 32bpp PARGB bitmaps and using a sigle thread.
|
// class is used only with 32bpp PARGB bitmaps and using a sigle thread.
|
||||||
@ -53,7 +54,7 @@ private:
|
|||||||
UINT m_RefCount;
|
UINT m_RefCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Util
|
||||||
} // namespace Gfx
|
} // namespace Gfx
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -20,6 +20,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
namespace Gfx {
|
namespace Gfx {
|
||||||
|
namespace Util {
|
||||||
|
|
||||||
WICBitmapLockGDIP::WICBitmapLockGDIP() :
|
WICBitmapLockGDIP::WICBitmapLockGDIP() :
|
||||||
m_RefCount(1)
|
m_RefCount(1)
|
||||||
@ -77,4 +78,5 @@ IFACEMETHODIMP WICBitmapLockGDIP::GetPixelFormat(WICPixelFormatGUID* pPixelForma
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Util
|
||||||
} // namespace Gfx
|
} // namespace Gfx
|
@ -24,6 +24,7 @@
|
|||||||
#include <wincodec.h>
|
#include <wincodec.h>
|
||||||
|
|
||||||
namespace Gfx {
|
namespace Gfx {
|
||||||
|
namespace Util {
|
||||||
|
|
||||||
// Allows the creation of a shared ID2D1Bitmap using pixel data in a Gdiplus::Bitmap. It is
|
// Allows the creation of a shared ID2D1Bitmap using pixel data in a Gdiplus::Bitmap. It is
|
||||||
// assumed that this class is used only with 32bpp PARGB bitmaps and using a sigle thread.
|
// assumed that this class is used only with 32bpp PARGB bitmaps and using a sigle thread.
|
||||||
@ -50,6 +51,7 @@ private:
|
|||||||
UINT m_RefCount;
|
UINT m_RefCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace Util
|
||||||
} // namespace Gfx
|
} // namespace Gfx
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -76,9 +76,9 @@
|
|||||||
<ClCompile Include="..\Common\Gfx\TextFormatGDIP.cpp" />
|
<ClCompile Include="..\Common\Gfx\TextFormatGDIP.cpp" />
|
||||||
<ClCompile Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.cpp" />
|
<ClCompile Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.cpp" />
|
||||||
<ClCompile Include="..\Common\Gfx\Util\DWriteFontFileEnumerator.cpp" />
|
<ClCompile Include="..\Common\Gfx\Util\DWriteFontFileEnumerator.cpp" />
|
||||||
<ClCompile Include="..\Common\Gfx\WICBitmapDIB.cpp" />
|
<ClCompile Include="..\Common\Gfx\Util\WICBitmapDIB.cpp" />
|
||||||
<ClCompile Include="..\Common\Gfx\WICBitmapLockDIB.cpp" />
|
<ClCompile Include="..\Common\Gfx\Util\WICBitmapLockDIB.cpp" />
|
||||||
<ClCompile Include="..\Common\Gfx\WICBitmapLockGDIP.cpp" />
|
<ClCompile Include="..\Common\Gfx\Util\WICBitmapLockGDIP.cpp" />
|
||||||
<ClCompile Include="..\Common\MenuTemplate.cpp" />
|
<ClCompile Include="..\Common\MenuTemplate.cpp" />
|
||||||
<ClCompile Include="..\Common\Platform.cpp" />
|
<ClCompile Include="..\Common\Platform.cpp" />
|
||||||
<ClCompile Include="..\Common\StringUtil.cpp" />
|
<ClCompile Include="..\Common\StringUtil.cpp" />
|
||||||
@ -300,9 +300,9 @@
|
|||||||
<ClInclude Include="..\Common\Gfx\TextFormatGDIP.h" />
|
<ClInclude Include="..\Common\Gfx\TextFormatGDIP.h" />
|
||||||
<ClInclude Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.h" />
|
<ClInclude Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.h" />
|
||||||
<ClInclude Include="..\Common\Gfx\Util\DWriteFontFileEnumerator.h" />
|
<ClInclude Include="..\Common\Gfx\Util\DWriteFontFileEnumerator.h" />
|
||||||
<ClInclude Include="..\Common\Gfx\WICBitmapDIB.h" />
|
<ClInclude Include="..\Common\Gfx\Util\WICBitmapDIB.h" />
|
||||||
<ClInclude Include="..\Common\Gfx\WICBitmapLockDIB.h" />
|
<ClInclude Include="..\Common\Gfx\Util\WICBitmapLockDIB.h" />
|
||||||
<ClInclude Include="..\Common\Gfx\WICBitmapLockGDIP.h" />
|
<ClInclude Include="..\Common\Gfx\Util\WICBitmapLockGDIP.h" />
|
||||||
<ClInclude Include="..\Common\MenuTemplate.h" />
|
<ClInclude Include="..\Common\MenuTemplate.h" />
|
||||||
<ClInclude Include="..\Common\Platform.h" />
|
<ClInclude Include="..\Common\Platform.h" />
|
||||||
<ClInclude Include="..\Common\StringUtil.h" />
|
<ClInclude Include="..\Common\StringUtil.h" />
|
||||||
|
@ -378,14 +378,14 @@
|
|||||||
<ClCompile Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.cpp">
|
<ClCompile Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.cpp">
|
||||||
<Filter>Common\Gfx\Util</Filter>
|
<Filter>Common\Gfx\Util</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Common\Gfx\WICBitmapDIB.cpp">
|
<ClCompile Include="..\Common\Gfx\Util\WICBitmapLockGDIP.cpp">
|
||||||
<Filter>Common\Gfx</Filter>
|
<Filter>Common\Gfx\Util</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Common\Gfx\WICBitmapLockDIB.cpp">
|
<ClCompile Include="..\Common\Gfx\Util\WICBitmapDIB.cpp">
|
||||||
<Filter>Common\Gfx</Filter>
|
<Filter>Common\Gfx\Util</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Common\Gfx\WICBitmapLockGDIP.cpp">
|
<ClCompile Include="..\Common\Gfx\Util\WICBitmapLockDIB.cpp">
|
||||||
<Filter>Common\Gfx</Filter>
|
<Filter>Common\Gfx\Util</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -665,14 +665,14 @@
|
|||||||
<ClInclude Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.h">
|
<ClInclude Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.h">
|
||||||
<Filter>Common\Gfx\Util</Filter>
|
<Filter>Common\Gfx\Util</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Common\Gfx\WICBitmapDIB.h">
|
<ClInclude Include="..\Common\Gfx\Util\WICBitmapLockDIB.h">
|
||||||
<Filter>Common\Gfx</Filter>
|
<Filter>Common\Gfx\Util</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Common\Gfx\WICBitmapLockDIB.h">
|
<ClInclude Include="..\Common\Gfx\Util\WICBitmapLockGDIP.h">
|
||||||
<Filter>Common\Gfx</Filter>
|
<Filter>Common\Gfx\Util</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Common\Gfx\WICBitmapLockGDIP.h">
|
<ClInclude Include="..\Common\Gfx\Util\WICBitmapDIB.h">
|
||||||
<Filter>Common\Gfx</Filter>
|
<Filter>Common\Gfx\Util</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user