Beispiel #1
0
/*****************************************************************************
 * FUNCTION
 *  mmi_sample_drawing_image
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_sample_drawing_image(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 image_width;
    S32 image_height;
    S32 offset_x;
    S32 offset_y;
    GDI_RESULT ret;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* clear base layer as black */
    gdi_layer_clear(GDI_COLOR_BLACK);

    /* get image size */
    ret = gdi_image_get_dimension_id(IMG_ID_DEVAPP_1, &image_width, &image_height);

    if (ret < 0)
    {
        /* error handling */
    }

    /* align at center */
    offset_x = (UI_device_width - image_width) >> 1;
    offset_y = (UI_device_width - image_height) >> 1;

    gdi_image_draw_id(offset_x, offset_y, IMG_ID_DEVAPP_1);

}
static S32 mmi_em_profiling_gdi_misc_2d_nb(void *v_param)
{
    gdi_handle src_layer, dest_layer;
    gdi_lt_matrix_struct affine_transform =
    {
        { 1.8f, 0.0f, 5.0f,
          0.0f, 1.9f, 5.0f,
          0.0f, 0.0f, 1.0f }
    };

    src_layer = mmi_em_profiling_gdi_create_layer(GDI_COLOR_FORMAT_32_PARGB, 0, 0, 100, 100);
    dest_layer = mmi_em_profiling_gdi_create_layer(GDI_COLOR_FORMAT_32_PARGB, 0, 0, 200, 200);
    gdi_layer_push_and_set_active(src_layer);
    gdi_layer_clear(GDI_COLOR_GREEN);
    gdi_image_draw_id(0, 0, IMG_GLOBAL_QUESTION);
    
    gdi_layer_set_active(dest_layer);
    gdi_layer_clear(GDI_COLOR_BLACK);

    gdi_2d_linear_transfrom(
        affine_transform.m,
        src_layer,
        0,
        0,
        100,
        100,
        0,
        0,
        200,
        200,
        GDI_LT_SRC_KEY_EDGE_FILTER_DULPLICATE,
        GDI_COLOR_WHITE,
        GDI_LT_SAMPLE_MODE_BILINEAR_WITH_EDGE_FILTER_DULPLICATE,
        GDI_LT_FLAG_NON_BLOCKING);

    gdi_layer_pop_and_restore_active();

    gdi_2d_fill_rect(
        dest_layer, dest_layer, 50, 50, 100, 100, 
        255, gdi_cf_get_color(GDI_COLOR_FORMAT_32_PARGB, 128, 255, 255, 255),
        GDI_2D_FILL_FLAG_ALPHA_BLENDING | GDI_2D_FILL_FLAG_NON_BLOCKING,
        NULL);

    gdi_2d_fill_rect_wait_for_finish();

    mmi_em_profiling_gdi_misc_blt_case(dest_layer, 0, 0, 0);

    mmi_em_profiling_gdi_free_layer(src_layer);
    mmi_em_profiling_gdi_free_layer(dest_layer);

    return 0;
}