From 0ef9580d450228ef4fa47ada42b06b626944682e Mon Sep 17 00:00:00 2001 From: Jeyaram Jeyaraj Date: Wed, 22 Feb 2017 20:42:01 -0800 Subject: [PATCH 1/4] Adding support for ClearRect with clipping geometry --- Frameworks/CoreGraphics/CGContext.mm | 51 ++++-- .../CoreGraphics.Drawing.UnitTests.vcxproj | 1 + .../CGContextDrawing_ClearRectTests.cpp | 172 ++++++++++++++++++ ...(0.0)100x100.[0.3,0.0,0.0,0.8,0.0,0.0].png | 3 + ...0.0)100x100.[0.9,0.4,-0.4,0.9,0.0,0.0].png | 3 + ...(0.0)100x100.[1.0,0.0,0.0,1.0,0.0,0.0].png | 3 + ...(0.0)100x100.[1.0,0.0,0.0,1.0,3.0,6.0].png | 3 + ...(0.0)100x100.[1.0,0.0,0.3,1.0,0.0,0.0].png | 3 + ....(0.0)50x250.[0.3,0.0,0.0,0.8,0.0,0.0].png | 3 + ...(0.0)50x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png | 3 + ....(0.0)50x250.[1.0,0.0,0.0,1.0,0.0,0.0].png | 3 + ....(0.0)50x250.[1.0,0.0,0.0,1.0,3.0,6.0].png | 3 + ....(0.0)50x250.[1.0,0.0,0.3,1.0,0.0,0.0].png | 3 + ....100)125x250.[0.3,0.0,0.0,0.8,0.0,0.0].png | 3 + ...100)125x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png | 3 + ....100)125x250.[1.0,0.0,0.0,1.0,0.0,0.0].png | 3 + ....100)125x250.[1.0,0.0,0.0,1.0,3.0,6.0].png | 3 + ....100)125x250.[1.0,0.0,0.3,1.0,0.0,0.0].png | 3 + ....png => TestImage.CGContext.ClearRect.png} | 0 ...e.CGContext.ClearRectTransparencyLayer.png | 3 + ...estImage.CGContext.CustomPathClearRect.png | 3 + .../CGContextDrawing_FillTests.cpp | 31 ++++ 22 files changed, 294 insertions(+), 12 deletions(-) create mode 100644 tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.3,0.0,0.0,0.8,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.9,0.4,-0.4,0.9,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,3.0,6.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.3,1.0,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.3,0.0,0.0,0.8,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,3.0,6.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.3,1.0,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.3,0.0,0.0,0.8,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,3.0,6.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.3,1.0,0.0,0.0].png rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContextFill.ClearRect.png => TestImage.CGContext.ClearRect.png} (100%) create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRectTransparencyLayer.png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.CustomPathClearRect.png diff --git a/Frameworks/CoreGraphics/CGContext.mm b/Frameworks/CoreGraphics/CGContext.mm index 58077953c0..c9796c6f58 100644 --- a/Frameworks/CoreGraphics/CGContext.mm +++ b/Frameworks/CoreGraphics/CGContext.mm @@ -270,6 +270,8 @@ inline HRESULT GetTarget(ID2D1Image** pTarget) { woc::unique_cf _fillColorSpace; woc::unique_cf _strokeColorSpace; + ComPtr transparentBrush{ nullptr }; + // Keeps track of the depth of a 'stack' of PushBeginDraw/PopEndDraw calls // Since nothing needs to actually be put on a stack, just increment a counter insteads std::atomic_uint32_t _beginEndDrawDepth = { 0 }; @@ -491,6 +493,7 @@ inline HRESULT PopEndDraw() { HRESULT PushLayer(CGRect* rect = nullptr); HRESULT PopLayer(); + HRESULT ClearRect(CGRect rect); template // Lambda takes the form HRESULT (*)(CGContextRef, ID2D1DeviceContext*) HRESULT Draw(_CGCoordinateMode coordinateMode, CGAffineTransform* additionalTransform, Lambda&& drawLambda); @@ -2297,22 +2300,46 @@ void CGContextShowGlyphsWithAdvances(CGContextRef context, const CGGlyph* glyphs #pragma endregion #pragma region Drawing Operations - Basic Shapes + +HRESULT __CGContext::ClearRect(CGRect rect) { + PushBeginDraw(); + auto endDraw = wil::ScopeExit([this]() { PopEndDraw(); }); + + ComPtr factory = Factory(); + ComPtr rectangle; + RETURN_IF_FAILED(factory->CreateRectangleGeometry(__CGRectToD2D_F(rect), &rectangle)); + + // Transformed geometry + ComPtr transformedRectangle; + RETURN_IF_FAILED(factory->CreateTransformedGeometry(rectangle.Get(), + __CGAffineTransformToD2D_F(CGContextGetUserSpaceToDeviceSpaceTransform(this)), + &transformedRectangle)); + + RETURN_IF_FAILED(PushGState()); + + if (CurrentGState().shouldAntialias != _kCGTrinaryDefault || !allowsAntialiasing) { + deviceContext->SetAntialiasMode(GetAntialiasMode()); + } + + RETURN_IF_FAILED(CurrentGState().IntersectClippingGeometry(transformedRectangle.Get(), kCGPathEOFill)); + + if (!transparentBrush) { + RETURN_IF_FAILED(deviceContext->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::Black, 0.0f), &transparentBrush)); + } + + deviceContext->SetPrimitiveBlend(D2D1_PRIMITIVE_BLEND_COPY); + deviceContext->FillGeometry(CurrentGState().clippingGeometry.Get(), transparentBrush.Get()); + deviceContext->SetPrimitiveBlend(D2D1_PRIMITIVE_BLEND_SOURCE_OVER); + RETURN_IF_FAILED(PopGState()); + return S_OK; +} + /** - @Status Caveat - @Notes only supports the scenario where clipping is not set. - Also only works on untransformed coordinates. - The cleared region will be cleared in device space. + @Status Interoperable */ void CGContextClearRect(CGContextRef context, CGRect rect) { NOISY_RETURN_IF_NULL(context); - ComPtr deviceContext = context->DeviceContext(); - if (!context->CurrentGState().clippingGeometry) { - _CGContextPushBeginDraw(context); - deviceContext->PushAxisAlignedClip(__CGRectToD2D_F(rect), context->GetAntialiasMode()); - deviceContext->Clear(nullptr); // transparent black clear - deviceContext->PopAxisAlignedClip(); - _CGContextPopEndDraw(context); - } + FAIL_FAST_IF_FAILED(context->ClearRect(rect)); } HRESULT __CGContext::_CreateShadowEffect(ID2D1Image* inputImage, ID2D1Effect** outShadowEffect) { diff --git a/build/Tests/UnitTests/CoreGraphics.Drawing/CoreGraphics.Drawing.UnitTests.vcxproj b/build/Tests/UnitTests/CoreGraphics.Drawing/CoreGraphics.Drawing.UnitTests.vcxproj index f6d30b0770..d0eb625261 100644 --- a/build/Tests/UnitTests/CoreGraphics.Drawing/CoreGraphics.Drawing.UnitTests.vcxproj +++ b/build/Tests/UnitTests/CoreGraphics.Drawing/CoreGraphics.Drawing.UnitTests.vcxproj @@ -247,6 +247,7 @@ + diff --git a/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp b/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp new file mode 100644 index 0000000000..5a1cf3e43b --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp @@ -0,0 +1,172 @@ +//****************************************************************************** +// +// 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" + +#pragma region ClearRect + +class CGClearRect : public WhiteBackgroundTest<>, public ::testing::WithParamInterface<::testing::tuple> { + CFStringRef CreateOutputFilename() { + CGRect rect = ::testing::get<0>(GetParam()); + CGAffineTransform transformation = ::testing::get<1>(GetParam()); + + return CFStringCreateWithFormat(nullptr, + nullptr, + CFSTR("TestImage.CGContext.ClearRect.(%0.0f.%0.0f)%0.0fx%0.0f.[%0.1f,%0." + "1f,%0.1f,%0.1f,%0.1f,%0.1f].png"), + rect.origin.x, + rect.origin.y, + rect.size.width, + rect.size.height, + transformation.a, + transformation.b, + transformation.c, + transformation.d, + transformation.tx, + transformation.ty); + } +}; + +DRAW_TEST_P(CGClearRect, Transformed) { + CGRect rect = ::testing::get<0>(GetParam()); + CGAffineTransform transformation = ::testing::get<1>(GetParam()); + + CGContextRef context = GetDrawingContext(); + + CGContextAddRect(context, CGRectMake(100, 50, 50, 50)); + CGContextConcatCTM(context, transformation); + CGContextClip(context); + + CGContextSetRGBFillColor(context, 0.48, 0.73, 0, 1); + CGContextClearRect(context, rect); +} + +DRAW_TEST_P(CGClearRect, Transformed2) { + CGRect rect = ::testing::get<0>(GetParam()); + CGAffineTransform transformation = ::testing::get<1>(GetParam()); + + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGContextAddRect(context, CGRectMake(0, 0, 250, 250)); + CGContextConcatCTM(context, transformation); + CGContextClip(context); + + CGContextSetRGBFillColor(context, 0.48, 0.73, 0, 1); + CGContextClearRect(context, rect); +} + +static CGRect rects[] = { CGRectMake(0, 0, 100, 100), CGRectMake(0, 0, 50, 250), CGRectMake(100, 100, 125, 250) }; +static CGAffineTransform transformation[] = { CGAffineTransformMakeRotation(0.4), + CGAffineTransformMakeTranslation(3, 6), + CGAffineTransformMakeScale(0.25, 0.75), + CGAffineTransformMake(1.f, 0.f, 0.3f, 1.f, 0.f, 0.f), + CGAffineTransformIdentity }; + +INSTANTIATE_TEST_CASE_P(CGContextTests, CGClearRect, ::testing::Combine(::testing::ValuesIn(rects), ::testing::ValuesIn(transformation))); + +DRAW_TEST_F(CGContext, ClearRect, WhiteBackgroundTest<>) { + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1); + CGContextFillRect(context, bounds); + + CGRect borderRect = CGRectInset(bounds, 30, 50); + CGContextClearRect(context, borderRect); +} + +// Failure to fill in an Arc geometry - #2059 +// Note add a test for CGContextFill of an Arc that spans from 0-2*PI +DISABLED_DRAW_TEST_F(CGContext, ClearRectArc, WhiteBackgroundTest<>) { + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGRect cirleRect = CGRectMake(0, 0, 100, 100); + CGContextAddArc(context, 50, 50, 50, 0.0, 2 * M_PI, 0); + CGContextClip(context); + CGContextClearRect(context, cirleRect); +} + +DRAW_TEST_F(CGContext, ClearRectTransparencyLayer, WhiteBackgroundTest<>) { + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGContextSetRGBFillColor(context, 1, 0, 0, 1); + CGContextFillRect(context, bounds); + + CGContextBeginTransparencyLayer(context, nullptr); + CGContextSetRGBFillColor(context, 0, 0, 1, 1); + CGContextFillRect(context, bounds); + + CGContextClearRect(context, CGRectMake(0, 0, 100, 100)); + + CGContextEndTransparencyLayer(context); +} + +class CGClearRectArc : public WhiteBackgroundTest<>, public ::testing::WithParamInterface<::testing::tuple> { + CFStringRef CreateOutputFilename() { + CGRect rect = ::testing::get<0>(GetParam()); + CGPoint sweep = ::testing::get<1>(GetParam()); + + return CFStringCreateWithFormat(nullptr, + nullptr, + CFSTR("TestImage.CGContext.CGClearRectArc.(%0.0f.%0.0f)%0.0fx%0.0f.sweep(%0.0f--%0.0f).png"), + rect.origin.x, + rect.origin.y, + rect.size.width, + rect.size.height, + sweep.x, + sweep.y); + } +}; + +DRAW_TEST_P(CGClearRectArc, ClearArc) { + CGContextRef context = GetDrawingContext(); + CGRect rect = ::testing::get<0>(GetParam()); + CGPoint sweep = ::testing::get<1>(GetParam()); + + CGContextAddArc(context, 50, 50, 50, sweep.x, sweep.y, 0); + CGContextClip(context); + CGContextClearRect(context, rect); +} + +static CGPoint sweep[] = { CGPointMake(0, M_PI), CGPointMake(M_PI, 0), CGPointMake(0.3 * M_PI, 0.6 * M_PI), CGPointMake(0, 1.9 * M_PI) }; +// TODO: enable when #2062 is fixed. +INSTANTIATE_TEST_CASE_P(DISABLED_CGContextTests, + CGClearRectArc, + ::testing::Combine(::testing::ValuesIn(rects), ::testing::ValuesIn(sweep))); + +DRAW_TEST_F(CGContext, CustomPathClearRect, WhiteBackgroundTest<>) { + CGContextRef context = GetDrawingContext(); + CGRect bounds = GetDrawingBounds(); + + CGMutablePathRef thepath = CGPathCreateMutable(); + CGPathMoveToPoint(thepath, NULL, 30, 100); + CGPathAddCurveToPoint(thepath, NULL, 47.0f, 67.0f, 50.0f, 55.0f, 45.0f, 50.0f); + CGPathAddCurveToPoint(thepath, NULL, 42.0f, 47.0f, 37.0f, 46.0f, 30.0f, 55.0f); + + CGPathAddCurveToPoint(thepath, NULL, 23.0f, 46.0f, 18.0f, 47.0f, 15.0f, 50.0f); + CGPathAddCurveToPoint(thepath, NULL, 10.0f, 55.0f, 13.0f, 67.0f, 30.0f, 100.0f); + + CGPathCloseSubpath(thepath); + CGContextAddPath(context, thepath); + + CGContextClip(context); + CGContextClearRect(context, CGRectMake(0, 0, 50, 70)); + CGPathRelease(thepath); +} +#pragma endregion ClearRect \ No newline at end of file diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.3,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.3,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..d5f9c9c1ed --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.3,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3df897a53bf464e815b085be78ea432734c51481afcf8d6b72dbf90040aa7c37 +size 1202 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.9,0.4,-0.4,0.9,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.9,0.4,-0.4,0.9,0.0,0.0].png new file mode 100644 index 0000000000..571b528116 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.9,0.4,-0.4,0.9,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50e87d9e41f9042b44df5c531e9744dcb12a45a898e918d340e6c2f357a10c1a +size 2934 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,0.0,0.0].png new file mode 100644 index 0000000000..95973c9cbe --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7626ac5165a226311cc365efd05fb4812873ac3453d1a9560cef1cbe6b9f0aa +size 1202 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,3.0,6.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,3.0,6.0].png new file mode 100644 index 0000000000..2538cd656c --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,3.0,6.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b092eda8919a5ecd5e93e82820c33a4e414b46053b46054dba7bf8a052b26f5 +size 1211 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.3,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.3,1.0,0.0,0.0].png new file mode 100644 index 0000000000..68466ab0de --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.3,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f53adb51a7de958a412b95b8e470d778da3a105d87e6065b307fbf92bb3f41e +size 2205 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.3,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.3,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..b756d70b56 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.3,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ec4a44d325c66c0a8b74ff01140a8ed3fb8df7df07d8142c7ddd9c62ac85de4 +size 1220 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png new file mode 100644 index 0000000000..c734455519 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe426f5ac267345476028936958d28e7fd19aa07d7943dba9072c8a361579af1 +size 2391 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,0.0,0.0].png new file mode 100644 index 0000000000..643a4b8673 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1069809386fd916f3648c545bd33188f1c2e72f34080f34a29f93146aba9ba9 +size 1201 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,3.0,6.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,3.0,6.0].png new file mode 100644 index 0000000000..c1ac793b72 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,3.0,6.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adcb1e62aa7079ab5da1161cf54f08ad2bfd4e5861fbd0cc535f1cd4f4b21a71 +size 1208 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.3,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.3,1.0,0.0,0.0].png new file mode 100644 index 0000000000..75e19fc5b5 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.3,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22460451e69769ae48a2a871b357518a7e10329332f77c993fa3fbff621b31d5 +size 2327 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.3,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.3,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..ecc931622c --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.3,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eff879207f45ca6b64ae88f8e8065a5efc1d23e898a66ab3e03d84cd22c35c87 +size 1216 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png new file mode 100644 index 0000000000..4678fe13bb --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36a83c6f904c8cac347fcc60cf7a44c195fdc9800b82874f7b7b1973eba46122 +size 3529 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,0.0,0.0].png new file mode 100644 index 0000000000..e8efd1e532 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f850de4fc291c4e71d1aede96cbf247f4929a1358c0239b4664dcd696ae2567c +size 1208 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,3.0,6.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,3.0,6.0].png new file mode 100644 index 0000000000..55a7fb70e9 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,3.0,6.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0814ec0cfc8a9e113f9a5497e14c8012ad19090287cbf29308cca6e47bdc2a09 +size 1208 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.3,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.3,1.0,0.0,0.0].png new file mode 100644 index 0000000000..e123b128bd --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.3,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f2c4a5d3976ae0831acaea7ec3dfa861bec3bdeebe3a8fe01769053bdeaedc1 +size 1782 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContextFill.ClearRect.png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContextFill.ClearRect.png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRectTransparencyLayer.png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRectTransparencyLayer.png new file mode 100644 index 0000000000..b49e2bdbed --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRectTransparencyLayer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d611ee230c4a1f785385b9d1a541821ae97a73ef92d96c1a4fd3ec762ac55425 +size 3049 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.CustomPathClearRect.png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.CustomPathClearRect.png new file mode 100644 index 0000000000..9af950e6fe --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.CustomPathClearRect.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cc027e3d7abf01d52cd767e2c55df1cb10f48cedff56d307d064037b8879189 +size 1793 diff --git a/tests/unittests/CoreGraphics.Drawing/CGContextDrawing_FillTests.cpp b/tests/unittests/CoreGraphics.Drawing/CGContextDrawing_FillTests.cpp index 86d4c07b0f..d664f16fdc 100644 --- a/tests/unittests/CoreGraphics.Drawing/CGContextDrawing_FillTests.cpp +++ b/tests/unittests/CoreGraphics.Drawing/CGContextDrawing_FillTests.cpp @@ -114,3 +114,34 @@ DISABLED_DRAW_TEST_F(CGContextFill, ConcentricRectsEvenOdd, WhiteBackgroundTest< CGPathRelease(path); } + +class CGContextArcFill : public WhiteBackgroundTest<>, public ::testing::WithParamInterface<::testing::tuple> { + CFStringRef CreateOutputFilename() { + CGPoint sweep = ::testing::get<0>(GetParam()); + int direction = ::testing::get<1>(GetParam()); + return CFStringCreateWithFormat(nullptr, + nullptr, + CFSTR("TestImage.CGContextFill.Arc.sweep(%0.0f--%0.0f).direction.%d.png"), + sweep.x, + sweep.y, + direction); + } +}; + +DRAW_TEST_P(CGContextArcFill, FillArc) { + CGContextRef context = GetDrawingContext(); + CGPoint sweep = ::testing::get<0>(GetParam()); + int direction = ::testing::get<1>(GetParam()); + CGContextAddArc(context, 50, 50, 50, sweep.x, sweep.y, direction); + CGContextFillPath(context); +} + +static CGPoint sweep[] = { CGPointMake(0, M_PI), + CGPointMake(2 * M_PI, 0), + CGPointMake(0.3 * M_PI, 0.6 * M_PI), + CGPointMake(0, 1.9 * M_PI) }; +static int directions[] = { 0, 1 }; +// TODO: enable when #2062 is fixed. +INSTANTIATE_TEST_CASE_P(DISABLED_CGContextFill, + CGContextArcFill, + ::testing::Combine(::testing::ValuesIn(sweep), ::testing::ValuesIn(directions))); From b8869f015f595bc49c5a3f754b17cb2a90339510 Mon Sep 17 00:00:00 2001 From: Jeyaram Jeyaraj Date: Wed, 1 Mar 2017 16:09:36 -0800 Subject: [PATCH 2/4] test improvements --- .../CGContextDrawing_ClearRectTests.cpp | 65 +++++++++---------- ...(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png | 3 + ...0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png} | 0 ....0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png} | 0 ...0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png} | 0 ...0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png} | 0 ...0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png} | 0 ...0.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png | 3 + ...0.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png | 3 + ....20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png | 3 + ...0.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png | 3 + ...0.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png | 3 + ...0.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png | 3 + ...(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png | 3 + ...0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png} | 0 ....0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png} | 0 ...0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png} | 0 ...0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png} | 0 ...0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png} | 0 ...0.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png | 3 + ...0.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png | 3 + ....20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png | 3 + ...0.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png | 3 + ...0.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png | 3 + ...0.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png | 3 + ...(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png | 3 + ...0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png} | 0 ....0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png} | 0 ...0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png} | 0 ...0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png} | 0 ...0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png} | 0 ...0.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png | 3 + ...0.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png | 3 + ....20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png | 3 + ...0.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png | 3 + ...0.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png | 3 + ...0.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png | 3 + ...estImage.CGContext.CustomPathClearRect.png | 4 +- 38 files changed, 96 insertions(+), 36 deletions(-) create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(0.0)100x100.[0.3,0.0,0.0,0.8,0.0,0.0].png => TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(0.0)100x100.[0.9,0.4,-0.4,0.9,0.0,0.0].png => TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,0.0,0.0].png => TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,3.0,6.0].png => TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.3,1.0,0.0,0.0].png => TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png} (100%) create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(0.0)50x250.[0.3,0.0,0.0,0.8,0.0,0.0].png => TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(0.0)50x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png => TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,0.0,0.0].png => TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,3.0,6.0].png => TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.3,1.0,0.0,0.0].png => TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png} (100%) create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(100.100)125x250.[0.3,0.0,0.0,0.8,0.0,0.0].png => TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(100.100)125x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png => TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,0.0,0.0].png => TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,3.0,6.0].png => TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png} (100%) rename tests/UnitTests/CoreGraphics.drawing/data/reference/{TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.3,1.0,0.0,0.0].png => TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png} (100%) create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png create mode 100644 tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp b/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp index 5a1cf3e43b..61157bf88e 100644 --- a/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp +++ b/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp @@ -18,57 +18,51 @@ #pragma region ClearRect -class CGClearRect : public WhiteBackgroundTest<>, public ::testing::WithParamInterface<::testing::tuple> { +class CGClearRect : public WhiteBackgroundTest<>, + public ::testing::WithParamInterface<::testing::tuple> { CFStringRef CreateOutputFilename() { CGRect rect = ::testing::get<0>(GetParam()); CGAffineTransform transformation = ::testing::get<1>(GetParam()); - - return CFStringCreateWithFormat(nullptr, - nullptr, - CFSTR("TestImage.CGContext.ClearRect.(%0.0f.%0.0f)%0.0fx%0.0f.[%0.1f,%0." - "1f,%0.1f,%0.1f,%0.1f,%0.1f].png"), - rect.origin.x, - rect.origin.y, - rect.size.width, - rect.size.height, - transformation.a, - transformation.b, - transformation.c, - transformation.d, - transformation.tx, - transformation.ty); + CGRect addRect = ::testing::get<2>(GetParam()); + + return CFStringCreateWithFormat( + nullptr, + nullptr, + CFSTR("TestImage.CGContext.ClearRect.(%0.0f.%0.0f)%0.0fx%0.0f.clear.(%0.0f.%0.0f)%0.0fx%0.0f.[%0.1f,%0." + "1f,%0.1f,%0.1f,%0.1f,%0.1f].png"), + rect.origin.x, + rect.origin.y, + rect.size.width, + rect.size.height, + addRect.origin.x, + addRect.origin.y, + addRect.size.width, + addRect.size.height, + transformation.a, + transformation.b, + transformation.c, + transformation.d, + transformation.tx, + transformation.ty); } }; DRAW_TEST_P(CGClearRect, Transformed) { CGRect rect = ::testing::get<0>(GetParam()); CGAffineTransform transformation = ::testing::get<1>(GetParam()); - - CGContextRef context = GetDrawingContext(); - - CGContextAddRect(context, CGRectMake(100, 50, 50, 50)); - CGContextConcatCTM(context, transformation); - CGContextClip(context); - - CGContextSetRGBFillColor(context, 0.48, 0.73, 0, 1); - CGContextClearRect(context, rect); -} - -DRAW_TEST_P(CGClearRect, Transformed2) { - CGRect rect = ::testing::get<0>(GetParam()); - CGAffineTransform transformation = ::testing::get<1>(GetParam()); + CGRect addRect = ::testing::get<2>(GetParam()); CGContextRef context = GetDrawingContext(); CGRect bounds = GetDrawingBounds(); - CGContextAddRect(context, CGRectMake(0, 0, 250, 250)); + CGContextAddRect(context, addRect); CGContextConcatCTM(context, transformation); CGContextClip(context); - CGContextSetRGBFillColor(context, 0.48, 0.73, 0, 1); CGContextClearRect(context, rect); } +static CGRect addRects[] = { CGRectMake(10, 20, 300, 400), CGRectMake(0, 0, 250, 250) }; static CGRect rects[] = { CGRectMake(0, 0, 100, 100), CGRectMake(0, 0, 50, 250), CGRectMake(100, 100, 125, 250) }; static CGAffineTransform transformation[] = { CGAffineTransformMakeRotation(0.4), CGAffineTransformMakeTranslation(3, 6), @@ -76,7 +70,9 @@ static CGAffineTransform transformation[] = { CGAffineTransformMakeRotation(0.4) CGAffineTransformMake(1.f, 0.f, 0.3f, 1.f, 0.f, 0.f), CGAffineTransformIdentity }; -INSTANTIATE_TEST_CASE_P(CGContextTests, CGClearRect, ::testing::Combine(::testing::ValuesIn(rects), ::testing::ValuesIn(transformation))); +INSTANTIATE_TEST_CASE_P(CGContextTests, + CGClearRect, + ::testing::Combine(::testing::ValuesIn(rects), ::testing::ValuesIn(transformation), ::testing::ValuesIn(addRects))); DRAW_TEST_F(CGContext, ClearRect, WhiteBackgroundTest<>) { CGContextRef context = GetDrawingContext(); @@ -165,8 +161,9 @@ DRAW_TEST_F(CGContext, CustomPathClearRect, WhiteBackgroundTest<>) { CGPathCloseSubpath(thepath); CGContextAddPath(context, thepath); + CGContextConcatCTM(context, CGAffineTransformMakeRotation(0.2)); CGContextClip(context); - CGContextClearRect(context, CGRectMake(0, 0, 50, 70)); + CGContextClearRect(context, CGRectMake(0, 0, 50, 98)); CGPathRelease(thepath); } #pragma endregion ClearRect \ No newline at end of file diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..f26e2f7211 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bbdf5f0a60bf163b9c40fc2ff9c3fc51b82fbcbef8b9372fd253c86bb226e68 +size 3018 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.3,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.3,0.0,0.0,0.8,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.9,0.4,-0.4,0.9,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[0.9,0.4,-0.4,0.9,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,3.0,6.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.0,1.0,3.0,6.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.3,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.[1.0,0.0,0.3,1.0,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..f355fa0064 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67f4111234c6f97b3bbf30566dc0687d4df8269717810a315dbc717e849c0af1 +size 3016 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..3ac302dbdd --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14667ed56570f5012116e9fb8273b9297a9e2ba5c0414a95d6be34174047821a +size 1210 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png new file mode 100644 index 0000000000..74d1a617ff --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b19a00226d60b36c02be63c4e393a470f56f60b80deab3d1f121b1666e0325c4 +size 2606 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png new file mode 100644 index 0000000000..ed51d9986f --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3019390216c0648df6ad1128f095a1c1527f1ec635175e55897d756348b20446 +size 1210 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png new file mode 100644 index 0000000000..a959f01eed --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d3f607f09b8557c84359e96e2863bb3fe278212e6410653e9ff8b0b06858fce +size 1210 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png new file mode 100644 index 0000000000..73b9c23536 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)100x100.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2fe949cc191bc9ee95ff3596c64cd83f1507d3ac31d9e37864ec720e84b5e1eb +size 1990 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..4df8c8cd92 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:260a89cc7b7b068e6c9baea0060c44e419ea929ce5e52988f9773657f42cbbe0 +size 3252 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.3,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.3,0.0,0.0,0.8,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,3.0,6.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.0,1.0,3.0,6.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.3,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.[1.0,0.0,0.3,1.0,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..cbc09c777d --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:911184b50a81c199a7d1574ce1f73c7064f7a0a91b6e2949ddaf365e9226c0d7 +size 3242 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..b3850144d8 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:689fee81f4b4f5e2325b710a3ce36174204e8a5a811294979cd8dd844dd2f6cf +size 1231 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png new file mode 100644 index 0000000000..d4063b9811 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b8423abacb32e1a60fedaeac55e760c4f2cf2fb954335b57f8debae83cad7fe +size 1896 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png new file mode 100644 index 0000000000..21d5a1fb79 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86fe16a75ca996368576c684787fe79da47f0ba0227f58ab1cfc37b63a5529fe +size 1208 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png new file mode 100644 index 0000000000..6ce0464421 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed1b35d576117daf9a9fdb4336bea77eebe6091ef7ae337b5a8ae913d5e23c02 +size 1206 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png new file mode 100644 index 0000000000..f9ce3f3892 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(0.0)50x250.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9dc69adfd23b883869ffd30d8ac0970ffcad81e7220620a70f1f66fea4e72db4 +size 2451 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..8950847300 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[0.2,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2f955140172d2d8527806aaaad1eed53bc0ba53a287a6a9860314cf9a4fab83 +size 3066 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.3,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.3,0.0,0.0,0.8,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[0.3,0.0,0.0,0.8,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[0.9,0.4,-0.4,0.9,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,3.0,6.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.0,1.0,3.0,6.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[1.0,0.0,0.0,1.0,3.0,6.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.3,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png similarity index 100% rename from tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.[1.0,0.0,0.3,1.0,0.0,0.0].png rename to tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(0.0)250x250.[1.0,0.0,0.3,1.0,0.0,0.0].png diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..dbbb79c7e3 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.2,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:216021081e745b73f4484cdbddfdf71d0556b17df395173403788f0ea2204b2d +size 3079 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png new file mode 100644 index 0000000000..77f70fe016 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.3,0.0,0.0,0.8,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f148135b520aef1a326edfac1705383e52baced27ac8a884cec02b485d423d1a +size 1214 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png new file mode 100644 index 0000000000..a4da8a1e43 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[0.9,0.4,-0.4,0.9,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:977b22a913e610f031a5cabe27e6c245cfe79199f5f86079c26fce5ad841321a +size 3481 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png new file mode 100644 index 0000000000..7007cb0656 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd7cc36b400e28c0feebfb9da60f37e5e1e504616532aeb754b8c0733d2a8919 +size 1206 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png new file mode 100644 index 0000000000..7ccc611858 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.0,1.0,3.0,6.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec3ee8db767c6ddad986e8a409c7a511a3d06baba7eaee4c4284747fe09fd801 +size 1206 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png new file mode 100644 index 0000000000..0b61d0e8a4 --- /dev/null +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.ClearRect.(100.100)125x250.clear.(10.20)300x400.[1.0,0.0,0.3,1.0,0.0,0.0].png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f74604570076a2284de73b61a807d206138fb20fcaf78828e73645b53b7d88d6 +size 2327 diff --git a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.CustomPathClearRect.png b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.CustomPathClearRect.png index 9af950e6fe..f253a3af03 100644 --- a/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.CustomPathClearRect.png +++ b/tests/UnitTests/CoreGraphics.drawing/data/reference/TestImage.CGContext.CustomPathClearRect.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2cc027e3d7abf01d52cd767e2c55df1cb10f48cedff56d307d064037b8879189 -size 1793 +oid sha256:838e06e30b7d57b6e248b6804bca31a2ae6c982ee78c7df83accd124dc52e5ff +size 2168 From 74221addf910ad77e782c38e9307162911319d91 Mon Sep 17 00:00:00 2001 From: Jeyaram Jeyaraj Date: Thu, 2 Mar 2017 09:25:49 -0800 Subject: [PATCH 3/4] remove moved test --- .../CGContextDrawing_FillTests.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/unittests/CoreGraphics.Drawing/CGContextDrawing_FillTests.cpp b/tests/unittests/CoreGraphics.Drawing/CGContextDrawing_FillTests.cpp index d664f16fdc..d3514f3893 100644 --- a/tests/unittests/CoreGraphics.Drawing/CGContextDrawing_FillTests.cpp +++ b/tests/unittests/CoreGraphics.Drawing/CGContextDrawing_FillTests.cpp @@ -82,17 +82,6 @@ DISABLED_DRAW_TEST_F(CGContextFill, ConcentricRectsWinding, WhiteBackgroundTest< CGPathRelease(path); } -DRAW_TEST_F(CGContextFill, ClearRect, WhiteBackgroundTest<>) { - CGContextRef context = GetDrawingContext(); - CGRect bounds = GetDrawingBounds(); - - CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1); - CGContextFillRect(context, bounds); - - CGRect borderRect = CGRectInset(bounds, 30, 50); - CGContextClearRect(context, borderRect); -} - DISABLED_DRAW_TEST_F(CGContextFill, ConcentricRectsEvenOdd, WhiteBackgroundTest<>) { CGContextRef context = GetDrawingContext(); CGRect bounds = GetDrawingBounds(); From bc8f5b84633bc4ea7bfd937141d89d93dd62c996 Mon Sep 17 00:00:00 2001 From: Jeyaram Jeyaraj Date: Thu, 2 Mar 2017 13:34:25 -0800 Subject: [PATCH 4/4] change parameterized tests to use PixelComparisonModeMask --- .../CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp b/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp index 61157bf88e..a471f4dcbc 100644 --- a/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp +++ b/tests/UnitTests/CoreGraphics.drawing/CGContextDrawing_ClearRectTests.cpp @@ -18,7 +18,7 @@ #pragma region ClearRect -class CGClearRect : public WhiteBackgroundTest<>, +class CGClearRect : public WhiteBackgroundTest>>, public ::testing::WithParamInterface<::testing::tuple> { CFStringRef CreateOutputFilename() { CGRect rect = ::testing::get<0>(GetParam());