diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2014-01-10 12:13:04 -0800 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2014-01-15 10:11:37 -0800 |
commit | 8b3881b67d481cdb42540cdab54898f160653771 (patch) | |
tree | f73b5608dbc51206d0520296cfbbaa8233684aa6 /platform | |
parent | c3305e7280d446737fbad0dba13712385becf7ad (diff) | |
download | mupdf-8b3881b67d481cdb42540cdab54898f160653771.tar.xz |
Fixes for Windows 8.1 store validation
We have to clean up the DirectX memory during suspension.
Also define NDEBUG for the release cases so that we avoid the use of OutputDebugStringA
in error.c which is not allowed in Windows store apps.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/winrt/libmupdf_winRT.vcxproj | 6 | ||||
-rw-r--r-- | platform/winrt/mupdf_cpp/MainPage.xaml.cpp | 8 | ||||
-rw-r--r-- | platform/winrt/mupdf_cpp/Package.appxmanifest | 4 | ||||
-rw-r--r-- | platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj | 4 |
4 files changed, 16 insertions, 6 deletions
diff --git a/platform/winrt/libmupdf_winRT.vcxproj b/platform/winrt/libmupdf_winRT.vcxproj index dfb63142..9b20f46f 100644 --- a/platform/winrt/libmupdf_winRT.vcxproj +++ b/platform/winrt/libmupdf_winRT.vcxproj @@ -398,7 +398,7 @@ <CompileAsWinRT>false</CompileAsWinRT> <SDLCheck>false</SDLCheck> <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_WINRT;_UNICODE;UNICODE;NDEBUG%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> <SubSystem>Console</SubSystem> @@ -440,7 +440,7 @@ <CompileAsWinRT>false</CompileAsWinRT> <SDLCheck>false</SDLCheck> <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_WINRT;_UNICODE;UNICODE;NDEBUG%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> <SubSystem>Console</SubSystem> @@ -482,7 +482,7 @@ <CompileAsWinRT>false</CompileAsWinRT> <SDLCheck>false</SDLCheck> <AdditionalIncludeDirectories>..\..\scripts\freetype;..\..\scripts\jpeg;..\..\scripts\openjpeg;..\..\ucdn;..\..\include;..\..\generated;..\..\thirdparty\jbig2dec;..\..\thirdparty\jpeg;..\..\thirdparty\openjpeg\libopenjpeg;..\..\thirdparty\zlib;..\..\thirdparty\freetype\include;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_WINRT;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_WINRT;NDEBUG;_UNICODE;UNICODE;NDEBUG%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> <SubSystem>Console</SubSystem> diff --git a/platform/winrt/mupdf_cpp/MainPage.xaml.cpp b/platform/winrt/mupdf_cpp/MainPage.xaml.cpp index fa717084..a57a7a23 100644 --- a/platform/winrt/mupdf_cpp/MainPage.xaml.cpp +++ b/platform/winrt/mupdf_cpp/MainPage.xaml.cpp @@ -7,6 +7,7 @@ #include "MainPage.xaml.h" #include <regex> #include <sstream> +#include "DXGI1_3.h" #define LOOK_AHEAD 1 /* A +/- count on the pages to pre-render */ #define THUMB_PREADD 10 @@ -106,7 +107,9 @@ MainPage::MainPage() SetUpDirectX(); RegisterForPrinting(); CleanUp(); +#ifndef NDEBUG RecordMainThread(); +#endif /* So that we can catch special loading events (e.g. open with) */ _pageLoadedHandlerToken = Loaded += ref new RoutedEventHandler(this, &MainPage::Page_Loaded); } @@ -211,9 +214,12 @@ void MainPage::ExceptionHandler(Object^ sender, UnhandledExceptionEventArgs^ e) } } +/* We need to clean up (Trim) the directX memory on suspension */ void MainPage::App_Suspending(Object^ sender, SuspendingEventArgs^ e) { - + ComPtr<IDXGIDevice3> pDXGIDevice; + ThrowIfFailed(m_d3d_device.As(&pDXGIDevice)); + pDXGIDevice->Trim(); } void MainPage::ExitInvokedHandler(Windows::UI::Popups::IUICommand^ command) diff --git a/platform/winrt/mupdf_cpp/Package.appxmanifest b/platform/winrt/mupdf_cpp/Package.appxmanifest index 08e2b538..2229b117 100644 --- a/platform/winrt/mupdf_cpp/Package.appxmanifest +++ b/platform/winrt/mupdf_cpp/Package.appxmanifest @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest"> - <Identity Name="ArtifexSoftware.MuPDF" Publisher="CN=B93265AA-82AD-458A-A08E-7069B8ED88B5" Version="1.1.0.10" /> + <Identity Name="ArtifexSoftware.MuPDF" Publisher="CN=B93265AA-82AD-458A-A08E-7069B8ED88B5" Version="1.2.0.16" /> <Properties> <DisplayName>MuPDF</DisplayName> <PublisherDisplayName>Artifex Software</PublisherDisplayName> @@ -28,7 +28,7 @@ </FileTypeAssociation> </Extension> </Extensions> - <m2:VisualElements DisplayName="MuPDF" Description="A lightweight, high quality PDF/XPS/CBZ viewer for Windows 8 devices." BackgroundColor="#464646" ForegroundText="light" Square150x150Logo="Assets\Logo.png" Square30x30Logo="assets/mupdf_smallogo.png"> + <m2:VisualElements DisplayName="MuPDF" Description="A lightweight, high quality PDF/XPS/CBZ viewer/print driver for Windows 8.1 devices." BackgroundColor="#464646" ForegroundText="light" Square150x150Logo="Assets\Logo.png" Square30x30Logo="assets/mupdf_smallogo.png"> <m2:DefaultTile> <m2:ShowNameOnTiles> <m2:ShowOn Tile="square150x150Logo" /> diff --git a/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj b/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj index f75e79fa..2b8c3255 100644 --- a/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj +++ b/platform/winrt/mupdf_cpp/mupdf_cpp.vcxproj @@ -95,6 +95,7 @@ <PackageCertificateThumbprint>03074CFDB8E2AB0CD384A1FFA139F7959DC8A656</PackageCertificateThumbprint> <AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision> <PackageCertificateKeyFile>mupdf_cpp_StoreKey.pfx</PackageCertificateKeyFile> + <AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> @@ -136,6 +137,7 @@ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions> <DisableSpecificWarnings>4453</DisableSpecificWarnings> <AdditionalIncludeDirectories>../../include/;../mupdfwinrt/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_UNICODE;NDEBUG;UNICODE;NDEBUG%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> <AdditionalDependencies>D3D11.lib;D2d1.lib;kernel32.lib;%(AdditionalDependencies);../$(Platform)/$(Configuration)/libmupdf_winRT.lib;../$(Platform)/$(Configuration)/libthirdparty_winRT.lib;../$(Platform)/$(Configuration)/libmupdf-nov8_winRT.lib;../$(Platform)/$(Configuration)/mupdfwinrt.lib</AdditionalDependencies> @@ -160,6 +162,7 @@ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions> <DisableSpecificWarnings>4453</DisableSpecificWarnings> <AdditionalIncludeDirectories>../../include/;../mupdfwinrt/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_UNICODE;NDEBUG;UNICODE;NDEBUG%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> <AdditionalDependencies>D3D11.lib;D2d1.lib;kernel32.lib;%(AdditionalDependencies);../$(Platform)/$(Configuration)/libmupdf_winRT.lib;../$(Platform)/$(Configuration)/libthirdparty_winRT.lib;../$(Platform)/$(Configuration)/libmupdf-nov8_winRT.lib;../$(Platform)/$(Configuration)/mupdfwinrt.lib</AdditionalDependencies> @@ -184,6 +187,7 @@ <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions> <DisableSpecificWarnings>4453</DisableSpecificWarnings> <AdditionalIncludeDirectories>../../include/;../mupdfwinrt/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_UNICODE;NDEBUG;UNICODE;NDEBUG%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> <AdditionalDependencies>D3D11.lib;D2d1.lib;kernel32.lib;%(AdditionalDependencies);../$(Platform)/$(Configuration)/libmupdf_winRT.lib;../$(Platform)/$(Configuration)/libthirdparty_winRT.lib;../$(Platform)/$(Configuration)/libmupdf-nov8_winRT.lib;../$(Platform)/$(Configuration)/mupdfwinrt.lib</AdditionalDependencies> |