Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmarking test project and add text drawing benchmark tests #1876

Merged
merged 9 commits into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Frameworks/include/CppUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ std::basic_ostream<T>& operator<<(std::basic_ostream<T>& os, const CGSize& size)
return os;
}

inline CGSize operator*(const CGSize& lhs, CGFloat multiplier) {
return{ lhs.width * multiplier, lhs.height * multiplier };
}

#pragma endregion

#pragma region CGRect
Expand Down
247 changes: 247 additions & 0 deletions build/Tests/UnitTests/Benchmark/Benchmark.UnitTests.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Foundation\dll\Foundation.vcxproj">
<Project>{86127226-9A6E-439B-A070-420A572AF0C7}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\CoreFoundation\dll\CoreFoundation.vcxproj">
<Project>{81F30AF6-EAC3-4DFA-929A-C25D69E8080B}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\Logging\dll\Logging.vcxproj">
<Project>{862d36c2-cc83-4d04-b9b8-bef07f479905}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\Starboard\dll\Starboard.vcxproj">
<Project>{0AC27ECF-E2AB-420B-9359-4843FFF4CBFA}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\UIKit\dll\UIKit.vcxproj">
<Project>{8E79930B-7EF6-4A4E-B46C-EFC0A49C55D9}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\CoreGraphics\dll\CoreGraphics.vcxproj">
<Project>{26da08da-d0b9-4579-b168-e7f0a5f20e57}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\CoreText\dll\CoreText.vcxproj">
<Project>{36deec5d-f77b-4c94-a63c-86fb716833de}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\WinObjCRT\dll\WinObjCRT.vcxproj">
<Project>{585b4870-0d6b-43a6-8e7e-ad08f7f507b6}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\debugger_general.xml" />
<PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\debugger_local_windows.xml" />
</ItemGroup>
<PropertyGroup Label="Globals">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<ProjectGuid>{7A062AEC-5AED-4F83-8716-4C078F75177B}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Benchmark.UnitTests</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<ApplicationType>Windows Store</ApplicationType>
<AppContainerApplication>false</AppContainerApplication>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10586.0</WindowsTargetPlatformMinVersion>
<WindowsAppContainer>false</WindowsAppContainer>
<TargetOsAndVersion>Universal Windows</TargetOsAndVersion>
<StarboardBasePath>..\..\..\..</StarboardBasePath>
<UseStarboardSourceSdk>true</UseStarboardSourceSdk>
<IslandwoodDRT>false</IslandwoodDRT>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(RootNamespace)\</OutDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(StarboardBasePath)\msvc\starboard-cmdline.props" />
</ImportGroup>
<ImportGroup Label="ExtensionSettings">
<Import Project="$(StarboardBasePath)\msvc\ut-build.props" />
</ImportGroup>
<ImportGroup Label="Shared">
<Import Project="..\..\Tests.Shared\Tests.Shared.vcxitems" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>NO_STUBS;WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(StarboardBasePath)\tests\frameworks\include;$(StarboardBasePath)\tests\frameworks\gtest;$(StarboardBasePath)\tests\frameworks\gtest\include;$(MSBuildThisFileDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>libdispatch.lib;mincore.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AppContainer>false</AppContainer>
</Link>
<ClangCompile>
<IncludePaths>$(StarboardBasePath)\Frameworks\include;$(StarboardBasePath)\include\xplat;$(StarboardBasePath)\tests\frameworks\include;$(StarboardBasePath)\tests\frameworks\gtest;$(StarboardBasePath)\tests\frameworks\gtest\include;$(StarboardBasePath)\;%(AdditionalIncludeDirectories)</IncludePaths>
<CompileAs>CompileAsObjCpp</CompileAs>
<OtherCPlusPlusFlags>-fmsvc-real-char -Wdeprecated-declarations</OtherCPlusPlusFlags>
<PreprocessorDefinitions>NO_STUBS;_CRT_SECURE_NO_WARNINGS;DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClangCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>NO_STUBS;WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(StarboardBasePath)\tests\frameworks\include;$(StarboardBasePath)\tests\frameworks\gtest;$(StarboardBasePath)\tests\frameworks\gtest\include;$(MSBuildThisFileDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>libdispatch.lib;mincore.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AppContainer>false</AppContainer>
</Link>
<ClangCompile>
<IncludePaths>$(StarboardBasePath)\Frameworks\include;$(StarboardBasePath)\include\xplat;$(StarboardBasePath)\tests\frameworks\include;$(StarboardBasePath)\tests\frameworks\gtest;$(StarboardBasePath)\tests\frameworks\gtest\include;$(StarboardBasePath)\;%(AdditionalIncludeDirectories)</IncludePaths>
<CompileAs>CompileAsObjCpp</CompileAs>
<OtherCPlusPlusFlags>-fmsvc-real-char -Wdeprecated-declarations</OtherCPlusPlusFlags>
<PreprocessorDefinitions>NO_STUBS;_CRT_SECURE_NO_WARNINGS;DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClangCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NO_STUBS;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(StarboardBasePath)\tests\frameworks\include;$(StarboardBasePath)\tests\frameworks\gtest;$(StarboardBasePath)\tests\frameworks\gtest\include;$(MSBuildThisFileDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>libdispatch.lib;mincore.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AppContainer>false</AppContainer>
</Link>
<ClangCompile>
<IncludePaths>$(StarboardBasePath)\Frameworks\include;$(StarboardBasePath)\include\xplat;$(StarboardBasePath)\tests\frameworks\include;$(StarboardBasePath)\tests\frameworks\gtest;$(StarboardBasePath)\tests\frameworks\gtest\include;$(StarboardBasePath)\;%(AdditionalIncludeDirectories)</IncludePaths>
<CompileAs>CompileAsObjCpp</CompileAs>
<OtherCPlusPlusFlags>-fmsvc-real-char</OtherCPlusPlusFlags>
<PreprocessorDefinitions>NO_STUBS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClangCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NO_STUBS;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(StarboardBasePath)\tests\frameworks\include;$(StarboardBasePath)\tests\frameworks\gtest;$(StarboardBasePath)\tests\frameworks\gtest\include;$(MSBuildThisFileDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>libdispatch.lib;mincore.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AppContainer>false</AppContainer>
</Link>
<ClangCompile>
<IncludePaths>$(StarboardBasePath)\Frameworks\include;$(StarboardBasePath)\include\xplat;$(StarboardBasePath)\tests\frameworks\include;$(StarboardBasePath)\tests\frameworks\gtest;$(StarboardBasePath)\tests\frameworks\gtest\include;$(StarboardBasePath)\;%(AdditionalIncludeDirectories)</IncludePaths>
<CompileAs>CompileAsObjCpp</CompileAs>
<OtherCPlusPlusFlags>-fmsvc-real-char</OtherCPlusPlusFlags>
<PreprocessorDefinitions>NO_STUBS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClangCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="$(StarboardBasePath)\tests\unittests\Framework\Framework.cpp" />
<ClCompile Include="$(StarboardBasePath)\tests\unittests\EntryPoint.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(StarboardBasePath)\tests\UnitTests\Benchmark\BenchmarkTest.h" />
</ItemGroup>
<ItemGroup>
<ClangCompile Include="$(StarboardBasePath)\tests\UnitTests\Benchmark\BenchmarkSampleTests.mm" />
<ClangCompile Include="$(StarboardBasePath)\tests\UnitTests\Benchmark\TextBenchmarkTests.mm" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(StarboardBasePath)\msvc\starboard-cmdline.targets" />
</ImportGroup>
</Project>
14 changes: 14 additions & 0 deletions build/build.sln
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddressBook.UnitTests", "Te
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CoreGraphics.Drawing.UnitTests", "Tests\UnitTests\CoreGraphics.Drawing\CoreGraphics.Drawing.UnitTests.vcxproj", "{DE51CDE9-F326-49B6-8C5B-35D5B091878C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmark", "Benchmark", "{99A75321-675A-4C92-9848-96D3C8460625}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Benchmark.UnitTests", "Tests\UnitTests\Benchmark\Benchmark.UnitTests.vcxproj", "{7A062AEC-5AED-4F83-8716-4C078F75177B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Expand Down Expand Up @@ -1963,6 +1967,14 @@ Global
{DE51CDE9-F326-49B6-8C5B-35D5B091878C}.Release|ARM.Build.0 = Release|ARM
{DE51CDE9-F326-49B6-8C5B-35D5B091878C}.Release|x86.ActiveCfg = Release|Win32
{DE51CDE9-F326-49B6-8C5B-35D5B091878C}.Release|x86.Build.0 = Release|Win32
{7A062AEC-5AED-4F83-8716-4C078F75177B}.Debug|ARM.ActiveCfg = Debug|ARM
{7A062AEC-5AED-4F83-8716-4C078F75177B}.Debug|ARM.Build.0 = Debug|ARM
{7A062AEC-5AED-4F83-8716-4C078F75177B}.Debug|x86.ActiveCfg = Debug|Win32
{7A062AEC-5AED-4F83-8716-4C078F75177B}.Debug|x86.Build.0 = Debug|Win32
{7A062AEC-5AED-4F83-8716-4C078F75177B}.Release|ARM.ActiveCfg = Release|ARM
{7A062AEC-5AED-4F83-8716-4C078F75177B}.Release|ARM.Build.0 = Release|ARM
{7A062AEC-5AED-4F83-8716-4C078F75177B}.Release|x86.ActiveCfg = Release|Win32
{7A062AEC-5AED-4F83-8716-4C078F75177B}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -2264,5 +2276,7 @@ Global
{69D1F829-1843-4395-BCE9-69C4CEB59004} = {88413F6C-C27A-4B48-9AE5-D36161920F6D}
{62E53898-65C2-4401-BF58-FBFB728E1B27} = {69D1F829-1843-4395-BCE9-69C4CEB59004}
{DE51CDE9-F326-49B6-8C5B-35D5B091878C} = {0A79AFE5-2685-433C-BC78-A4AD09CD7BF8}
{99A75321-675A-4C92-9848-96D3C8460625} = {88413F6C-C27A-4B48-9AE5-D36161920F6D}
{7A062AEC-5AED-4F83-8716-4C078F75177B} = {99A75321-675A-4C92-9848-96D3C8460625}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion include/CoreGraphics/CGContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ COREGRAPHICS_EXPORT void CGContextShowGlyphs(CGContextRef c, const CGGlyph* g, s
COREGRAPHICS_EXPORT void CGContextShowGlyphsAtPoint(CGContextRef c, CGFloat x, CGFloat y, const CGGlyph* glyphs, size_t count);
COREGRAPHICS_EXPORT void CGContextShowGlyphsWithAdvances(CGContextRef c, const CGGlyph* glyphs, const CGSize* advances, size_t count);

COREGRAPHICS_EXPORT void CGContextShowGlyphsAtPositions(CGContextRef c, const CGGlyph* glyphs, const CGPoint* Lpositions, size_t count)
COREGRAPHICS_EXPORT void CGContextShowGlyphsAtPositions(CGContextRef c, const CGGlyph* glyphs, const CGPoint* positions, size_t count)
STUB_METHOD;

COREGRAPHICS_EXPORT CGAffineTransform CGContextGetTextMatrix(CGContextRef c);
Expand Down
Loading