From 4527ce3fb869a3bd6676f46c2a8f69d766e8fdc8 Mon Sep 17 00:00:00 2001 From: Ram Date: Wed, 8 Feb 2017 06:44:50 -0800 Subject: [PATCH] =?UTF-8?q?Enabling=20some=20image=20drawing=20tests,=20mo?= =?UTF-8?q?ving=20image=20drawing=20to=20a=20separate=E2=80=A6=20(#1605)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Enabling some image drawing tests, moving image drawing to a separate file and updating some image file names --- .../CoreGraphics.Drawing.UnitTests.vcxproj | 1 + .../CGContextDrawingTests.cpp | 260 +--------------- .../CGContextDrawing_ImageDrawingTests.cpp | 282 ++++++++++++++++++ .../reference/TestImage.CGContext.RedBox.png | 3 + ...CGImageDrawing.DrawAContextIntoAnImage.png | 3 + .../TestImage.CGImageDrawing.DrawAnImage.png | 3 + ...Image.CGImageDrawing.TiledImageCustom.png} | 0 ...CGImageDrawing.TiledImageCustomScaled.png} | 0 ...geDrawing.TiledImageCustomScaledAlpha.png} | 0 ...ageDrawing.TiledImageCustomScaledDown.png} | 0 ...g.TiledImageCustomScaledDownReallyLow.png} | 0 ...Drawing.TiledImageCustomScaledObscure.png} | 0 ...ImageDrawing.TiledImageCustomScaledUp.png} | 0 ...Image.CGImageDrawing.TiledImageFlower.png} | 0 ...CGImageDrawing.TiledImageFlowerScaled.png} | 0 ...eDrawing.TiledImageFlowerScaledAlpha1.png} | 0 ...eDrawing.TiledImageFlowerScaledAlpha2.png} | 0 ...eDrawing.TiledImageFlowerScaledAlpha3.png} | 0 ...ageDrawing.TiledImageFlowerScaledDown.png} | 0 ...ageDrawing.TiledImageFlowerScaledTiny.png} | 0 ...ImageDrawing.TiledImageFlowerScaledUp.png} | 0 ...ageDrawing.TiledImageMultiColorFlower.png} | 0 ...wing.TiledImageMultiColorFlowerScaled.png} | 0 ...ing.TiledImageMultiColorFlowerScaled2.png} | 0 ...TiledImageMultiColorFlowerScaledAlpha.png} | 0 ...iledImageMultiColorFlowerScaledAlpha2.png} | 0 ...iledImageMultiColorFlowerScaledAlpha3.png} | 0 ...mageMultiColorFlowerScaledAspectRatio.png} | 0 ...ultiColorFlowerScaledAspectRatioWrong.png} | 0 ....TiledImageMultiColorFlowerScaledDown.png} | 0 ...ng.TiledImageMultiColorFlowerScaledUp.png} | 0 ...ledImageHeart.png => tiledImageFlower.png} | 0 ...Dog.png => tiledImageMultiColorFlower.png} | 0 33 files changed, 293 insertions(+), 259 deletions(-) create mode 100644 tests/unittests/CoreGraphics.drawing/CGContextDrawing_ImageDrawingTests.cpp create mode 100644 tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.RedBox.png create mode 100644 tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.DrawAContextIntoAnImage.png create mode 100644 tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.DrawAnImage.png rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageCustom.png => TestImage.CGImageDrawing.TiledImageCustom.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageCustomScaled.png => TestImage.CGImageDrawing.TiledImageCustomScaled.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageCustomScaledAlpha.png => TestImage.CGImageDrawing.TiledImageCustomScaledAlpha.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageCustomScaledDown.png => TestImage.CGImageDrawing.TiledImageCustomScaledDown.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageCustomScaledDownReallyLow.png => TestImage.CGImageDrawing.TiledImageCustomScaledDownReallyLow.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageCustomScaledObscure.png => TestImage.CGImageDrawing.TiledImageCustomScaledObscure.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageCustomScaledUp.png => TestImage.CGImageDrawing.TiledImageCustomScaledUp.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageHeart.png => TestImage.CGImageDrawing.TiledImageFlower.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageHeartScaled.png => TestImage.CGImageDrawing.TiledImageFlowerScaled.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageHeartScaledAlpha1.png => TestImage.CGImageDrawing.TiledImageFlowerScaledAlpha1.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageHeartScaledAlpha2.png => TestImage.CGImageDrawing.TiledImageFlowerScaledAlpha2.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageHeartScaledAlpha3.png => TestImage.CGImageDrawing.TiledImageFlowerScaledAlpha3.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageHeartScaledDown.png => TestImage.CGImageDrawing.TiledImageFlowerScaledDown.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageHeartScaledTiny.png => TestImage.CGImageDrawing.TiledImageFlowerScaledTiny.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageHeartScaledUp.png => TestImage.CGImageDrawing.TiledImageFlowerScaledUp.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageDog.png => TestImage.CGImageDrawing.TiledImageMultiColorFlower.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageDogScaled.png => TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaled.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageDogScaled2.png => TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaled2.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageDogScaledAlpha.png => TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAlpha.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageDogScaledAlpha2.png => TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAlpha2.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageDogScaledAlpha3.png => TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAlpha3.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageDogScaledAspectRatio.png => TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAspectRatio.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageDogScaledAspectRatioWrong.png => TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAspectRatioWrong.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageDogScaledDown.png => TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledDown.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.TiledImageDogScaledUp.png => TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledUp.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/{tiledImageHeart.png => tiledImageFlower.png} (100%) rename tests/unittests/CoreGraphics.drawing/data/{tiledImageDog.png => tiledImageMultiColorFlower.png} (100%) diff --git a/build/Tests/UnitTests/CoreGraphics.Drawing/CoreGraphics.Drawing.UnitTests.vcxproj b/build/Tests/UnitTests/CoreGraphics.Drawing/CoreGraphics.Drawing.UnitTests.vcxproj index ff8ac7947f..76db45d64a 100644 --- a/build/Tests/UnitTests/CoreGraphics.Drawing/CoreGraphics.Drawing.UnitTests.vcxproj +++ b/build/Tests/UnitTests/CoreGraphics.Drawing/CoreGraphics.Drawing.UnitTests.vcxproj @@ -250,6 +250,7 @@ + diff --git a/tests/UnitTests/CoreGraphics.drawing/CGContextDrawingTests.cpp b/tests/UnitTests/CoreGraphics.drawing/CGContextDrawingTests.cpp index e95f70a4c5..d723a1f4b6 100644 --- a/tests/UnitTests/CoreGraphics.drawing/CGContextDrawingTests.cpp +++ b/tests/UnitTests/CoreGraphics.drawing/CGContextDrawingTests.cpp @@ -239,237 +239,7 @@ DISABLED_DRAW_TEST_F(CGContext, PatternFillWindowsLogoPath, UIKitMimicTest<>) { CGPathRelease(thepath); } -#ifdef WINOBJC -#include "CGContextInternal.h" - -DISABLED_DRAW_TEST_F(CGContext, DrawIntoRect, UIKitMimicTest<>) { - // Draw a portion of an image into a different region. - auto drawingConfig = DrawingTestConfig::Get(); - - woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath("png1.9.png")) }; - woc::unique_cf image{ _CGImageCreateFromPNGFile(testFilename.get()) }; - ASSERT_NE(image, nullptr); - - CGContextRef context = GetDrawingContext(); - CGRect bounds = GetDrawingBounds(); - - CGAffineTransform flip = CGAffineTransformMakeScale(1, -1); - CGAffineTransform shift = CGAffineTransformTranslate(flip, 0, bounds.size.height * -1); - CGContextConcatCTM(context, shift); - - _CGContextDrawImageRect(context, - image.get(), - { 0, 0, bounds.size.width / 4, bounds.size.height / 4 }, - { 0, 0, bounds.size.width, bounds.size.height }); -} -#endif - -static void _drawTiledImage(CGContextRef context, CGRect rect, const std::string& name) { - auto drawingConfig = DrawingTestConfig::Get(); - woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath(name)) }; - woc::unique_cf image{ _CGImageCreateFromPNGFile(testFilename.get()) }; - ASSERT_NE(image, nullptr); - CGContextDrawTiledImage(context, rect, image.get()); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageHeart, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 128, 128 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageHeart.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageHeartScaledUp, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 250, 250 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageHeart.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageHeartScaledTiny, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 1, 1 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageHeart.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageHeartScaledAlpha1, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 100, 100 } }; - CGContextSetAlpha(GetDrawingContext(), 0.8); - _drawTiledImage(GetDrawingContext(), rect, "tiledImageHeart.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageHeartScaledAlpha2, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 256, 256 } }; - CGContextSetAlpha(GetDrawingContext(), 0.24); - _drawTiledImage(GetDrawingContext(), rect, "tiledImageHeart.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageHeartScaledAlpha3, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 300, 513 } }; - CGContextSetAlpha(GetDrawingContext(), 0.66); - _drawTiledImage(GetDrawingContext(), rect, "tiledImageHeart.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageHeartScaledDown, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 50, 50 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageHeart.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageHeartScaled, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 250, 128 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageHeart.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageDog, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 256, 256 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageDog.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageDogScaledDown, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 50, 50 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageDog.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageDogScaledUp, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 512, 512 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageDog.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageDogScaled, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 350, 500 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageDog.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageDogScaled2, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 128, 240 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageDog.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageDogScaledAspectRatioWrong, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 1024, 25 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageDog.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageDogScaledAspectRatio, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 1024, 1024 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageDog.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageDogScaledAlpha, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 100, 100 } }; - CGContextSetAlpha(GetDrawingContext(), 0.8); - _drawTiledImage(GetDrawingContext(), rect, "tiledImageDog.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageDogScaledAlpha2, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 256, 256 } }; - CGContextSetAlpha(GetDrawingContext(), 0.24); - _drawTiledImage(GetDrawingContext(), rect, "tiledImageDog.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageDogScaledAlpha3, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 300, 513 } }; - CGContextSetAlpha(GetDrawingContext(), 0.66); - _drawTiledImage(GetDrawingContext(), rect, "tiledImageDog.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageCustom, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 562, 469 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageCustomScaledUp, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 2050, 2050 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageCustomScaledDown, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 20, 20 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageCustomScaledDownReallyLow, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 1, 1 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageCustomScaled, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 10, 250 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageCustomScaledObscure, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 253, 13 } }; - _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, TiledImageCustomScaledAlpha, UIKitMimicTest<>) { - CGRect rect = { { 0, 0 }, { 128, 128 } }; - CGContextSetAlpha(GetDrawingContext(), 0.88); - _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); -} - -DISABLED_DRAW_TEST_F(CGContext, DrawAnImage, UIKitMimicTest<>) { - // Load an Image and draw it into the canvas context - auto drawingConfig = DrawingTestConfig::Get(); - - woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath("jpg1.jpg")) }; - woc::unique_cf image{ _CGImageCreateFromJPEGFile(testFilename.get()) }; - ASSERT_NE(image, nullptr); - - CGContextRef context = GetDrawingContext(); - CGRect bounds = GetDrawingBounds(); - - CGAffineTransform flip = CGAffineTransformMakeScale(1, -1); - CGAffineTransform shift = CGAffineTransformTranslate(flip, 0, bounds.size.height * -1); - CGContextConcatCTM(context, shift); - - CGContextDrawImage(context, bounds, image.get()); -} - -DRAW_TEST_F(CGContext, DrawAnImageWithOpacity, UIKitMimicTest<>) { - // Load an Image and draw it into the canvas context - auto drawingConfig = DrawingTestConfig::Get(); - - woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath("png1.9.png")) }; - woc::unique_cf image{ _CGImageCreateFromPNGFile(testFilename.get()) }; - ASSERT_NE(image, nullptr); - - CGContextRef context = GetDrawingContext(); - CGRect bounds = GetDrawingBounds(); - - CGAffineTransform flip = CGAffineTransformMakeScale(1, -1); - CGAffineTransform shift = CGAffineTransformTranslate(flip, 0, bounds.size.height * -1); - CGContextConcatCTM(context, shift); - - CGContextSetAlpha(context, 0.7); - CGContextDrawImage(context, bounds, image.get()); -} - -DRAW_TEST_F(CGContext, DrawAnImageWithInterpolationQuality, UIKitMimicTest<>) { - auto drawingConfig = DrawingTestConfig::Get(); - - woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath("png1.9.png")) }; - woc::unique_cf image{ _CGImageCreateFromPNGFile(testFilename.get()) }; - ASSERT_NE(image, nullptr); - - CGContextRef context = GetDrawingContext(); - CGRect bounds = GetDrawingBounds(); - - CGContextSetInterpolationQuality(context, kCGInterpolationLow); - CGContextDrawImage(context, bounds, image.get()); -} - -DRAW_TEST_F(CGContext, DrawAnImageWithInterpolationQualityAndAlpha, UIKitMimicTest<>) { - auto drawingConfig = DrawingTestConfig::Get(); - woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath("png1.9.png")) }; - woc::unique_cf image{ _CGImageCreateFromPNGFile(testFilename.get()) }; - ASSERT_NE(image, nullptr); - - CGContextRef context = GetDrawingContext(); - CGRect bounds = GetDrawingBounds(); - - CGContextSetAlpha(context, 0.25); - CGContextSetInterpolationQuality(context, kCGInterpolationHigh); - CGContextDrawImage(context, bounds, image.get()); -} - -DISABLED_DRAW_TEST_F(CGContext, RedBox, UIKitMimicTest<>) { +DRAW_TEST_F(CGContext, RedBox, UIKitMimicTest<>) { CGContextRef context = GetDrawingContext(); CGRect bounds = GetDrawingBounds(); @@ -477,34 +247,6 @@ DISABLED_DRAW_TEST_F(CGContext, RedBox, UIKitMimicTest<>) { CGContextFillRect(context, CGRectInset(bounds, 10, 10)); } -DISABLED_DRAW_TEST_F(CGContext, DrawAContextIntoAnImage, UIKitMimicTest<>) { - // This test will create a bitmap context, draw some entity into the context, then create a image out of the bitmap context. - // Thereafter it will draw the image into the Canvas context - - static woc::unique_cf rgbColorSpace(CGColorSpaceCreateDeviceRGB()); - // Create a bitmap context to draw the Image into - woc::unique_cf contextImage(CGBitmapContextCreate( - nullptr, 10, 10, 8, 4 * 10 /* bytesPerRow = bytesPerPixel*width*/, rgbColorSpace.get(), kCGImageAlphaPremultipliedFirst)); - ASSERT_NE(contextImage, nullptr); - - CGContextSetRGBFillColor(contextImage.get(), 1.0, 0.0, 0.0, 1.0); - CGContextFillRect(contextImage.get(), { 0, 0, 10, 10 }); - - // Create the image out of the bitmap context - woc::unique_cf image(CGBitmapContextCreateImage(contextImage.get())); - ASSERT_NE(image, nullptr); - - CGContextRef context = GetDrawingContext(); - CGRect bounds = GetDrawingBounds(); - - CGAffineTransform flip = CGAffineTransformMakeScale(1, -1); - CGAffineTransform shift = CGAffineTransformTranslate(flip, 0, bounds.size.height * -1); - CGContextConcatCTM(context, shift); - - // draw the image - CGContextDrawImage(context, bounds, image.get()); -} - DISABLED_DRAW_TEST_F(CGContext, FillThenStrokeIsSameAsDrawFillStroke, WhiteBackgroundTest<>) { CGContextRef context = GetDrawingContext(); CGRect bounds = GetDrawingBounds(); diff --git a/tests/unittests/CoreGraphics.drawing/CGContextDrawing_ImageDrawingTests.cpp b/tests/unittests/CoreGraphics.drawing/CGContextDrawing_ImageDrawingTests.cpp new file mode 100644 index 0000000000..4692871f48 --- /dev/null +++ b/tests/unittests/CoreGraphics.drawing/CGContextDrawing_ImageDrawingTests.cpp @@ -0,0 +1,282 @@ +//****************************************************************************** +// +// Copyright (c) Microsoft. All rights reserved. +// +// This code is licensed under the MIT License (MIT). +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +//****************************************************************************** + +#include "DrawingTest.h" +#include "DrawingTestConfig.h" +#include "ImageHelpers.h" + +#pragma region TiledImageDrawing +static void _drawTiledImage(CGContextRef context, CGRect rect, const std::string& name) { + auto drawingConfig = DrawingTestConfig::Get(); + woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath(name)) }; + woc::unique_cf image{ _CGImageCreateFromPNGFile(testFilename.get()) }; + ASSERT_NE(image, nullptr); + CGContextDrawTiledImage(context, rect, image.get()); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageFlower, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 128, 128 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageFlowerScaledUp, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 250, 250 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageFlowerScaledTiny, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 1, 1 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageFlowerScaledAlpha1, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 100, 100 } }; + CGContextSetAlpha(GetDrawingContext(), 0.8); + _drawTiledImage(GetDrawingContext(), rect, "tiledImageFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageFlowerScaledAlpha2, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 256, 256 } }; + CGContextSetAlpha(GetDrawingContext(), 0.24); + _drawTiledImage(GetDrawingContext(), rect, "tiledImageFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageFlowerScaledAlpha3, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 300, 513 } }; + CGContextSetAlpha(GetDrawingContext(), 0.66); + _drawTiledImage(GetDrawingContext(), rect, "tiledImageFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageFlowerScaledDown, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 50, 50 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageFlowerScaled, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 250, 128 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageMultiColorFlower, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 256, 256 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageMultiColorFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageMultiColorFlowerScaledDown, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 50, 50 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageMultiColorFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageMultiColorFlowerScaledUp, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 512, 512 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageMultiColorFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageMultiColorFlowerScaled, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 350, 500 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageMultiColorFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageMultiColorFlowerScaled2, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 128, 240 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageMultiColorFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageMultiColorFlowerScaledAspectRatioWrong, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 1024, 25 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageMultiColorFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageMultiColorFlowerScaledAspectRatio, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 1024, 1024 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageMultiColorFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageMultiColorFlowerScaledAlpha, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 100, 100 } }; + CGContextSetAlpha(GetDrawingContext(), 0.8); + _drawTiledImage(GetDrawingContext(), rect, "tiledImageMultiColorFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageMultiColorFlowerScaledAlpha2, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 256, 256 } }; + CGContextSetAlpha(GetDrawingContext(), 0.24); + _drawTiledImage(GetDrawingContext(), rect, "tiledImageMultiColorFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageMultiColorFlowerScaledAlpha3, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 300, 513 } }; + CGContextSetAlpha(GetDrawingContext(), 0.66); + _drawTiledImage(GetDrawingContext(), rect, "tiledImageMultiColorFlower.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageCustom, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 562, 469 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageCustomScaledUp, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 2050, 2050 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageCustomScaledDown, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 20, 20 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageCustomScaledDownReallyLow, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 1, 1 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageCustomScaled, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 10, 250 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageCustomScaledObscure, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 253, 13 } }; + _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); +} + +DISABLED_DRAW_TEST_F(CGImageDrawing, TiledImageCustomScaledAlpha, UIKitMimicTest<>) { + CGRect rect = { { 0, 0 }, { 128, 128 } }; + CGContextSetAlpha(GetDrawingContext(), 0.88); + _drawTiledImage(GetDrawingContext(), rect, "tiledImageCircleMe.png"); +} +#pragma endregion TiledImageDrawing + +#pragma region DrawingToCanvas + +#ifdef WINOBJC +#include "CGContextInternal.h" + +DISABLED_DRAW_TEST_F(CGImageDrawing, DrawIntoRect, UIKitMimicTest<>) { + // Draw a portion of an image into a different region. + auto drawingConfig = DrawingTestConfig::Get(); + + woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath("png3.9.png")) }; + woc::unique_cf image{ _CGImageCreateFromPNGFile(testFilename.get()) }; + ASSERT_NE(image, nullptr); + + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGAffineTransform flip = CGAffineTransformMakeScale(1, -1); + CGAffineTransform shift = CGAffineTransformTranslate(flip, 0, bounds.size.height * -1); + CGContextConcatCTM(context, shift); + + _CGContextDrawImageRect(context, + image.get(), + { 0, 0, bounds.size.width / 4, bounds.size.height / 4 }, + { 0, 0, bounds.size.width, bounds.size.height }); +} +#endif + +DRAW_TEST_F(CGImageDrawing, DrawAnImage, UIKitMimicTest<>) { + // Load an Image and draw it into the canvas context + auto drawingConfig = DrawingTestConfig::Get(); + + woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath("jpg1.jpg")) }; + woc::unique_cf image{ _CGImageCreateFromJPEGFile(testFilename.get()) }; + ASSERT_NE(image, nullptr); + + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGAffineTransform flip = CGAffineTransformMakeScale(1, -1); + CGAffineTransform shift = CGAffineTransformTranslate(flip, 0, bounds.size.height * -1); + CGContextConcatCTM(context, shift); + + CGContextDrawImage(context, bounds, image.get()); +} + +DRAW_TEST_F(CGContext, DrawAnImageWithOpacity, UIKitMimicTest<>) { + // Load an Image and draw it into the canvas context + auto drawingConfig = DrawingTestConfig::Get(); + + woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath("png1.9.png")) }; + woc::unique_cf image{ _CGImageCreateFromPNGFile(testFilename.get()) }; + ASSERT_NE(image, nullptr); + + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGAffineTransform flip = CGAffineTransformMakeScale(1, -1); + CGAffineTransform shift = CGAffineTransformTranslate(flip, 0, bounds.size.height * -1); + CGContextConcatCTM(context, shift); + + CGContextSetAlpha(context, 0.7); + CGContextDrawImage(context, bounds, image.get()); +} + +DRAW_TEST_F(CGContext, DrawAnImageWithInterpolationQuality, UIKitMimicTest<>) { + auto drawingConfig = DrawingTestConfig::Get(); + + woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath("png1.9.png")) }; + woc::unique_cf image{ _CGImageCreateFromPNGFile(testFilename.get()) }; + ASSERT_NE(image, nullptr); + + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGContextSetInterpolationQuality(context, kCGInterpolationLow); + CGContextDrawImage(context, bounds, image.get()); +} + +DRAW_TEST_F(CGContext, DrawAnImageWithInterpolationQualityAndAlpha, UIKitMimicTest<>) { + auto drawingConfig = DrawingTestConfig::Get(); + woc::unique_cf testFilename{ _CFStringCreateWithStdString(drawingConfig->GetResourcePath("png1.9.png")) }; + woc::unique_cf image{ _CGImageCreateFromPNGFile(testFilename.get()) }; + ASSERT_NE(image, nullptr); + + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGContextSetAlpha(context, 0.25); + CGContextSetInterpolationQuality(context, kCGInterpolationHigh); + CGContextDrawImage(context, bounds, image.get()); +} + +DRAW_TEST_F(CGImageDrawing, DrawAContextIntoAnImage, UIKitMimicTest<>) { + // This test will create a bitmap context, draw some entity into the context, then create a image out of the bitmap context. + // Thereafter it will draw the image into the Canvas context + + static woc::unique_cf rgbColorSpace(CGColorSpaceCreateDeviceRGB()); + // Create a bitmap context to draw the Image into + woc::unique_cf contextImage(CGBitmapContextCreate( + nullptr, 10, 10, 8, 4 * 10 /* bytesPerRow = bytesPerPixel*width*/, rgbColorSpace.get(), kCGImageAlphaPremultipliedFirst)); + ASSERT_NE(contextImage, nullptr); + + CGContextSetRGBFillColor(contextImage.get(), 1.0, 0.0, 0.0, 1.0); + CGContextFillRect(contextImage.get(), { 0, 0, 10, 10 }); + + // Create the image out of the bitmap context + woc::unique_cf image(CGBitmapContextCreateImage(contextImage.get())); + ASSERT_NE(image, nullptr); + + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGAffineTransform flip = CGAffineTransformMakeScale(1, -1); + CGAffineTransform shift = CGAffineTransformTranslate(flip, 0, bounds.size.height * -1); + CGContextConcatCTM(context, shift); + + // draw the image + CGContextDrawImage(context, bounds, image.get()); +} +#pragma endregion DrawingToCanvas \ No newline at end of file diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.RedBox.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.RedBox.png new file mode 100644 index 0000000000..d6e6c35ecc --- /dev/null +++ b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.RedBox.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:591b4932e3d1585f38b0cae499d9ba89c500a66eab6d26c80b2c447fa9e9493d +size 11186 diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.DrawAContextIntoAnImage.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.DrawAContextIntoAnImage.png new file mode 100644 index 0000000000..ad85a77718 --- /dev/null +++ b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.DrawAContextIntoAnImage.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33d915050f05e75cf606d02438d99fb9a1741e92dffbd503c7e5f617411fe87b +size 10310 diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.DrawAnImage.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.DrawAnImage.png new file mode 100644 index 0000000000..c78c8a2a63 --- /dev/null +++ b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.DrawAnImage.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:991fad944afe1b47b2b6d7495ade0cd5dccd584c37a2372d86c01e42cbe7e4a5 +size 577337 diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustom.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustom.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustom.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustom.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaled.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaled.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaled.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaled.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaledAlpha.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaledAlpha.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaledAlpha.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaledAlpha.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaledDown.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaledDown.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaledDown.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaledDown.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaledDownReallyLow.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaledDownReallyLow.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaledDownReallyLow.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaledDownReallyLow.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaledObscure.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaledObscure.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaledObscure.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaledObscure.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaledUp.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaledUp.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageCustomScaledUp.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageCustomScaledUp.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeart.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlower.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeart.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlower.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaled.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaled.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaled.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaled.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledAlpha1.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledAlpha1.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledAlpha1.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledAlpha1.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledAlpha2.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledAlpha2.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledAlpha2.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledAlpha2.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledAlpha3.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledAlpha3.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledAlpha3.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledAlpha3.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledDown.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledDown.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledDown.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledDown.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledTiny.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledTiny.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledTiny.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledTiny.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledUp.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledUp.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageHeartScaledUp.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageFlowerScaledUp.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDog.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlower.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDog.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlower.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaled.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaled.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaled.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaled.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaled2.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaled2.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaled2.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaled2.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledAlpha.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAlpha.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledAlpha.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAlpha.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledAlpha2.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAlpha2.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledAlpha2.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAlpha2.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledAlpha3.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAlpha3.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledAlpha3.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAlpha3.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledAspectRatio.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAspectRatio.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledAspectRatio.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAspectRatio.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledAspectRatioWrong.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAspectRatioWrong.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledAspectRatioWrong.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledAspectRatioWrong.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledDown.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledDown.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledDown.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledDown.png diff --git a/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledUp.png b/tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledUp.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGContext.TiledImageDogScaledUp.png rename to tests/unittests/CoreGraphics.drawing/data/reference/TestImage.CGImageDrawing.TiledImageMultiColorFlowerScaledUp.png diff --git a/tests/unittests/CoreGraphics.drawing/data/tiledImageHeart.png b/tests/unittests/CoreGraphics.drawing/data/tiledImageFlower.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/tiledImageHeart.png rename to tests/unittests/CoreGraphics.drawing/data/tiledImageFlower.png diff --git a/tests/unittests/CoreGraphics.drawing/data/tiledImageDog.png b/tests/unittests/CoreGraphics.drawing/data/tiledImageMultiColorFlower.png similarity index 100% rename from tests/unittests/CoreGraphics.drawing/data/tiledImageDog.png rename to tests/unittests/CoreGraphics.drawing/data/tiledImageMultiColorFlower.png