-
Notifications
You must be signed in to change notification settings - Fork 806
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46d8097
commit 81c6ff3
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,7 @@ void _TestPixelFormat(const CGRect bounds, const CGBitmapInfo info, DWORD expect | |
); | ||
} | ||
|
||
static void _expectArrayValues(BYTE* res, BYTE* source, int size) { | ||
static void _expectArrayValues(const BYTE* res, const BYTE* source, int size) { | ||
for (int i = 0; i < size; ++i) { | ||
EXPECT_EQ(res[i], source[i]); | ||
} | ||
|
@@ -209,9 +209,9 @@ static void _expectArrayValues(BYTE* res, BYTE* source, int size) { | |
woc::unique_cf<CGImageRef> image(CGBitmapContextCreateImage(context.get())); | ||
ASSERT_NE(image, nullptr); | ||
|
||
NSData* dataProvider = static_cast<NSData*>(CGImageGetDataProvider(image.get())); | ||
ASSERT_NE(dataProvider, nullptr); | ||
woc::unique_cf<CFDataRef> rawData(CGDataProviderCopyData(CGImageGetDataProvider(image.get()))); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
msft-Jeyaram
Author
Contributor
|
||
ASSERT_NE(rawData, nullptr); | ||
|
||
NSData* ref = [[NSData dataWithBytesNoCopy:result length:4 freeWhenDone:NO] autorelease]; | ||
ASSERT_OBJCEQ(dataProvider, ref); | ||
const BYTE* rData = static_cast<const BYTE*>(CFDataGetBytePtr(rawData.get())); | ||
_expectArrayValues(result, rData, 4); | ||
} |
Sorry, what I meant to ask was:
If you get the data provider for a CGImage created from a CGBitmapContext on the reference platform, do you get direct (copying) access to its backing store/buffer?