Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1702.1 #1992

Merged
merged 176 commits into from
Feb 17, 2017
Merged

Release 1702.1 #1992

merged 176 commits into from
Feb 17, 2017

Conversation

rajsesh
Copy link
Contributor

@rajsesh rajsesh commented Feb 17, 2017

This change is Reviewable

MSFTFox and others added 30 commits October 6, 2016 16:10
* D2DFactory Wrapper

* Fix path for wrapper includes in project file.

* Moving starboard to mm file.

* Address CR feedback, remove useless code, clean up D2D factories.

* Moving header file to private location

* Factory helper should only create single threaded D2D factories.

* Actually fix the wrapper header location.
There are wide swaths of code wrapped in #if 0 ... #endif blocks; they will be removed and repaired as part of the ongoing work on this branch.

Issues have been logged for many TODOs, but the rest will be removed as part of the ongoing work on this branch.

Currently broken:

* path rendering
*  shadow
* transparency layers
* bitmap contexts that are not CALayer contexts
* font rendering is left in CGContextCairo.mm and will be moved

This merge is intended to unblock parallel work on CG/Direct2D.
*  Initial implementation of CGPath Using ID2D1Geometries

 This work provides the foundation for creating a CGPath based on
 ID2D1PathGeometry and GeometrySink. A simple implementation for
 adding a simple line, moving the current location to a new point
 and retrieving some basic information from the Geometry sink has
 been added. Isolated unit tests have also been added to ensure
 these APIs are working as intended for these simple scenarios.

* Addressing CR Feedback.

* Reworking the __CGPath struct to use a nested implementation

Also addressed some concerns with the state of geometry objects.

* Fixing re-opening functionality by creating a new path and streaming contents of old path into it.

* Addressing CR Feedback.

* Cleaning up CGPath and removing unused code.

* Refactor into using CFCppBase

* Cleaning up a few things.

* Addressing CR Feedback.

Removing fully qualified names. Using inline helpers
between D2D and CG. Fixing CGPathAddLines which will be
tested more accurately in the future. Removing unnecessary
dealloc method for CGPath base type. Fixing include->import.

*  Addming more helper functions and reverting bad test change.

* Addressing CR Feedback. Fixing Inlines

* Disabling tests that rely on CGPath in CoreText
…osoft#1181)

* Make CGContext display scale-agnostic by propagating the scale into Direct2D's DPI.
  A CGContext rendering to a scaled surface will not apply a scale
  transformation. The scaling logic has been moved into render target
  creation.
  
  Fixes microsoft#1180.
* Replace __CGContextDrawGeometry with RenderToCommandList+RenderCommandList.
* Push CG Interpolation mode into Direct2D.
  References microsoft#1177.
* Make all CG APIs nullptr-safe.
* Move stroke style caching/computation into drawing state.
* Fix CGContextConcatCTM (math was backwards.)
* Fix calculating exclusion zones based on CGPaths.
…#1185)

- Implementation of CGImage via WIC
- Remove circular dependencies between CGImage and UIImage
- Implement UIImage interms of CGImage
- Fix issues in UIImage
- Increase code quality in UIImage
- Remove libpng depencie of CGImage
- Improvements to result.h Macros for conditional checks
- Improve code quality for existing image interaction
- Added unit tests
…t#1239)

* Add support for black and coloured shadows via ID2D1Effect. Closes microsoft#1237.
* Apply the CTM transform for commandlist, device transform for final draw.
  Shadows project completely ignoring the context flip and any user translation.
  Therefore, we must translate all our drawing commands when we create
  them, but only apply the device scale in the final composition step.
* Implement CGSizeApplyAffineTransform.
* Allow a private consumer to control the shadow projection params.
* Switch all internal interfaces to HR returns.
microsoft#1240)

Curiously, CGContext path queries and CopyPath return untransformed units.
Closes microsoft#1238.
* Finish Simple line and status CGPath APIs.

Add additional tests to cover these scenarios.

* Addressing CR Feedback. Releasing leaked paths in tests.

* Addressing CR Feedback. Cleaning up nested conditionals and macro usage.

* Addressing CR Feedback.

* Removing unnecessary internal helper function. Adding extra test case for equality of paths with sub shapes.

* Fixing access to internal members of implemtation for CGPath.

* Rework __CGPath as per new encapsulation procedures.

* Adding additional test case for possible sub shapes equality failure.
* Implement drawing CGPaths through CGContext

* Fix calls to return an HRESULT.

* Address CR Feedback.

* Fix poor comptr usage and leaks. Return to static initializer model.
…#1324)

CGContext will now strive, wherever possible, to store its internal state in fully-device-transformed units. This transformation includes the device scale (flip+translate from CG to D2D) and the user scale.

To enable this, this pull request also adds the ability to specify that coordinate system a drawn geometry is in: paths will use the premultiplied values, and user-space geometry values will use userspace->device transformation.

This allows us to leverage the Direct2D effect stack without having to apply input and output transformations to the effects, and simplifies shadow rendering (we no longer transform for userspace in the commandlist and then device space when we draw it.)
Conflicts:
    Frameworks/CoreGraphics/CGBitmapImage.mm
    Frameworks/CoreGraphics/CGContext.mm
    Frameworks/QuartzCore/CALayer.mm
    Frameworks/UIKit/StarboardXaml/CompositorInterface.mm
    Frameworks/include/CGIWICBitmap.h
…op-merge

[CGD2D] Merge develop from 2016-11-10.
…ll. (microsoft#1368)

* Properly EO- or Winding-fill Geometries.
* Add support for CGContext(EO)?Clip().

Fixes microsoft#1269.
This change set introduces DRAW_TEST and DRAW_TEST_F, as well as a handful of
image drawing test fixtures. Commands rendered to a test's context as part of
its test body will be rasterized and saved in a file named
TestImage.$TESTCASE.$TESTNAME.png

The test driver's ideal interface is multi-modal; it needs to be able to
generate a corpus of reference images on disk, and it needs to be able to diff
them. For this, it needs a custom EntryPoint (included), and the ability to
parse command-line arguments.

The ideal default mode will be one that loads reference images from disk and
fails tests if a number of pixels differ. That work is not yet complete.

Hopefully, the draw tests here will be able to be plugged into another module
that can perhaps render them to screen, or display them as part of a UI-driven
flow for comparison and demoing purposes.

Refs microsoft#1271.
ehren and others added 27 commits February 7, 2017 15:13
…crosoft#1912)

* Use block scope thread_local static for NSProgress progress stack:

Works around issue with file_scope thread_local in current clang. Leak check unit test added.

* cr feedback: collapse initialization

* switch to auto and return type deduction
microsoft#1605)

* Enabling some image drawing tests, moving image drawing to a separate file and updating some image file names
NSString+UIKitAdditions sizeWithFont:constrainedToSize: should return the height that the text requires rather than the height of the text that can actually fit in the region that CTFramesetterSuggestFrameSizeWithConstraints returns.
… a header and footer table entry; affine transformations update (microsoft#1874)

* CoreAnimationTest update - disable unsupported CALayer controls; adds a header and footer table entry; affine transformations update

CHANGES:
1. Supports the enabling/disabling of layer property controls (greyed out if disabled)
2. Custom table view cells for header and footer added - view and number of layers
3. Affine transformations are now applied collectively, 3D transformation still require it to be centered at origin
4. Cosmetic updates and autolayout corrections - IslandWood autolayout still has some quirks (see CGRect- and CGPoint- cells)
5. All specialized layers extracted from external sources are marked as "not supported" even if render partially

Fixes microsoft#1598

* Code review feedback
* Fix interoperability with TAEF setup/teardown.
* Add a TAEF entrypoint and clear the win32 stuff out of the OS X one.
…icrosoft#1920)

* This change includes the addition of a few new features to UIButton.  Some functionality deviates from the reference platform, but we feel that it aligns more closely with the default look and feel of Xaml buttons on Windows because buttons 'look' pressed in more cases with these changes, and there are straightforward ways to opt out of this behavior if it's not desired.

**adjustsImageWhenDisabled/adjustsImageWhenHighlighted**:
We're adding WinObjC-specific support for adjustsImageWhenDisabled and adjustsImageWhenHighlighted.  On the reference platform, this tinting/darkening behavior is ONLY applied to the button's background an foreground images, but on our platform, the tintening/darkening is applied to the entire button's bounds (including its background color), but NOT to its label text.  The primary justification for this approach is that there's not a straighforward way to tint Xaml Images on RS1, yet this approach also helps us implement simple SystemButton support and it makes UIButtons appear a bit more 'windows-like' in many cases, since they show more distinct pressed behavior.  The behavior is as follows; if adjustsImageWhenDisabled is set to YES, and if no UIControlStateDisabled properties are set on the button, then the entire button contents (aside from its label) receives a lightening effect.  Similar behavior is implemented for adjustsImageWhenHighlighted.  The way to opt-out of this behavior is to either set a single UIControlStateDisabled/UIControlStateHighlighted property, or to set adjustsImageWhenDisabled/adjustsImageWhenHighlighted to NO.

**SystemButton (aka buttonWithType)**:
We're adding support for UIButtonTypeSystem, which behaves as follows:

	- Default background is white.
	- Receives a default text color of (blue/green) [UIColor colorWithRed:0.0f green:0.47843137f blue:1.0f alpha:1.0f] which applies to all states (unless set otherwise)
	- Default to UIColor lightTextColor for disabled titleLabelColor

**SystemButton - Deviations from the Reference Platform**:
	- When selected, the entire label background turns the default text color (blue/green) [UIColor colorWithRed:0.0f green:0.47843137f blue:1.0f alpha:1.0f], and the text color is changed to white.  This seems like a corner case that we're not implementing until we need to for a customer.

	- When highlighted, the titleLabel contents (its text and any sublayer content) are tinted to a darker/greyed out version of the normal state.
		- Instead of this behavior, we're piggy-backing off of our adjustsImageWhenHighlighted implementation to avoid needing to do this extra work.  The button *looks* highlighted, so we don't have to change the text color.

	- On the reference platform, when disabled, text is grey by default, UNLESS any custom normal or disabled text colors are set.  On our platform, we DEFAULT to disabled to grey text and then you can change it, but changing the normal color won't affect the default color (for the sake of simplicity).

Scrubbed Annotations:
All UIButton annotations have been scrubbed and updated with 'NotInPlan' status as needed.

Fixes microsoft#1442
Fixes microsoft#1885
Fixes microsoft#1671
Fixes microsoft#1671

Fixes VSO 10145069.
Fixes VSO 9533114.

* Adding comments + clang-format.

* Incorporating CR feedback.

* Fixing up UIButton tests.
…ft#1951)

* Fixing lab tests.  Also combinining tests into 1 common test.

* CR Feedback.

* CR feedback
…he CoreAnimation/UIKit composition layer). Note that we still don't have border support on basic CALayers, because we haven't needed to add them yet, but the plumbing is in now place to add them when needed. (microsoft#1956)

Fixes microsoft#1884.
…stures concurrent firing negotiations. (microsoft#1909)

* Supporting gesture subclassing and firing delegates for negativating concurrent firing

* Comments

* Fix some regressions

* separate the gesture processing code into its own class and adding initial tests

* CR comments

* Comments

* comments

* delete UIGestureRecognizerDelegate.h which causes protocol forward usage which av the tests
Several changes have been added to address microsoft#1933 and microsoft#1935

CGContextDrawGlyphRun has been changed to _CGContextDrawGlyphRuns and __CGContext::DrawGlyphRun -> __CGContext::DrawGlyphsRuns, which takes a dummy struct GlyphRunData, which holds the DWRITE_GLYPH_RUN, relative position of the glyph run (to the text position), and attributes of the glyph run (fill color, etc.).

Text drawing methods such as CTFrameDraw now accumulate an array of GlyphRunDatas and pass them to _CGContextDrawGlyphRuns, which in turn calls context->DrawGlyphRuns.

To batch all run drawing for clipping/stroking into the same geometry, the runs have to be drawn with the same transformation, so position has to be given (hence relative position in GlyphRunData). The position is transformed by the inverse of the text transform, so when the glyph is drawn and transformed by the real text transform it will have the correct position. This has the added benefit of allowing us to draw a glyph run which has a transformed text matrix all together, rather than glyph-by-glyph as we did previously.

Because text drawing is being batched, attributes which are handled at draw time on a run-per-run basis such as fill color need to be done in DrawGlyphRuns. The attribute names are defined in CoreText, though all of them are just CoreGraphics attributes, so local values have been added to CGContext.mm and exported for the CT/UIKit versions as CG.

Images have been updates since changing this seems to have enabled antialiasing to some degree on several tests.

Fixes microsoft#1933
Fixes microsoft#1935
* Add support for coloured and non-colored Patterns
* Enables proper anchoring for patterns
* Avoid D2D1Group fill mode conversion for CGPath and other simple geometries. Fill mode conversion removed from CGContext.

* Remove unnecessary check for proper fill mode since only one fill mode will ever be converted to.

* Parameterized test for fill modes with embedded circles with alternating arc directions.

* Fix Fill/Stroke tests and remove redundant tests.

* Fix relative project path
@rajsesh rajsesh merged commit ffe05fa into microsoft:master Feb 17, 2017
@rajsesh rajsesh deleted the release_1702.1 branch February 17, 2017 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet