## Summary of the Pull Request Introduces convenience type `til::size` which automatically implements our best practices for size-related types and provides automatic conversions in/out of the relevant types. ## PR Checklist * [x] In support of Differental Rendering #778 * [X] I work here. * [x] Tests added/passed * [x] I'm a core contributor. ## Detailed Description of the Pull Request / Additional comments - Automatically converts in from anything with a X/Y (console `COORD`) or cx/cy (Win32 `SIZE`) - Automatically converts out to `COORD`, `SIZE`, or `D2D1_SIZE_F`. - Constructs from bare integers written into source file - Default constructs to empty - Uses Chromium Math for all basic math operations (+, -, *, /) - Provides equality tests - Adds initial proposal for division-to-ceiling (round up division) that attempts to `ceil` without any floating point math. - Accessors for height/width - Type converting accessors (that use safe conversions and throw) for height/width - Convenience function for area calculation (as that's common with type) and uses safe math to do it. - TAEF/WEX Output and Comparators so they will print very nicely with `VERIFY` and `Log` macros in our testing suite. ## Validation Steps Performed - See automated tests of functionality.
42 lines
982 B
C
42 lines
982 B
C
/*++
|
|
Copyright (c) Microsoft Corporation
|
|
Licensed under the MIT license.
|
|
|
|
Module Name:
|
|
- precomp.h
|
|
|
|
Abstract:
|
|
- Contains external headers to include in the precompile phase of console build process.
|
|
- Avoid including internal project headers. Instead include them only in the classes that need them (helps with test project building).
|
|
--*/
|
|
|
|
#pragma once
|
|
|
|
// clang-format off
|
|
|
|
#ifndef WIN32_LEAN_AND_MEAN
|
|
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
|
#endif
|
|
|
|
#ifndef NOMINMAX
|
|
#define NOMINMAX
|
|
#endif
|
|
|
|
// Windows Header Files:
|
|
#include <windows.h>
|
|
|
|
#define BLOCK_TIL
|
|
// This includes support libraries from the CRT, STL, WIL, and GSL
|
|
#include "LibraryIncludes.h"
|
|
|
|
#include "WexTestClass.h"
|
|
|
|
// Include DirectX common structures so we can test them.
|
|
// (before TIL so its support lights up)
|
|
#include <dcommon.h>
|
|
|
|
// Include TIL after Wex to get test comparators.
|
|
#include "til.h"
|
|
|
|
// clang-format on
|