#NEWLINE# def _render_offscreen( self , surface , data , dst_x , dst_y , width , height ) : #NEWLINE# #INDENT# ( daht , dawd , depth ) = data . shape #NEWLINE# self . logger . debug ( ( 'data shape is %dx%dx%d' % ( dawd , daht , depth ) ) ) #NEWLINE# cr = cairo . Context ( surface ) #NEWLINE# self . cr = cr #NEWLINE# ( imgwin_wd , imgwin_ht ) = self . get_window_size ( ) #NEWLINE# cr . rectangle ( 0 , 0 , imgwin_wd , imgwin_ht ) #NEWLINE# ( r , g , b ) = self . get_bg ( ) #NEWLINE# cr . set_source_rgba ( r , g , b ) #NEWLINE# cr . fill ( ) #NEWLINE# arr8 = data #NEWLINE# stride = cairo . ImageSurface . format_stride_for_width ( cairo . FORMAT_ARGB32 , width ) #NEWLINE# img_surface = cairo . ImageSurface . create_for_data ( arr8 , cairo . FORMAT_ARGB32 , dawd , daht , stride ) #NEWLINE# cr . set_source_surface ( img_surface , dst_x , dst_y ) #NEWLINE# cr . set_operator ( cairo . OPERATOR_SOURCE ) #NEWLINE# cr . mask_surface ( img_surface , dst_x , dst_y ) #NEWLINE# cr . fill ( ) #NEWLINE# if self . t_ [ 'show_pan_position' ] : #NEWLINE# #INDENT# cr . set_source_rgb ( 1.0 , 0.0 , 0.0 ) #NEWLINE# cr . set_line_width ( 1 ) #NEWLINE# ( ctr_x , ctr_y ) = self . get_center ( ) #NEWLINE# cr . move_to ( ( ctr_x - 10 ) , ctr_y ) #NEWLINE# cr . line_to ( ( ctr_x + 10 ) , ctr_y ) #NEWLINE# cr . move_to ( ctr_x , ( ctr_y - 10 ) ) #NEWLINE# cr . line_to ( ctr_x , ( ctr_y + 10 ) ) #NEWLINE# cr . close_path ( ) #NEWLINE# cr . stroke_preserve ( ) #NEWLINE# #UNINDENT# if self . message : #NEWLINE# #INDENT# self . draw_message ( cr , imgwin_wd , imgwin_ht , self . message )