Commit Graph

127 Commits

Author SHA1 Message Date
bors-servo c87f22c4ee Auto merge of #51 - pcwalton:surface-shape, r=metajack
Add bindings to the private `CGSNewRegionWithRectList` and `CGSSetSurfaceShape` APIs, and improve ergonomics of the geometry types.

These changes allow us to set rounded corners on OpenGL views the same way Cocoa does, dramatically improving performance.

r? @metajack
cc @paulrouget

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/51)
<!-- Reviewable:end -->
2016-06-03 19:15:41 -05:00
Patrick Walton 443e95792a private: Add a binding to CGSSetSurfaceShape.
This is useful to make OpenGL areas have rounded corners. It matches
what the Cocoa framework does internally for this.
2016-06-03 16:08:10 -07:00
Patrick Walton 621a033730 private: Add a binding to CGSNewRegionWithRectList. 2016-06-03 16:07:24 -07:00
Patrick Walton 828a7fde4b private: Rename CGSRegion types to match reverse engineered headers
available elsewhere.

See: https://github.com/NUIKit/CGSInternal/blob/master/CGSRegion.h
2016-06-03 16:05:44 -07:00
Patrick Walton 35d5156182 geometry: Add a binding to CGRectInset. 2016-06-03 16:04:59 -07:00
Patrick Walton 508a240632 geometry: Add some convenience constructors for geometry types. 2016-06-03 16:04:40 -07:00
Patrick Walton 9b16b0e214 geometry: Add CG_ZERO_POINT to match CGZeroPoint. 2016-06-03 16:04:03 -07:00
Patrick Walton b31cffb648 geometry: Make CGPoint, CGRect, and CGSize copyable and clonable. 2016-06-03 16:03:35 -07:00
Patrick Walton 1229483c10 0.3.1 2016-06-01 20:12:42 -07:00
bors-servo 8be09b1ad4 Auto merge of #50 - pcwalton:regions, r=metajack
Add some bindings to the private `CGSRegion` APIs.

These enable us to tell the window server about the opaque regions of
the window so that it can perform occlusion culling.

See https://github.com/NUIKit/CGSInternal/blob/master/CGSRegion.h

r? @metajack

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/50)
<!-- Reviewable:end -->
2016-05-31 18:47:43 -05:00
Patrick Walton 3c3727442e Add some bindings to the private CGSRegion APIs.
These enable us to tell the window server about the opaque regions of
the window so that it can perform occlusion culling.

See https://github.com/NUIKit/CGSInternal/blob/master/CGSRegion.h
2016-05-31 16:50:05 -07:00
bors-servo 0d466523ec Auto merge of #49 - OpenAnsible:master, r=pcwalton
Add API `CGWindowListCopyWindowInfo `

add `CGWindowListCopyWindowInfo ` API to `display.rs`.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/49)
<!-- Reviewable:end -->
2016-05-11 20:30:09 -07:00
Luo d1cb1a7764 add some display api. 2016-05-12 06:34:32 +08:00
Luo b952ddd051 update src/display.rs 2016-05-10 13:54:11 +08:00
bors-servo 02f56b1c58 Auto merge of #48 - servo:bump-serde, r=larsbergstrom
Bump serde to 0.7

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/48)
<!-- Reviewable:end -->
2016-03-09 07:35:23 +05:30
Anthony Ramine b7c2f5c294 Bump serde to 0.7 2016-03-01 01:54:41 +01:00
bors-servo 6f9c47c5f0 Auto merge of #47 - servo:bump, r=glennw
Bump version to 0.2.1

In order to pick up this change:

https://github.com/servo/core-graphics-rs/pull/46

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/47)
<!-- Reviewable:end -->
2015-12-15 07:42:23 +05:30
Corey Farwell f5e5e9c331 Bump version to 0.2.1
In order to pick up this change:

https://github.com/servo/core-graphics-rs/pull/46
2015-12-14 21:10:40 -05:00
bors-servo 553c51f65c Auto merge of #46 - pcwalton:postscript-names, r=glennw
Support serialization of `CGFont` objects.

Due to API limitations, this will only serialize native fonts, not Web
fonts. Specifically, there is no way I know of to fetch the
`CGDataProvider` associated with a `CGFont`. This isn't a problem for
Servo, however, because Servo knows which fonts are Web fonts and stores
their byte data separately.

r? @glennw or @larsbergstrom

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/46)
<!-- Reviewable:end -->
2015-12-01 06:13:48 +05:30
Patrick Walton 7f00bbf441 Support serialization of CGFont objects.
Due to API limitations, this will only serialize native fonts, not Web
fonts. Specifically, there is no way I know of to fetch the
`CGDataProvider` associated with a `CGFont`. This isn't a problem for
Servo, however, because Servo knows which fonts are Web fonts and stores
their byte data separately.
2015-11-30 16:41:46 -08:00
bors-servo 361bc8a849 Auto merge of #45 - mbrubeck:libc0.2, r=metajack
Upgrade to libc 0.2

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/45)
<!-- Reviewable:end -->
2015-11-06 01:34:08 +05:30
Matt Brubeck 76ece0ace5 Upgrade to libc 0.2 2015-11-03 15:37:23 -08:00
Patrick Walton da0c05993d Update version number 2015-10-28 17:25:03 -07:00
bors-servo d21421d6ed Auto merge of #42 - SSheldon:float_typedef, r=metajack
Fix CGFloat type definition for 32-bit

`CGFloat` was always defined as a double, and there was a `TODO` to fix this. I ran into the issue, so here's a PR to fix it :)

The definition for `CGFloat` in CoreGraphics/CGBase.h looks like:
``` c
#if defined(__LP64__) && __LP64__
# define CGFLOAT_TYPE double
#else
# define CGFLOAT_TYPE float
#endif

typedef CGFLOAT_TYPE CGFloat;
```

I also noticed that the definition for `boolean_t` was wrong for arm. The definition in mach/arm/boolean.h is:
``` c
typedef int		boolean_t;
```

And the definition in mach/i386/boolean.h is:
``` c
#if defined(__x86_64__) && !defined(KERNEL)
typedef unsigned int	boolean_t;
#else
typedef int		boolean_t;
#endif
```

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/42)
<!-- Reviewable:end -->
2015-10-26 11:14:32 -05:00
bors-servo d683ba8d98 Auto merge of #44 - pcwalton:fill-color-and-font-aa, r=metajack
Add support for fill colors and font AA.

Also, mark Core Graphics contexts as `Send` and `Sync` since (I believe) they
are thread-safe.

r? @metajack

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/44)
<!-- Reviewable:end -->
2015-10-16 21:06:29 -06:00
Patrick Walton d072ab30af Add support for fill colors and font AA.
Also, mark Core Graphics contexts as `Send` and `Sync` since (I believe) they
are thread-safe.
2015-10-16 17:29:42 -07:00
bors-servo 244d141fe6 Auto merge of #43 - pcwalton:context, r=metajack
Add some basic support for bitmap graphics contexts and color spaces

r? @metajack

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/43)
<!-- Reviewable:end -->
2015-10-13 21:33:34 -06:00
Patrick Walton 87cc3ba551 Add some basic support for bitmap graphics contexts and color spaces 2015-10-13 18:28:55 -07:00
Steven Sheldon a534d23e81 Fix CGFloat type definition for 32-bit. 2015-10-10 12:04:25 -07:00
bors-servo efc18b488c Auto merge of #41 - SSheldon:version_0.1.1, r=jdm
Bump version to 0.1.1

Bump version to 0.1.1 so that I can use this crate with #39 from crates.io.

If this is merge could someone also publish to crates.io?
2015-09-23 06:26:41 -06:00
Steven Sheldon 2f8a8e254a Bump version to 0.1.1. 2015-09-22 23:10:13 -07:00
bors-servo 19e04323f3 Auto merge of #39 - SSheldon:deps_ios, r=jdm
Made core-foundation a dependency for any platform

The Cargo.toml file currently only declares `core-foundation` as a dependency on 64bit OSX, but it's used unconditionally in this crate so it should be an unconditional dependency.

I'm playing around with this crate on iOS and it won't build without this change.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/core-graphics-rs/39)
<!-- Reviewable:end -->
2015-09-17 11:57:52 -06:00
Patrick Walton 0b3c887f14 Merge pull request #40 from servo/homu
Enable homu.
2015-09-17 19:37:20 +02:00
Ms2ger ac0c7df3e2 Enable homu. 2015-09-17 19:32:43 +02:00
Steven Sheldon 8a662b25de core-foundation is always a dependency, not just on OSX. 2015-09-13 11:25:09 -05:00
Corey Farwell 375ad42e44 Merge pull request #38 from frewsxcv/travis
Build and test on Travis CI
2015-06-09 14:46:59 -07:00
Corey Farwell e7b7fdb8d5 Init README 2015-06-09 14:43:43 -07:00
Corey Farwell 79c34f6676 Build and test on Travis CI (OSX) 2015-06-09 14:43:38 -07:00
Glenn Watson bf96e0cf56 Merge pull request #37 from metajack/crates-io
Add metadata for crates.io.
2015-06-04 13:58:42 +10:00
Jack Moffitt 6937fdfe50 Add metadata for crates.io. 2015-06-03 21:57:27 -06:00
Glenn Watson 37a2c9c0fb Merge pull request #36 from metajack/platform-deps
Use platform dependencies and clean up old cruft.
2015-06-03 16:16:24 +10:00
Jack Moffitt 7c41f6db7f Remove cfgs. 2015-06-02 23:42:59 -06:00
Jack Moffitt 2cd1531e2b Use platform dependencies and clean up old cruft. 2015-06-02 23:30:59 -06:00
Lars Bergstrom 2d8d665c5b Merge pull request #35 from fkaa/display-funcs
Add some more functions and make geometry structs #[repr(C)]
2015-05-05 13:18:10 -05:00
Felix Kaaman ef6fc9865b Add some more functions and make geometry structs #[repr(C)] 2015-05-04 10:38:36 +02:00
Ms2ger da0d2fe947 Merge pull request #34 from SSheldon/crates_libc
Use libc from crates.io; r=Ms2ger
2015-03-27 11:05:06 +01:00
Steven Sheldon 4a06037233 Use libc from crates.io. 2015-03-26 21:20:45 -07:00
Josh Matthews e169ad38f7 Merge pull request #33 from robertg/master
Update method signatures from an upstream core_foundation change
2015-02-21 07:10:20 -05:00
Robert Gawdzik ☢ 5dec07e798 Update method signatures from an upstream core_foundation change 2015-02-21 03:35:15 -08:00
glennw 9434e2bda6 Merge pull request #31 from metajack/rustup-20141105
Upgrade Rust.
2014-11-05 12:50:06 -08:00