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

Release 1702.1 #1992

Merged
merged 176 commits into from
Feb 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
b7980f5
D2DFactory Wrapper (#1085)
MSFTFox Oct 6, 2016
da095af
Add the CG/D2D design document. (#1112)
DHowett Oct 10, 2016
36ef724
Merge remote-tracking branch 'upstream/CT-DW' into CGD2D
Oct 10, 2016
5102c71
Implement an ID2D1RenderTarget-backed CGContext (#1126)
DHowett Oct 14, 2016
c56634a
Add CFCppBase, a helper class for implementing C++ CF types.
DHowett Oct 14, 2016
2d2230d
Switch CGContext/CGBitmapContext over to CppBase.
DHowett Oct 14, 2016
7e09fd8
Merge remote-tracking branch 'upstream/CT-Dw' into CGD2D
Oct 17, 2016
0f7de5a
Merge pull request #1166 from rajsesh-msft/merge_develop2
Oct 17, 2016
3ba6085
Initial implementation of CGPath Using ID2D1Geometries (#1138)
MSFTFox Oct 19, 2016
be12d2f
Merge remote-tracking branch 'upstream/CT-DW' into CGD2D
Oct 20, 2016
587f3dc
Merge pull request #1192 from rajsesh-msft/ctdw_2_cgd2d
Oct 20, 2016
29e1b23
CGContext DPI, parameter, stroking & interpolation improvements (#1181)
DHowett Oct 20, 2016
7a86a15
Perform major surgery on CGContext.
DHowett Oct 20, 2016
3496ce9
Merge remote-tracking branch 'github/develop' into CGD2D
DHowett Oct 27, 2016
c10efe5
Fix improper use of internal functions in CGPath. (#1249)
MSFTFox Oct 27, 2016
7553524
Implementation of CGImage using Windows Imaging Component. (#1185)
msft-Jeyaram Oct 28, 2016
4ec31dd
Add support for black and coloured shadows via ID2D1Effect. (#1239)
DHowett Oct 31, 2016
8e83547
Implement the CGContext non-drawing path functions in terms of CGPath…
DHowett Oct 31, 2016
d98425f
Finish Simple line and status CGPath APIs. (#1255)
MSFTFox Nov 1, 2016
7fe8877
Implement drawing CGPaths through CGContext (#1307)
MSFTFox Nov 5, 2016
ec790b1
Refine CGContext's user<->device coordinate space boundary (#1324)
DHowett Nov 8, 2016
6d4e9d0
Refactor CoreGraphics to use IWIC/D2D (#1332)
msft-Jeyaram Nov 10, 2016
19715b6
Merge remote-tracking branch 'github/develop' into github-CGD2D
DHowett Nov 10, 2016
0da72bd
Update CGContext, CGPath and sorta CGImage for the CFCppBase changes.…
DHowett Nov 10, 2016
de687f4
Disable CTFont.CreatePathForGlyph
DHowett Nov 11, 2016
bf9ab26
Adapting the WIC factory creator to follow the outlined format in D2D…
msft-Jeyaram Nov 11, 2016
bfe87c4
Merge pull request #1354 from Microsoft/20161110-cgd2d-develop-merge
DHowett Nov 11, 2016
8bb01ec
Propagate context alpha into brushes for per-primitive draw, not layer
DHowett Nov 4, 2016
f3c082e
Add support for clipping (and EO clipping); add support for non-EO fi…
DHowett Nov 15, 2016
ba6c5ca
Add CoreGraphics.Drawing UT and a bunch of image rendering tests.
DHowett Nov 10, 2016
fa43315
Implementation of CGBitmapContext. (#1371)
msft-Jeyaram Nov 16, 2016
3a49f4e
Changing IWIC image loading to on Load rather than on demand. (#1413)
msft-Jeyaram Nov 18, 2016
8236810
Simplify geometry casting. (#1428)
DHowett Nov 21, 2016
ed17602
Disable every drawing test manually instead of using exit(0). (#1434)
DHowett Nov 21, 2016
7349c69
Cleaning up internal headers and moving CGImage implementation to sou…
msft-Jeyaram Nov 22, 2016
08f73bb
Implementation of drawing an Image into context (#1414)
msft-Jeyaram Nov 23, 2016
f80e4de
Clean up internal headers; delete CGContextImpl.
DHowett Nov 23, 2016
67ec978
Clean up CoreGraphics' public headers.
DHowett Nov 23, 2016
d8bfd9a
Automatically generate greenline images for tests and provide for tes…
DHowett Nov 23, 2016
633799f
remove export of internal function (#1458)
msft-Jeyaram Nov 24, 2016
281b612
Merge remote-tracking branch 'github/develop' into github-CGD2D
DHowett Nov 29, 2016
ba63a15
Fix internal and Objective-C use in CoreGraphics.DrawingTests.
DHowett Nov 29, 2016
9a854e1
Use CopyTo(p) instead of *p=Get(). Fixes #1453.
DHowett Nov 29, 2016
8c7d254
In CGImageDestination, never pair a Get with a Release.
DHowett Nov 29, 2016
5afebc1
*DO NOT* rely on the value of uninitialized memory.
DHowett Nov 30, 2016
e79d9b1
zero out memory for backing buffer
msft-Jeyaram Nov 30, 2016
def0466
Merge pull request #1475 from msft-Jeyaram/29_16_MemSetCGContext
msft-Jeyaram Nov 30, 2016
34ec597
Implement Arcs using D2D (#1384)
MSFTFox Nov 30, 2016
9dca501
Re-Integration from develop->CGD2D
msft-Jeyaram Dec 1, 2016
82f0cc3
Merge pull request #1494 (develop -> CGD2D).
DHowett Dec 6, 2016
3176d73
[CGD2D] Add support for Transparency Layers. (#1496)
DHowett Dec 6, 2016
3b776a3
Implement CGPathApply (#1507)
MSFTFox Dec 13, 2016
57d7722
Merge remote-tracking branch 'github/develop' into 20161213-cgd2d-dev…
DHowett Dec 14, 2016
7fddae9
Remove bitmap context hack from NSTextContainer
aballway Dec 14, 2016
470fd9b
Fix Affine Transform in CGPath (#1550)
MSFTFox Dec 16, 2016
2138852
Add support for copying subregions from CGIWICBitmap.
DHowett Dec 12, 2016
3eef524
Convert ImageIO to use CGImage's WIC internals directly.
DHowett Dec 9, 2016
31f0e5a
Tidy CGImage's list of supported pixel and rendering formats.
DHowett Dec 13, 2016
da28cba
Convert CGBitmapContext's image on output (if data isn't provided).
DHowett Dec 9, 2016
35ee37e
Fix CoreGraphics.Drawing's image loader & premultiplied alpha.
DHowett Dec 13, 2016
7c5a470
Add support+tests for clipping context rendering to an image mask. (#…
DHowett Dec 16, 2016
447e12e
Add support for CGImageCreateWithMask. (#1555)
DHowett Dec 17, 2016
132ebc2
Store CGContext's text position in its text matrix. (#1580)
DHowett Dec 17, 2016
993690e
Implementation of Tiled Images + tests (#1542)
msft-Jeyaram Dec 17, 2016
e579967
Implementation of fill and stroke pattern brushes and tests #1422
msft-Jeyaram Dec 20, 2016
0c1e282
Implementation of Linear gradients with full optional support (#1416)
msft-Jeyaram Dec 21, 2016
6fbd0b0
Support opacity and interpolation for Drawing Images (#1557)
msft-Jeyaram Dec 22, 2016
ff78f61
Reintegrate CoreGraphics and Accelerate.framework. (#1680)
DHowett Jan 11, 2017
f93c35f
Fix (and update) UIGraphicsFunctions. (#1681)
DHowett Jan 11, 2017
1d0b286
Merge remote-tracking branch 'github/develop' into github-CGD2D
DHowett Jan 11, 2017
6c9b584
Do not use UIColor in CoreText!
DHowett Jan 11, 2017
2802504
Fix CGImage to not copy CGDataProvider. Fix CGDataProvider in vImage.
DHowett Jan 12, 2017
d1db60d
CoreImage:Implementation of CIImage using CGImage + test (#1625)
msft-Jeyaram Jan 13, 2017
003dd5f
Proper annotations for implemented methods (#1719)
msft-Jeyaram Jan 18, 2017
cd07405
Implementation of JPEG & PNG representation and tests
msft-Jeyaram Jan 18, 2017
98ffbb6
#1338 Adding support to copy images to/from clipboard
msft-Jeyaram Jan 18, 2017
0b0e096
Add woc::AutoCF<T>. It's like AutoId<T> for CFTypes.
DHowett Jan 13, 2017
d1b386b
Merge remote-tracking branch 'github/develop' into github-CGD2D
DHowett Jan 18, 2017
447dcdc
Fix fallout from the merge of #1692.
DHowett Jan 18, 2017
897a053
Migrate the text drawing code from Cairo to CGD2D.
DHowett Jan 17, 2017
92ed07c
Fix the default fill/stroke color values from the reference platform.
DHowett Jan 18, 2017
5566651
#1733 CGContextClearRect: Support to clear rect if clipping is not se…
msft-Jeyaram Jan 20, 2017
2122f2a
Fix our WIC<->CG color format table again.
DHowett Jan 20, 2017
35a360f
Work around #1769 by doing the DPI calculation ourselves.
DHowett Jan 21, 2017
30c60dc
Fix Figure Creation in CGPath (#1738)
MSFTFox Jan 24, 2017
aa8a8d4
Plug memory leak in __DWriteTextLayoutApplyFont (#1788)
aballway Jan 24, 2017
4c153c4
Fixing ApiAnalyzer errors. (#1794)
pradipd Jan 24, 2017
601e300
NSTextContainer handle exclusion zones extending outside of area (#1792)
aballway Jan 24, 2017
2247d2a
getNetworkConnectivityLevel can throw under some circumstances. Hand…
Jan 24, 2017
efac7b1
Fix leak in NSRunLoop _statesForMode: helper (#1793)
ehren Jan 25, 2017
caf30be
SC callbacks must by default happen on the main thread unless the app…
Jan 25, 2017
e8e263a
Fix drawing tests on OSX (#1815)
aballway Jan 25, 2017
f04cbda
UX Functional test pattern - exercising sample app's UIViewController…
oliversa-msft Jan 25, 2017
431044e
CoreText Performance: Call ID2D1RenderTarget::BeginDraw()/EndDraw() f…
ms-jihua Jan 20, 2017
7a73991
Merge #1705 to CGD2D
ms-jihua Jan 20, 2017
1848d09
Remove Cairo and unused dependencies (#1797)
aballway Jan 25, 2017
85a6ecb
[CGD2D] Render buffer-shared G8 images as A8. (#1804)
DHowett Jan 25, 2017
441f013
Use custom font for stable version and copyright (#1799)
aballway Jan 25, 2017
d6a3049
Merge remote-tracking branch 'github/develop' into github-CGD2D
DHowett Jan 25, 2017
5a73129
Initialize m_lastPoint; fixes intermittent test failure.
DHowett Jan 25, 2017
812ff21
Porting ObjectiveC language services VSIX to VS2017 (#1745)
mukhole Jan 26, 2017
a1f26a8
Make sure our touch/point conversion works in middleware (C#-hosted, …
jaredhms Jan 26, 2017
f440523
Fix various Uikit memory leaks (#1803)
jaredhms Jan 26, 2017
8959309
Allow _UIPopupViewController to present itself in middleware scenario…
jaredhms Jan 26, 2017
9fec412
Fix additional leaks in UIKit (#1789)
ehren Jan 26, 2017
8185374
ObjC2Winmd: Support for async delegates with multiple parameters (#1833)
mukhole Jan 26, 2017
939705d
Fix a missed endianness flip in #1748.
DHowett Jan 26, 2017
3a65494
Fix various leaks in Foundation (#1834)
ehren Jan 26, 2017
7b52eb6
Migrate foundation tests out of woccatalog (#1826)
aballway Jan 26, 2017
2ddfc3c
Updated GLKitComplex sample project with missing textures. (#1842)
Jan 27, 2017
78259bd
Fixing Github issue 1602 and 1689 - sizeThatFits and adjustFontSizeTo…
yiyang-msft Jan 21, 2017
18991b4
Revert "Redo locking and ref counting in NSOperationQueue to be much …
ashvarma Jan 27, 2017
711140f
Revert "Fix various leaks in Foundation (#1834)"
pradipd Jan 27, 2017
bff7cce
Fix #1827 by flipping the context *properly* in UIImage draw.
DHowett Jan 27, 2017
6ca9f70
Reimplement CGContextDrawImage in terms of _CGContextDrawImageRect.
DHowett Jan 27, 2017
73024b5
Created UX test helper class and simplified the tests using the new U…
oliversa-msft Jan 27, 2017
cd24b4c
Fix CGPathEqualToPath Implementation (#1813)
MSFTFox Jan 27, 2017
1ed5a15
Fix islandwood news crash in article view when panning (#1857)
yiyang-msft Jan 27, 2017
2b659f3
Some improvements to RETURN_RESULT_* macros (#1862)
msft-Jeyaram Jan 28, 2017
b56db78
Use _CGContextPushBegin/PopEndDraw for Drawing Tests (#1870)
ms-jihua Jan 28, 2017
794fbfd
Adding macros to enchance return and failure checks. (#1871)
msft-Jeyaram Jan 28, 2017
9aaa5ef
NSURLSession should throw for creating tasks with nil request or resu…
aballway Jan 30, 2017
7a7d48a
Fix starting position of arc in bezierPathWithArcCenter (#1864)
MSFTFox Jan 30, 2017
032d61e
Fixing more UIKit memory leaks (#1863)
jaredhms Jan 30, 2017
991526a
Fix various leaks in Foundation (#1873)
ehren Jan 31, 2017
2a417e3
Remove some dead code from bff7cce92.
DHowett Jan 27, 2017
b77b40d
If the user provides bitmap data, a bitmap context must copy it out.
DHowett Jan 31, 2017
1283b12
[vImage] Don't hire a bitmap context to do our dirty work.
DHowett Jan 31, 2017
189a778
Fix the Accelerate samples to use 32bpp images & proper byte ordering.
DHowett Jan 31, 2017
409c5aa
Fix a missed swap from the format table introduced in 2122f2a18.
DHowett Jan 31, 2017
991023e
Winmd2ObjC update: Fixed inconsistencies with create method and added…
mukhole Feb 1, 2017
6ba205c
Merge remote-tracking branch 'github/develop' into CGD2D.
DHowett Feb 1, 2017
e762f7b
Merge pull request #1892 from Microsoft/CGD2D.
DHowett Feb 1, 2017
1f0515a
Enable vertical pixel-snapping when drawing glyph runs (#1890)
ms-jihua Feb 1, 2017
bb8777c
Remove EbrCenterTextInRectVertically (#1882)
aballway Feb 1, 2017
7f2f36c
Change targets less in CGContext (#1878)
ms-jihua Feb 2, 2017
a60098d
Rewrite portions of EbrFile handling to use UTF16 (#1891)
Feb 2, 2017
26c6891
Updating functionaltest.ps1 so it works in VSTS. (#1896)
pradipd Feb 2, 2017
85f666e
Disabling some NSDecimal subtraction tests on OSX (#1908)
msft-Jeyaram Feb 2, 2017
5a10c6b
Update NSURLSessionConfiguration defaults to support OSX 10.12 (#1905)
msft-Jeyaram Feb 2, 2017
c740efc
Objc2Winmd binary update: (#1913)
mukhole Feb 3, 2017
d69e26a
Add benchmarking test project and add text drawing benchmark tests (#…
aballway Feb 3, 2017
55aa191
Turning of clang modules. (#1914)
pradipd Feb 3, 2017
835069e
Moving windows specific archival test(BackwardsCompatibilityWithOldWi…
msft-Jeyaram Feb 6, 2017
e2d09d5
This change implement UILabel minimumScale (#1918)
yiyang-msft Feb 7, 2017
d1e49e5
SetTempFolder() should take wchar_t instead of char so that we don't …
Feb 7, 2017
f134759
Update Implementation of NSURL.deletingLastPathExtension to OSX 10.12…
msft-Jeyaram Feb 7, 2017
0e83962
Improve performance in __CF_IsBridgedObject/__CF_IsCFObject (#1923)
ms-jihua Feb 7, 2017
63fcfd7
Switch our D2D factory to be multithreaded. (#1911)
DHowett Feb 7, 2017
74ee886
Use block scope thread_local static for NSProgress progress stack (#1…
ehren Feb 7, 2017
0a3efb0
Reintroduce unique_cf's move ctor/assignment.
DHowett Feb 7, 2017
4527ce3
Enabling some image drawing tests, moving image drawing to a separate…
msft-Jeyaram Feb 8, 2017
e6efd44
Fix bug in sizeWithFont (#1917)
aballway Feb 9, 2017
8bbd30f
Framework changes as a prestep towards supporting TAEF tests.
bbowman Feb 9, 2017
125fb08
Add a common test static lib and move all tests to use TAEF under the…
bbowman Feb 9, 2017
58e461e
Small fixes in UTs for debug.
bbowman Feb 10, 2017
02175d6
CoreAnimationTest update - disable unsupported CALayer controls; adds…
oliversa-msft Feb 10, 2017
a4b6974
Change test output location
bbowman Feb 10, 2017
35ca19e
Fix GitHub CI build status reporting
bbowman Feb 11, 2017
f790f56
Fix the Unit Test build break on OS X.
DHowett Feb 10, 2017
650e749
Augment the drawing tests with TAEF-specific behaviour.
DHowett Feb 10, 2017
ee6d1b8
Move UIKit.Xaml DependencyProperty registration out of UIKit.Layer's …
jaredhms Feb 11, 2017
87dd17b
This change includes the addition of a few new features to UIButton. …
jaredhms Feb 13, 2017
682ac52
Partial revert of 8bbd30f739343b5afa73e63a33583cfda10eaf4d (#1957)
bbowman Feb 14, 2017
8f667c3
Fixing lab tests. Also combinining tests into 1 common test. (#1951)
pradipd Feb 14, 2017
293874d
Projection binary update: Fixed ARC issues caused by names starting w…
mukhole Feb 13, 2017
f1db1a2
Projections binary update: fixed annotations for non-object types
mukhole Feb 14, 2017
fd6d4c9
Working around #1965 in UIImageSetLayerContents. (#1967)
jaredhms Feb 14, 2017
972b007
Adding support for borders to UILabel and UIButton (via CALayer and t…
jaredhms Feb 14, 2017
1ec1a84
Supporting gesture subclassing and firing delegates for supporting ge…
yiyang-msft Feb 14, 2017
11530fe
Add support for all CGTextDrawingModes (#1933)
aballway Feb 14, 2017
e6c7e4c
Fixing naming of UIKit.Label helper method: TextBox->TextBlock. (#1970)
jaredhms Feb 15, 2017
a7a8da1
Add support for colored and non-colored Patterns (#1952)
msft-Jeyaram Feb 16, 2017
91d4960
Avoid D2D1Group fill mode conversion for CGPath. (#1954)
MSFTFox Feb 16, 2017
df58be3
Merging from develop for 1702 release
Feb 16, 2017
166d990
Updating version for 1702 release
Feb 17, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.tiff filter=lfs diff=lfs merge=lfs -text
*.nef filter=lfs diff=lfs merge=lfs -text
*.xcf filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.nupkg filter=lfs diff=lfs merge=lfs -text
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ tmp
*.lock.json
.vscode/

*.nuget.targets
*.nuget.props

# Mac desktop service store files
.DS_Store
xcuserdata/
Expand Down
12 changes: 0 additions & 12 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@
[submodule "deps/3rdparty/zlib"]
path = deps/3rdparty/zlib
url = https://github.com/madler/zlib
[submodule "deps/3rdparty/libpng"]
path = deps/3rdparty/libpng
url = git://git.code.sf.net/p/libpng/code
[submodule "deps/3rdparty/freetype2"]
path = deps/3rdparty/freetype2
url = git://git.sv.nongnu.org/freetype/freetype2.git
[submodule "deps/3rdparty/pixman"]
path = deps/3rdparty/pixman
url = git://anongit.freedesktop.org/pixman
[submodule "deps/3rdparty/cairo"]
path = deps/3rdparty/cairo
url = git://anongit.freedesktop.org/git/cairo
[submodule "deps/3rdparty/libobjc2"]
path = deps/3rdparty/libobjc2
url = https://github.com/Microsoft/libobjc2
63 changes: 23 additions & 40 deletions Frameworks/Accelerate/vImage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#import <CoreGraphics/CGImage.h>
#import <CoreGraphics/CoreGraphics.h>
#import "CoreGraphics/CGDataProvider.h"
#import "CGDataProviderInternal.h"
#import <Foundation/Foundation.h>

static const wchar_t* TAG = L"vImage";
Expand Down Expand Up @@ -59,8 +60,6 @@ vImage_Error vImageBuffer_InitWithCGImage(
const CGColorSpaceModel srcCsModel = CGColorSpaceGetModel(srcColorSpace);
const CGBitmapInfo srcBitmapInfo = CGImageGetBitmapInfo(image);

CGColorSpaceRelease(srcColorSpace);

if (srcCsModel != dstCsModel) {
TraceWarning(TAG, L"Colorspace conversions are not yet supported.");
}
Expand All @@ -85,7 +84,7 @@ vImage_Error vImageBuffer_InitWithCGImage(
if (result == kvImageNoError) {
const uint32_t srcPitch = CGImageGetBytesPerRow(image);
const uint32_t dstPitch = buffer->rowBytes;
BYTE* srcData = reinterpret_cast<BYTE*>(_CGImageGetData(image));
const BYTE* srcData = static_cast<const BYTE *>(_CGDataProviderGetData(CGImageGetDataProvider(image)));
BYTE* dstData = reinterpret_cast<BYTE*>(buffer->data);
const uint32_t bytesPerPixel = format->bitsPerPixel >> 3;
const uint32_t bytesToCopy = width * bytesPerPixel;
Expand Down Expand Up @@ -174,49 +173,33 @@ CGImageRef vImageCreateCGImageFromBuffer(vImage_Buffer* buffer,
packedBufferAllocated = false;
}

CGImageRef imageRef;

if ((flags & kvImageNoAllocate) != 0) {
const size_t bufferSize = packedWidthInBytes * buffer->height;
if ((flags & kvImageNoAllocate) != 0) { // Client is self-allocating buffer.
if (packedBufferAllocated) {
TraceWarning(TAG,
L"kvImageNoAllocate flag ignored since padded buffer passed in. Packed buffer allocated and used since padded "
L"buffers can't be used in CGImage.");
}
}

NSData* data = [NSData dataWithBytesNoCopy:packedBuffer length:bufferSize freeWhenDone:YES];

CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData((CFDataRef)data);

imageRef = CGImageCreate((size_t)buffer->width,
(size_t)buffer->height,
(size_t)format->bitsPerComponent,
(size_t)format->bitsPerPixel,
(size_t)packedWidthInBytes,
format->colorSpace,
format->bitmapInfo,
dataProvider,
NULL,
false,
format->renderingIntent);

CGDataProviderRelease(dataProvider);
} else {
CGContextRef ctx = CGBitmapContextCreate(packedBuffer,
(size_t)buffer->width,
(size_t)buffer->height,
(size_t)format->bitsPerComponent,
packedWidthInBytes,
format->colorSpace,
format->bitmapInfo);

imageRef = CGBitmapContextCreateImage(ctx);

CGContextRelease(ctx);

if (packedBufferAllocated == true) {
IwFree(packedBuffer);
}
const size_t bufferSize = packedWidthInBytes * buffer->height;
CGDataProviderRef dataProvider = CGDataProviderCreateWithData(nullptr, packedBuffer, bufferSize, nullptr);

CGImageRef imageRef = CGImageCreate((size_t)buffer->width,
(size_t)buffer->height,
(size_t)format->bitsPerComponent,
(size_t)format->bitsPerPixel,
(size_t)packedWidthInBytes,
format->colorSpace,
format->bitmapInfo,
dataProvider,
NULL,
false,
format->renderingIntent);

CGDataProviderRelease(dataProvider);

if (packedBufferAllocated == true) {
IwFree(packedBuffer);
}

if (imageRef == nullptr) {
Expand Down
6 changes: 6 additions & 0 deletions Frameworks/AutoLayout/AutoLayout.mm
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,12 @@ - (void)autoLayoutLayoutSubviews {
- (BOOL)autoLayoutInvalidateContentSize {
AutoLayoutProperties* layoutProperties = self._autoLayoutProperties;

if (DEBUG_AUTO_LAYOUT_LIGHT) {
TraceVerbose(TAG, L"autoLayoutInvalidateContentSize: %hs(0x%p).",
object_getClassName(self),
self);
}

CGSize newContentSize = [self intrinsicContentSize];
if (CGSizeEqualToSize(layoutProperties->_intrinsicContentSize, newContentSize)) {
if (DEBUG_AUTO_LAYOUT_LIGHT) {
Expand Down
39 changes: 22 additions & 17 deletions Frameworks/CoreFoundation/Base.subproj/CFInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,17 @@ CF_PRIVATE Boolean __CFProcessIsRestricted();
extern "C" Class _OBJC_CLASS__NSCFNumber;
extern "C" Class _OBJC_CLASS__NSCFBoolean;

// WINOBJC: Returns an empty protocol that is assigned only to bridged classes, so that bridged objects can be distinguished quickly
static Protocol* __CFRuntimeGetBridgeProtocol() {
static Protocol* s_bridgeProtocol = []() {
Protocol* ret = objc_allocateProtocol("_NSCFBridgedType");
objc_registerProtocol(ret);
return ret;
}();

return s_bridgeProtocol;
}

#ifdef __CONSTANT_CFSTRINGS__

#if DEPLOYMENT_RUNTIME_SWIFT
Expand Down Expand Up @@ -684,8 +695,7 @@ extern uintptr_t __CFRuntimeObjCClassTable[];
// WINOBJC: helper function to determine if a cf object is a bridged CF object.
CF_INLINE bool __CF_IsBridgedObject(CFTypeRef obj) {
CFRuntimeBase* object = (CFRuntimeBase*)obj;
if (!object ||
(object->_cfisa == 0)) {
if (!object || (object->_cfisa == 0)) {
return false;
}

Expand All @@ -696,28 +706,23 @@ CF_INLINE bool __CF_IsBridgedObject(CFTypeRef obj) {
return true;
}

for (unsigned int i = 0; i < __CFRuntimeClassTableSize; i++) {
if ((__CFRuntimeObjCClassTable[i] != 0) &&
((object->_cfisa == __CFRuntimeObjCClassTable[i]) ||
([object isKindOfClass:(Class)(__CFRuntimeObjCClassTable[i])]))) {
return true;
}
}

return false;
// Check if the object has the 'bridged object' protocol
// NOTE: because our class_conformsToProtocol() checks based only on name,
// it is possible to spoof a bridged object by stating an object conforms to a protocol with the same name.
// However, this would not grant access to anything that could not be accessed by more conventional means
// (ie: overriding an existing CF/Foundation class)
// and as such would not constitute an escalation of privilege.
return class_conformsToProtocol((Class)(object->_cfisa), __CFRuntimeGetBridgeProtocol());
}


// WINOBJC: helper function to determine if an object is actually a CF object.
// Logically this is basically !CF_IS_OBJC except that the expected type is not known ahead of time.
// This is also logically the same as __CF_IsBridgedObject, except for if the object's _cfisa == 0
// (treated as a CF object but not a bridged one)
CF_INLINE bool __CF_IsCFObject(CFTypeRef obj) {
CFRuntimeBase* object = (CFRuntimeBase*)obj;
if ((object->_cfisa == 0) ||
(object->_cfisa == (uintptr_t)(&_OBJC_CLASS__NSCFType)) ||
(object->_cfisa == (uintptr_t)(&_OBJC_CLASS__NSCFString)) ||
(object->_cfisa == (uintptr_t)(&_OBJC_CLASS__NSCFNumber)) ||
(object->_cfisa == (uintptr_t)(&_OBJC_CLASS__NSCFBoolean)) ||
__CF_IsBridgedObject(obj)) {
if ((object->_cfisa == 0) || __CF_IsBridgedObject(obj)) {
return true;
}

Expand Down
8 changes: 8 additions & 0 deletions Frameworks/CoreFoundation/Base.subproj/CFRuntime.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ CFTypeID _CFRuntimeRegisterClass(const CFRuntimeClass * const cls) {
void _CFRuntimeBridgeTypeToClass(CFTypeID cf_typeID, const void *cls_ref) {
__CFLock(&__CFBigRuntimeFunnel);
__CFRuntimeObjCClassTable[cf_typeID] = (uintptr_t)cls_ref;

// WINOBJC: Label the class with the 'bridged object' protocol, so that it can be quickly distinguished from non-bridged objects
class_addProtocol((Class)cls_ref, __CFRuntimeGetBridgeProtocol());

__CFUnlock(&__CFBigRuntimeFunnel);
}

Expand Down Expand Up @@ -1137,6 +1141,10 @@ void __CFInitialize(void) {
for (CFIndex idx = 1; idx < __CFRuntimeClassTableSize; ++idx) {
__CFRuntimeObjCClassTable[idx] = (uintptr_t)&_OBJC_CLASS__NSCFType;
}

// WINOBJC: Label NSCFType with the 'bridged object' protocol
class_addProtocol(_OBJC_CLASS__NSCFType, __CFRuntimeGetBridgeProtocol());

#endif

#if DEPLOYMENT_RUNTIME_SWIFT
Expand Down
35 changes: 26 additions & 9 deletions Frameworks/CoreFoundation/URL.subproj/CFURL.c
Original file line number Diff line number Diff line change
Expand Up @@ -5007,21 +5007,38 @@ CFURLRef CFURLCreateCopyDeletingPathExtension(CFAllocatorRef allocator, CFURLRef
}
#endif

// WINOBJC: The previous implementation deleted invalid extensions.
rg = _rangeOfLastPathComponent(url);
if (rg.location < 0) {
result = NULL;
} else if (rg.length && CFStringFindWithOptions(url->_string, CFSTR("."), rg, kCFCompareBackwards, &dotRg)) {
CFMutableStringRef newString = CFStringCreateMutableCopy(allocator, 0, url->_string);
dotRg.length = rg.location + rg.length - dotRg.location;
CFStringRef lastPathComponent =
CFStringCreateWithSubstring(allocator, url->_string, rg);

if ((rg.location == kCFNotFound) || (lastPathComponent == NULL)) {
// no last path component
result = NULL;
} else {
CFRange primaryExtRange;
_CFGetPathExtensionRangesFromPathComponent(lastPathComponent,
&primaryExtRange, NULL);
if (primaryExtRange.location != kCFNotFound) {
CFMutableStringRef newString =
CFStringCreateMutableCopy(allocator, 0, url->_string);
dotRg.location = rg.location + primaryExtRange.location - 1;
dotRg.length = primaryExtRange.length + 1;
CFStringDelete(newString, dotRg);
result = _CFURLCreateWithArbitraryString(allocator, newString, url->_base);
result =
_CFURLCreateWithArbitraryString(allocator, newString, url->_base);
CFRelease(newString);
} else {
result = (CFURLRef)CFRetain(url);
} else {
// there is no extension to delete
result = static_cast<CFURLRef>(CFRetain(url));
}
CFRelease(lastPathComponent);
}
if ( filePathURLCreated ) {

if (filePathURLCreated) {
CFRelease(url);
}

return result;
}

Expand Down
9 changes: 5 additions & 4 deletions Frameworks/CoreGraphics/CGAffineTransform.mm
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,11 @@ bool CGAffineTransformEqualToTransform(CGAffineTransform t2, CGAffineTransform t
}

/**
@Status Stub
@Notes
@Status Interoperable
*/
CGSize CGSizeApplyAffineTransform(CGSize size, CGAffineTransform t) {
UNIMPLEMENTED();
return StubReturn();
return {
(CGFloat)((double)t.a * size.width + (double)t.c * size.height),
(CGFloat)((double)t.b * size.width + (double)t.d * size.height)
};
}
Loading