Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Add some bindings to the private CGSRegion APIs. #50

Merged
merged 1 commit into from
May 31, 2016

Conversation

pcwalton
Copy link
Contributor

@pcwalton pcwalton commented May 27, 2016

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


This change is Reviewable

pcwalton added a commit to pcwalton/glutin that referenced this pull request May 27, 2016
specify that only the corners of a window can be transparent.

By doing this, we significantly improve performance by allowing the
window server to perform occlusion culling under most of the window.

This patch relies on the private `CGSRegion` and the private
`-[NSCGSWindow setOpaqueRegion:]` APIs.

Requires servo/core-graphics-rs#50 and servo/cocoa-rs#129.
@metajack
Copy link
Contributor

This looks fine, but had a question on the return value. r=me if that doesn't matter.

Previously, pcwalton (Patrick Walton) wrote…

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


Reviewed 2 of 2 files at r1.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


src/private.rs, line 34 [r1] (raw file):

        unsafe {
            let mut region = ptr::null_mut();
            ffi::CGSNewRegionWithRect(rect, &mut region);

Is checking the status unimportant?


src/private.rs, line 45 [r1] (raw file):

    use geometry::CGRect;

    enum CGSRegionObject {}

It doesn't much matter, but why an empty enum instead of an empty struct?


Comments from Reviewable

pcwalton added a commit to pcwalton/glutin that referenced this pull request May 31, 2016
specify that only the corners of a window can be transparent.

By doing this, we significantly improve performance by allowing the
window server to perform occlusion culling under most of the window.

This patch relies on the private `CGSRegion` and the private
`-[NSCGSWindow setOpaqueRegion:]` APIs.

Requires servo/core-graphics-rs#50 and servo/cocoa-rs#129.
bors-servo pushed a commit to servo/glutin that referenced this pull request May 31, 2016
…etajack

cocoa: Add a new platform-specific API that allows library consumers to specify that only the corners of a window can be transparent.

By doing this, we significantly improve performance by allowing the
window server to perform occlusion culling under most of the window.

This patch relies on the private `CGSRegion` and the private
`-[NSCGSWindow setOpaqueRegion:]` APIs.

Requires servo/core-graphics-rs#50 and servo/cocoa-rs#129.

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/glutin/94)
<!-- Reviewable:end -->
@pcwalton
Copy link
Contributor Author

Review status: all files reviewed at latest revision, 2 unresolved discussions.


src/private.rs, line 45 [r1] (raw file):

Previously, metajack (Jack Moffitt) wrote…

It doesn't much matter, but why an empty enum instead of an empty struct?

So that you can't create a value of `CGSRegionObject` (without unsafe code and a lot of magic).

Comments from Reviewable

@metajack
Copy link
Contributor

Review status: all files reviewed at latest revision, 2 unresolved discussions.


src/private.rs, line 45 [r1] (raw file):

Previously, pcwalton (Patrick Walton) wrote…

So that you can't create a value of CGSRegionObject (without unsafe code and a lot of magic).

That would make a nice comment.

Comments from Reviewable

@pcwalton
Copy link
Contributor Author

Updated. r? @metajack

@metajack
Copy link
Contributor

Add the comment, squash, and r=me.

Previously, pcwalton (Patrick Walton) wrote…

Updated. r? @metajack


Reviewed 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


Comments from Reviewable

@pcwalton
Copy link
Contributor Author

@bors-servo: r=metajack

@bors-servo
Copy link

📌 Commit 3c37274 has been approved by metajack

@bors-servo
Copy link

⌛ Testing commit 3c37274 with merge 8be09b1...

bors-servo pushed a commit that referenced this pull request May 31, 2016
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 -->
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
@bors-servo
Copy link

☀️ Test successful - travis

@bors-servo bors-servo merged commit 3c37274 into servo:master May 31, 2016
pcwalton added a commit to pcwalton/glutin that referenced this pull request Jun 2, 2016
specify that only the corners of a window can be transparent.

By doing this, we significantly improve performance by allowing the
window server to perform occlusion culling under most of the window.

This patch relies on the private `CGSRegion` and the private
`-[NSCGSWindow setOpaqueRegion:]` APIs.

Requires servo/core-graphics-rs#50 and servo/cocoa-rs#129.
bors-servo pushed a commit to servo/glutin that referenced this pull request Jun 2, 2016
…etajack

cocoa: Add a new platform-specific API that allows library consumers to specify that only the corners of a window can be transparent.

By doing this, we significantly improve performance by allowing the
window server to perform occlusion culling under most of the window.

This patch relies on the private `CGSRegion` and the private
`-[NSCGSWindow setOpaqueRegion:]` APIs.

Requires servo/core-graphics-rs#50 and servo/cocoa-rs#129.

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/glutin/94)
<!-- Reviewable:end -->
pcwalton added a commit to pcwalton/glutin that referenced this pull request Jun 2, 2016
specify that only the corners of a window can be transparent.

By doing this, we significantly improve performance by allowing the
window server to perform occlusion culling under most of the window.

This patch relies on the private `CGSRegion` and the private
`-[NSCGSWindow setOpaqueRegion:]` APIs.

Requires servo/core-graphics-rs#50 and servo/cocoa-rs#129.
bors-servo pushed a commit to servo/glutin that referenced this pull request Jun 2, 2016
…etajack

cocoa: Add a new platform-specific API that allows library consumers to specify that only the corners of a window can be transparent.

By doing this, we significantly improve performance by allowing the
window server to perform occlusion culling under most of the window.

This patch relies on the private `CGSRegion` and the private
`-[NSCGSWindow setOpaqueRegion:]` APIs.

Requires servo/core-graphics-rs#50 and servo/cocoa-rs#129.

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/glutin/94)
<!-- Reviewable:end -->
emilio pushed a commit to emilio/glutin that referenced this pull request Jul 6, 2016
specify that only the corners of a window can be transparent.

By doing this, we significantly improve performance by allowing the
window server to perform occlusion culling under most of the window.

This patch relies on the private `CGSRegion` and the private
`-[NSCGSWindow setOpaqueRegion:]` APIs.

Requires servo/core-graphics-rs#50 and servo/cocoa-rs#129.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants