Gfx: Move WIC files to Util

This commit is contained in:
Birunthan Mohanathas 2013-04-12 17:09:42 +03:00
parent 3827353c08
commit ad9149b143
10 changed files with 35 additions and 27 deletions

View File

@ -19,7 +19,7 @@
#include "CanvasD2D.h"
#include "TextFormatD2D.h"
#include "Util/DWriteFontCollectionLoader.h"
#include "WICBitmapLockGDIP.h"
#include "Util/WICBitmapLockGDIP.h"
#include "../../Library/Litestep.h"
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
// not using a hardware accelerated render target. Nevertheless, we will use it to avoid
// the EndDraw() call needed for GDI+ drawing.
WICBitmapLockGDIP* bitmapLock = new WICBitmapLockGDIP();
Util::WICBitmapLockGDIP* bitmapLock = new Util::WICBitmapLockGDIP();
Gdiplus::Status status = bitmap->LockBits(
&srcRect, Gdiplus::ImageLockModeRead, PixelFormat32bppPARGB, bitmapLock->GetBitmapData());
if (status == Gdiplus::Ok)

View File

@ -22,7 +22,7 @@
#include "Canvas.h"
#include "FontCollectionD2D.h"
#include "TextFormatD2D.h"
#include "WICBitmapDIB.h"
#include "Util/WICBitmapDIB.h"
#include <string>
#include <GdiPlus.h>
#include <d2d1.h>
@ -90,7 +90,7 @@ private:
D2D1_MATRIX_3X2_F GetCurrentTransform();
ID2D1RenderTarget* m_Target;
WICBitmapDIB m_Bitmap;
Util::WICBitmapDIB m_Bitmap;
// GDI+ objects that share the pixel data of m_Bitmap.
Gdiplus::Graphics* m_GdipGraphics;

View File

@ -21,7 +21,8 @@
#include <cassert>
namespace Gfx {
namespace Util {
WICBitmapDIB::WICBitmapDIB() :
m_DIBSectionBuffer(),
m_DIBSectionBufferPixels(),
@ -131,4 +132,5 @@ IFACEMETHODIMP WICBitmapDIB::SetResolution(double dpiX, double dpiY)
return E_NOTIMPL;
}
} // namespace Util
} // namespace Gfx

View File

@ -24,6 +24,7 @@
#include <wincodec.h>
namespace Gfx {
namespace Util {
// 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.
@ -67,7 +68,7 @@ private:
UINT m_H;
};
} // namespace Util
} // namespace Gfx
#endif

View File

@ -18,9 +18,9 @@
#include "WICBitmapLockDIB.h"
#include <cassert>
#include "../../Library/Litestep.h"
namespace Gfx {
namespace Util {
WICBitmapLockDIB::WICBitmapLockDIB(WICBitmapDIB* bitmap, const WICRect* lockRect) :
m_Bitmap(bitmap),
@ -82,10 +82,10 @@ IFACEMETHODIMP WICBitmapLockDIB::GetDataPointer(UINT* pcbBufferSize, BYTE** ppbD
return S_OK;
}
IFACEMETHODIMP WICBitmapLockDIB::GetPixelFormat(WICPixelFormatGUID* pPixelFormat)
{
return m_Bitmap->GetPixelFormat(pPixelFormat);
}
} // namespace Util
} // namespace Gfx

View File

@ -25,6 +25,7 @@
#include "WICBitmapDIB.h"
namespace Gfx {
namespace Util {
// 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.
@ -53,7 +54,7 @@ private:
UINT m_RefCount;
};
} // namespace Util
} // namespace Gfx
#endif

View File

@ -20,6 +20,7 @@
#include <cassert>
namespace Gfx {
namespace Util {
WICBitmapLockGDIP::WICBitmapLockGDIP() :
m_RefCount(1)
@ -77,4 +78,5 @@ IFACEMETHODIMP WICBitmapLockGDIP::GetPixelFormat(WICPixelFormatGUID* pPixelForma
return S_OK;
}
} // namespace Util
} // namespace Gfx

View File

@ -24,6 +24,7 @@
#include <wincodec.h>
namespace Gfx {
namespace Util {
// 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.
@ -50,6 +51,7 @@ private:
UINT m_RefCount;
};
} // namespace Util
} // namespace Gfx
#endif

View File

@ -76,9 +76,9 @@
<ClCompile Include="..\Common\Gfx\TextFormatGDIP.cpp" />
<ClCompile Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.cpp" />
<ClCompile Include="..\Common\Gfx\Util\DWriteFontFileEnumerator.cpp" />
<ClCompile Include="..\Common\Gfx\WICBitmapDIB.cpp" />
<ClCompile Include="..\Common\Gfx\WICBitmapLockDIB.cpp" />
<ClCompile Include="..\Common\Gfx\WICBitmapLockGDIP.cpp" />
<ClCompile Include="..\Common\Gfx\Util\WICBitmapDIB.cpp" />
<ClCompile Include="..\Common\Gfx\Util\WICBitmapLockDIB.cpp" />
<ClCompile Include="..\Common\Gfx\Util\WICBitmapLockGDIP.cpp" />
<ClCompile Include="..\Common\MenuTemplate.cpp" />
<ClCompile Include="..\Common\Platform.cpp" />
<ClCompile Include="..\Common\StringUtil.cpp" />
@ -300,9 +300,9 @@
<ClInclude Include="..\Common\Gfx\TextFormatGDIP.h" />
<ClInclude Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.h" />
<ClInclude Include="..\Common\Gfx\Util\DWriteFontFileEnumerator.h" />
<ClInclude Include="..\Common\Gfx\WICBitmapDIB.h" />
<ClInclude Include="..\Common\Gfx\WICBitmapLockDIB.h" />
<ClInclude Include="..\Common\Gfx\WICBitmapLockGDIP.h" />
<ClInclude Include="..\Common\Gfx\Util\WICBitmapDIB.h" />
<ClInclude Include="..\Common\Gfx\Util\WICBitmapLockDIB.h" />
<ClInclude Include="..\Common\Gfx\Util\WICBitmapLockGDIP.h" />
<ClInclude Include="..\Common\MenuTemplate.h" />
<ClInclude Include="..\Common\Platform.h" />
<ClInclude Include="..\Common\StringUtil.h" />

View File

@ -378,14 +378,14 @@
<ClCompile Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.cpp">
<Filter>Common\Gfx\Util</Filter>
</ClCompile>
<ClCompile Include="..\Common\Gfx\WICBitmapDIB.cpp">
<Filter>Common\Gfx</Filter>
<ClCompile Include="..\Common\Gfx\Util\WICBitmapLockGDIP.cpp">
<Filter>Common\Gfx\Util</Filter>
</ClCompile>
<ClCompile Include="..\Common\Gfx\WICBitmapLockDIB.cpp">
<Filter>Common\Gfx</Filter>
<ClCompile Include="..\Common\Gfx\Util\WICBitmapDIB.cpp">
<Filter>Common\Gfx\Util</Filter>
</ClCompile>
<ClCompile Include="..\Common\Gfx\WICBitmapLockGDIP.cpp">
<Filter>Common\Gfx</Filter>
<ClCompile Include="..\Common\Gfx\Util\WICBitmapLockDIB.cpp">
<Filter>Common\Gfx\Util</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
@ -665,14 +665,14 @@
<ClInclude Include="..\Common\Gfx\Util\DWriteFontCollectionLoader.h">
<Filter>Common\Gfx\Util</Filter>
</ClInclude>
<ClInclude Include="..\Common\Gfx\WICBitmapDIB.h">
<Filter>Common\Gfx</Filter>
<ClInclude Include="..\Common\Gfx\Util\WICBitmapLockDIB.h">
<Filter>Common\Gfx\Util</Filter>
</ClInclude>
<ClInclude Include="..\Common\Gfx\WICBitmapLockDIB.h">
<Filter>Common\Gfx</Filter>
<ClInclude Include="..\Common\Gfx\Util\WICBitmapLockGDIP.h">
<Filter>Common\Gfx\Util</Filter>
</ClInclude>
<ClInclude Include="..\Common\Gfx\WICBitmapLockGDIP.h">
<Filter>Common\Gfx</Filter>
<ClInclude Include="..\Common\Gfx\Util\WICBitmapDIB.h">
<Filter>Common\Gfx\Util</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>