Auto merge of #281 - jrmuizel:clear-rect, r=jrmuizel

Add bindings for CGContextClearRect

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/281)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo
2019-01-03 22:09:05 -05:00
committed by GitHub
+8
View File
@@ -248,6 +248,12 @@ impl CGContextRef {
}
}
pub fn clear_rect(&self, rect: CGRect) {
unsafe {
CGContextClearRect(self.as_ptr(), rect)
}
}
pub fn draw_image(&self, rect: CGRect, image: &CGImage) {
unsafe {
CGContextDrawImage(self.as_ptr(), rect, image.as_ptr());
@@ -382,6 +388,8 @@ extern {
blue: CGFloat,
alpha: CGFloat);
fn CGContextSetGrayFillColor(context: ::sys::CGContextRef, gray: CGFloat, alpha: CGFloat);
fn CGContextClearRect(context: ::sys::CGContextRef,
rect: CGRect);
fn CGContextFillRect(context: ::sys::CGContextRef,
rect: CGRect);
fn CGContextDrawImage(c: ::sys::CGContextRef, rect: CGRect, image: ::sys::CGImageRef);