示例#1
0
/*****************************************************************************
 * FUNCTION
 *  wgui_text_label_show
 * DESCRIPTION
 *  show the text label component
 * PARAMETERS
 *  text_label_id   [IN]    Id of text label
 * RETURNS
 *  void
 *****************************************************************************/
void wgui_text_label_show(U32 text_label_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    GDI_HANDLE old_lcd, old_layer;
    
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (text_label_id >= WGUI_TEXT_LABEL_MAX ||
        wgui_text_label_list[text_label_id].active == MMI_FALSE)
    {
        return;
    }

    GDI_LOCK;
            
    gdi_layer_get_active(&old_layer);
    gdi_lcd_get_active(&old_lcd);

    gdi_lcd_set_active(wgui_text_label_list[text_label_id].target_lcd);
    gdi_layer_push_and_set_active(wgui_text_label_list[text_label_id].target_layer);

    gui_text_label_show(&wgui_text_label_list[text_label_id]);

    gdi_layer_pop_and_restore_active();

    gdi_lcd_set_active(old_lcd);
    gdi_layer_set_active(old_layer);
            
    GDI_UNLOCK;
}
示例#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();
    }

}