X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcanvas.C;h=0d738c808de59187730041c66cfcbb245e841033;hp=e07dd33923c9e4a04c1da01e982f955715cedce9;hb=c279e21fc2394a7908bbd1ba8c79b116fe9fb14a;hpb=9d832a1fff11b11aaa1108c460690ed05e2bdc05 diff --git a/cinelerra-5.1/cinelerra/canvas.C b/cinelerra-5.1/cinelerra/canvas.C index e07dd339..0d738c80 100644 --- a/cinelerra-5.1/cinelerra/canvas.C +++ b/cinelerra-5.1/cinelerra/canvas.C @@ -857,16 +857,19 @@ void Canvas::update_refresh(VideoDevice *device, VFrame *output_frame) if( use_opengl ) best_color_model = BC_RGB888; + int out_w = output_frame->get_w(); + int out_h = output_frame->get_h(); if( refresh_frame && - (refresh_frame->get_w() != device->out_w || - refresh_frame->get_h() != device->out_h ) ) { + (refresh_frame->get_w() != out_w || + refresh_frame->get_h() != out_h || + refresh_frame->get_color_model() != best_color_model ) ) { // x11 direct render uses BC_BGR8888, use tranfer_from to remap delete refresh_frame; refresh_frame = 0; } if( !refresh_frame ) { refresh_frame = - new VFrame(device->out_w, device->out_h, best_color_model); + new VFrame(out_w, out_h, best_color_model); } if( use_opengl ) { @@ -878,10 +881,20 @@ void Canvas::update_refresh(VideoDevice *device, VFrame *output_frame) get_canvas()->lock_window(" Canvas::output_refresh"); } else - refresh_frame->transfer_from(output_frame); + refresh_frame->copy_from(output_frame); } +void Canvas::clear(int flush) +{ + if( refresh_frame ) + refresh_frame->clear_frame(); + BC_WindowBase *wdw = get_canvas(); + if( !wdw ) return; + wdw->set_bg_color(BLACK); + wdw->clear_box(0,0, wdw->get_w(), wdw->get_h()); + wdw->flash(flush); +} @@ -1158,7 +1171,7 @@ int CanvasPopupSize::handle_event() CanvasPopupResetCamera::CanvasPopupResetCamera(Canvas *canvas) - : BC_MenuItem(_("Reset camera")) + : BC_MenuItem(_("Reset camera"), "F11", KEY_F11) { this->canvas = canvas; } @@ -1171,7 +1184,7 @@ int CanvasPopupResetCamera::handle_event() CanvasPopupResetProjector::CanvasPopupResetProjector(Canvas *canvas) - : BC_MenuItem(_("Reset projector")) + : BC_MenuItem(_("Reset projector"), "F12", KEY_F12) { this->canvas = canvas; }