Example #1
0
void SF_vdo_screen_update(const lcd_frame_update_struct *lcd_param_temp )
{
	U8 *buf_ptr;
	U8  layer_pos;
	
        lcd_frame_update_struct * lcd_param = &lcd_data;
	 
	if ((lcd_param->hw_update_layer & LCD_LAYER0_ENABLE) != 0)
		layer_pos = 0;
	else if ((lcd_param->hw_update_layer & LCD_LAYER1_ENABLE) != 0)
		layer_pos = 1;
	else if ((lcd_param->hw_update_layer & LCD_LAYER2_ENABLE) != 0)
		layer_pos = 2;
	else if ((lcd_param->hw_update_layer & LCD_LAYER3_ENABLE) != 0)
		layer_pos = 3;
	else
		MMI_ASSERT(0);

	vdo_get_active_buffer(&buf_ptr);

	if (lcd_param->rotate_value == MDI_VIDEO_LCD_ROTATE_270)
	{
		//{{方案一
		//START_LCD_TRANSFER;
		//}}方案一
		
		//{{方案二
		gdi_layer_blt_previous(lcd_param->lcm_start_y, lcd_param->lcm_start_x, lcd_param->lcm_end_y, lcd_param->lcm_end_x);
		//}}方案二
	}
	else
	{
		LCDDisplay_adrs(lcd_param, buf_ptr, layer_pos);
	}
}
Example #2
0
/*****************************************************************************
 * FUNCTION
 *  gdi_image_decoder_decode_finish_hdlr
 * DESCRIPTION
 *  
 * PARAMETERS
 *  msgPtr      [?]     
 * RETURNS
 *  void
 *****************************************************************************/
void gdi_image_decoder_decode_finish_hdlr(void *msgPtr)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 *dest_buf_ptr;
    U8 *src_buf_ptr;

    S32 index;
    S32 dest_width;
    S32 dest_height;
    S32 dest_offset_x;
    S32 dest_offset_y;
    S32 dest_pitch;
    S32 src_pitch;
    S32 layer_offset_x, layer_offset_y;
    BOOL is_blt;
    gdi_rect_struct dest_clip;
    gdi_handle handle;
    S32 fs_ret;
    gdi_handle old_layer_handle;
    gdi_handle old_lcd_handle;
    U8 src_cf;

    media_img_decode_finish_ind_struct *para_ptr = (media_img_decode_finish_ind_struct*) msgPtr;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* no item. this will occure if driver already send out message to GDI, meanwhile user call
       decoder_stop to remove this decoder item. so this index will be -1 */
    if (gdi_image_decoder_item_first_idx == -1)
    {
        return;
    }

    /* jpeg_local_para_struct *para_ptr = (jpeg_local_para_struct*)msgPtr; */

    /* ignore this message if it is not in the list */
    if (para_ptr->seq_num != gdi_image_decoder_item_list[gdi_image_decoder_item_first_idx].seq_num)
    {
        return;
    }

    /* check if hw is powered on */
    /* ASSERT(gdi_image_jpeg_is_hw_init == TRUE); */

    /* close file handle */
    /* DRM_REPLACE */
    /* fs_ret = FS_Close(gdi_image_decoder_item_list[gdi_image_decoder_item_first_idx].file_handle); */
    fs_ret = DRM_close_file(gdi_image_decoder_item_list[gdi_image_decoder_item_first_idx].file_handle);
    ASSERT(fs_ret >= 0);

    handle = gdi_image_decoder_item_list[gdi_image_decoder_item_first_idx].seq_num;

    /* if decode succeed */
    if (para_ptr->result == MED_RES_OK)
    {
        /* set variables */
        index = gdi_image_decoder_item_first_idx;

        dest_width = gdi_image_decoder_item_list[index].dest_width;
        dest_height = gdi_image_decoder_item_list[index].dest_height;

        dest_offset_x = gdi_image_decoder_item_list[index].dest_offset_x;
        dest_offset_y = gdi_image_decoder_item_list[index].dest_offset_y;
        dest_clip.x1 = gdi_image_decoder_item_list[index].clipx1;
        dest_clip.y1 = gdi_image_decoder_item_list[index].clipy1;
        dest_clip.x2 = gdi_image_decoder_item_list[index].clipx2;
        dest_clip.y2 = gdi_image_decoder_item_list[index].clipy2;
        dest_pitch = gdi_act_layer->width;

        is_blt = gdi_image_decoder_item_list[index].is_blt;

        /* get actual resized image, with stuffing pixels */
        src_pitch = para_ptr->image_width;

        /* if not totally out of clip region */
        if (!((dest_offset_x > dest_clip.x2) ||
              (dest_offset_y > dest_clip.y2) ||
              (dest_offset_x + dest_width < dest_clip.x1) || (dest_offset_y + dest_height < dest_clip.y1)))
        {

            gdi_lcd_get_active(&old_lcd_handle);
            gdi_lcd_set_active(gdi_image_decoder_item_list[index].lcd_handle);

            gdi_layer_get_active(&old_layer_handle);
            gdi_layer_set_active(gdi_image_decoder_item_list[index].layer_handle);

            gdi_layer_get_buffer_ptr(&dest_buf_ptr);
            src_buf_ptr = (U8*) gdi_work_buffer;

    #ifdef GDI_USING_2D_ENGINE_V2
            if (gdi_act_layer->vcf == GDI_COLOR_FORMAT_32)
            {
                src_cf = GDI_COLOR_FORMAT_24;
            }
            else
            {
                src_cf = gdi_act_layer->vcf;
            }
       		gdi_bitblt_internal((U8*)gdi_work_buffer, dest_width, 
	    		0, 0, 
		    	dest_width, dest_height,
			    src_cf,
			    gdi_act_layer->buf_ptr, gdi_act_layer->width,
			    dest_offset_x, dest_offset_y,
			    dest_clip.x1, dest_clip.y1, dest_clip.x2, dest_clip.y2,
			    gdi_act_layer->vcf, gdi_act_layer->layer_size,
			    FALSE,
			    FALSE, 0,
			    FALSE, 0,
			    FALSE, 0,
			    GDI_TRANSFORM_NONE,
			    GDI_TRANSFORM_DIRECTION_LT);
            if (gdi_act_layer_info->source_key_enable)
            {
                gdi_act_replace_src_key(
                    gdi_act_layer->buf_ptr,
                    gdi_act_layer->width,
                    dest_offset_x,
                    dest_offset_y,
                    dest_clip.x1,
                    dest_clip.y1,
                    dest_clip.x2,
                    dest_clip.y2,
                    gdi_act_layer_info->source_key,
                    dest_width,
                    dest_height);
            }

    #else
            gdi_2d_memory_blt(
                src_buf_ptr,    /* src_ptr */
                src_pitch,      /* src_pitch */
                0,              /* src_offset_x */
                0,              /* src_offset_y */
                dest_width,     /* src_width */
                dest_height,    /* src_height */
                dest_buf_ptr,   /* dest_ptr */
                dest_pitch,     /* dest_pitch */
                dest_offset_x,  /* dest_offset_x */
                dest_offset_y,  /* dest_offset_y */
                dest_clip);     /* dest_clip */
    #endif

            gdi_layer_get_position(&layer_offset_x, &layer_offset_y);

            layer_offset_x += dest_offset_x;
            layer_offset_y += dest_offset_y;

            if (is_blt)
            {
                gdi_layer_blt_previous(
                    layer_offset_x,
                    layer_offset_y,
                    layer_offset_x + dest_width,
                    layer_offset_y + dest_height);
            }

            gdi_layer_set_active(old_layer_handle);
            gdi_lcd_set_active(old_lcd_handle);
        }

        if (gdi_image_decoder_result_callback != NULL)
        {
            gdi_image_decoder_result_callback(GDI_SUCCEED, handle);
        }
    }
    else
    {
        if (gdi_image_decoder_result_callback != NULL)
        {
            gdi_image_decoder_result_callback(GDI_FAILED, handle);
        }
    }

    gdi_image_decoder_item_list[gdi_image_decoder_item_first_idx].is_used = FALSE;
    gdi_image_decoder_item_first_idx = gdi_image_decoder_item_list[gdi_image_decoder_item_first_idx].next_idx;

    if (gdi_image_decoder_item_first_idx != -1)
    {
        gdi_image_decoder_decode_from_list();
    }

}
Example #3
0
/*
方案二*/
void SFScreen_Update(void)
{
	gdi_layer_blt_previous(0, 0,LCD_WIDTH, LCD_HEIGHT);
}
Example #4
0
/*****************************************************************************
 * FUNCTION
 *  mmi_sample_3dgame_entry_app_screen
 * DESCRIPTION
 *  enter dev3dgame screen - init an MMI  environment for 3D game
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_sample_3dgame_entry_app_screen(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    PU8 gui_buffer;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    EntryNewScreen(SCR_ID_3D_GAME, mmi_sample_3dgame_exit_app_screen, mmi_sample_3dgame_entry_app_screen, NULL);

    gui_buffer = GetCurrGuiBuffer(SCR_ID_3D_GAME);

    /* reset clip */
    gdi_layer_reset_clip();
    gdi_layer_reset_text_clip();

    /* enable multilayer */
    gdi_layer_multi_layer_enable();

    /* entry full screen app - will force status bar update */
    entry_full_screen();

    /* force all playing keypad tone off */
    mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_DISABLED);

    /* set audio volumn */
    mdi_audio_set_volume(MDI_VOLUME_MEDIA, 4);  /* vol level : 0 - 6 */

    /* suspend background play */
    mdi_audio_suspend_background_play();

    /* stop MMI sleep */
    TurnOnBacklight(0);

    /* clear keys */
    ClearInputEventHandler(MMI_DEVICE_ALL);
    clear_category_screen_key_handlers();

    /* set RSK-up to exit */
    SetKeyHandler(GoBackHistory, KEY_RSK, KEY_EVENT_UP);

    /* clear background as black */
    gdi_layer_clear(GDI_COLOR_BLACK);
    gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);

#ifndef WIN32
    /* enable faster key handling */
    mmi_frm_set_key_handle_in_high_frequency(MMI_TRUE);
#endif /* WIN32 */ 

#ifdef __MMI_SUBLCD__
    /* draw game icon on sublcd */
    ForceSubLCDScreen(mmi_sample_3dgame_entry_sublcd);
#endif /* __MMI_SUBLCD__ */ 

    /* disalbe align timer, this will let timer more accurate */
    UI_disable_alignment_timers();

    /* start game */
    if (gui_buffer == NULL)
    {
        /* TODO: start new game here .. */

    }
    else
    {
        /* back from interrupt */
        /* TODO: resume a existing game here .. */
    }

}