Clean up
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
e5ffe43bb6
commit
1f647ef24c
2 changed files with 2 additions and 5 deletions
|
@ -96,7 +96,6 @@ impl Renderer {
|
||||||
let buffer_contents = self.instances.contents() as *mut shaders::GPUIQuad;
|
let buffer_contents = self.instances.contents() as *mut shaders::GPUIQuad;
|
||||||
for quad_batch in layer.quads().chunks(batch_size) {
|
for quad_batch in layer.quads().chunks(batch_size) {
|
||||||
for (ix, quad) in quad_batch.iter().enumerate() {
|
for (ix, quad) in quad_batch.iter().enumerate() {
|
||||||
log::info!("render {} {:?}", ix, quad);
|
|
||||||
unsafe {
|
unsafe {
|
||||||
*(buffer_contents.offset(ix as isize)) = shaders::GPUIQuad {
|
*(buffer_contents.offset(ix as isize)) = shaders::GPUIQuad {
|
||||||
origin: quad.bounds.origin().to_float2(),
|
origin: quad.bounds.origin().to_float2(),
|
||||||
|
|
|
@ -90,11 +90,12 @@ unsafe fn build_classes() {
|
||||||
handle_view_event as extern "C" fn(&Object, Sel, id),
|
handle_view_event as extern "C" fn(&Object, Sel, id),
|
||||||
);
|
);
|
||||||
|
|
||||||
decl.add_protocol(Protocol::get("CALayerDelegate").unwrap());
|
|
||||||
decl.add_method(
|
decl.add_method(
|
||||||
sel!(makeBackingLayer),
|
sel!(makeBackingLayer),
|
||||||
make_backing_layer as extern "C" fn(&Object, Sel) -> id,
|
make_backing_layer as extern "C" fn(&Object, Sel) -> id,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
decl.add_protocol(Protocol::get("CALayerDelegate").unwrap());
|
||||||
decl.add_method(
|
decl.add_method(
|
||||||
sel!(viewDidChangeBackingProperties),
|
sel!(viewDidChangeBackingProperties),
|
||||||
view_did_change_backing_properties as extern "C" fn(&Object, Sel),
|
view_did_change_backing_properties as extern "C" fn(&Object, Sel),
|
||||||
|
@ -407,7 +408,6 @@ extern "C" fn set_frame_size(this: &Object, _: Sel, size: NSSize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" fn display_layer(this: &Object, _: Sel, _: id) {
|
extern "C" fn display_layer(this: &Object, _: Sel, _: id) {
|
||||||
log::info!("display layer");
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let window_state = get_window_state(this);
|
let window_state = get_window_state(this);
|
||||||
let mut window_state = window_state.as_ref().borrow_mut();
|
let mut window_state = window_state.as_ref().borrow_mut();
|
||||||
|
@ -446,8 +446,6 @@ extern "C" fn display_layer(this: &Object, _: Sel, _: id) {
|
||||||
command_buffer.commit();
|
command_buffer.commit();
|
||||||
command_buffer.wait_until_completed();
|
command_buffer.wait_until_completed();
|
||||||
drawable.present();
|
drawable.present();
|
||||||
|
|
||||||
log::info!("present");
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue