• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ cairo_perf_timer_start函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中cairo_perf_timer_start函数的典型用法代码示例。如果您正苦于以下问题:C++ cairo_perf_timer_start函数的具体用法?C++ cairo_perf_timer_start怎么用?C++ cairo_perf_timer_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了cairo_perf_timer_start函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: do_composite_checker

static cairo_perf_ticks_t
do_composite_checker (cairo_t *cr,
                      int      width,
                      int      height)
{
    /* Compute zoom so that the src_pattern covers the whole output image. */
    double xscale = width / (double) SRC_SIZE;
    double yscale = height / (double) SRC_SIZE;

    cairo_perf_timer_start ();

    cairo_identity_matrix (cr);

    /* Fill the surface with our background. */
    cairo_set_source (cr, checkerboard);
    cairo_paint (cr);

    /* Draw the scaled image on top. */
    cairo_scale (cr, xscale, yscale);
    cairo_set_source (cr, src_pattern);
    cairo_paint (cr);

    cairo_perf_timer_stop ();
    return cairo_perf_timer_elapsed ();
}
开发者ID:AliYousuf,项目名称:cairo,代码行数:25,代码来源:composite-checker.c


示例2: do_curve_fill

static cairo_time_t
do_curve_fill (cairo_t *cr, int width, int height, int loops)
{
    state = 0xc0ffee;
    cairo_perf_timer_start ();

    while (loops--) {
	double x0 = uniform_random (0, width);
	double x1 = uniform_random (0, width);
	double x2 = uniform_random (0, width);
	double x3 = uniform_random (0, width);
	double xm = uniform_random (0, width);
	double xn = uniform_random (0, width);
	double y0 = uniform_random (0, height);
	double y1 = uniform_random (0, height);
	double y2 = uniform_random (0, height);
	double y3 = uniform_random (0, height);
	double ym = uniform_random (0, height);
	double yn = uniform_random (0, height);

	cairo_move_to (cr, xm, ym);
	cairo_curve_to (cr, x1, y1, x2, y2, xn, yn);
	cairo_curve_to (cr, x3, y3, x0, y0, xm, ym);
	cairo_close_path (cr);

	cairo_fill(cr);
    }

    cairo_perf_timer_stop ();

    return cairo_perf_timer_elapsed ();
}
开发者ID:AZed,项目名称:cairo,代码行数:32,代码来源:a1-curve.c


示例3: do_stroke

static cairo_time_t
do_stroke (cairo_t *cr, int width, int height, int loops)
{
    cairo_arc (cr,
	       width/2.0, height/2.0,
	       width/3.0,
	       0, 2 * M_PI);
    cairo_close_path (cr);

    cairo_set_line_width (cr, width/5.0);

    cairo_perf_timer_start ();
    cairo_perf_set_thread_aware (cr, FALSE);

    while (loops--) {
	if (loops == 0)
		cairo_perf_set_thread_aware (cr, TRUE);
	cairo_stroke_preserve (cr);
    }

    cairo_perf_timer_stop ();

    cairo_new_path (cr);

    return cairo_perf_timer_elapsed ();
}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:26,代码来源:stroke.c


示例4: do_long_dashed_lines

static cairo_perf_ticks_t
do_long_dashed_lines (cairo_t *cr, int width, int height, int loops)
{
    double dash[2] = { 2.0, 2.0 };
    int i;

    cairo_save (cr);
    cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
    cairo_paint (cr);

    cairo_set_source_rgb (cr, 1.0, 0.0, 0.0);
    cairo_set_dash (cr, dash, 2, 0.0);

    cairo_new_path (cr);
    cairo_set_line_width (cr, 1.0);

    for (i = 0; i < height-1; i++) {
	double y0 = (double) i + 0.5;
	cairo_move_to (cr, 0.0, y0);
	cairo_line_to (cr, width, y0);
    }

    cairo_perf_timer_start ();

    while (loops--)
	cairo_stroke_preserve (cr);

    cairo_perf_timer_stop ();

    cairo_restore (cr);

    return cairo_perf_timer_elapsed ();
}
开发者ID:jaglass,项目名称:WinCairoRequirements,代码行数:33,代码来源:long-dashed-lines.c


示例5: do_text

static cairo_time_t
do_text (cairo_t *cr, int width, int height, int loops)
{
    const char text[] = "the jay, pig, fox, zebra and my wolves quack";
    int len = strlen (text);
    double x, y;
    int i = 0, j = 0;

    cairo_set_font_size (cr, 9);

    cairo_perf_timer_start ();
    cairo_perf_set_thread_aware (cr, FALSE);

    while (loops--) {
	if (loops == 0)
		cairo_perf_set_thread_aware (cr, TRUE);
	do {
	    cairo_move_to (cr, 0, j++ * 10);
	    cairo_show_text (cr, text + i);
	    cairo_get_current_point (cr, &x, &y);
	    while (x < width && cairo_status (cr) == CAIRO_STATUS_SUCCESS) {
		cairo_show_text (cr, text);
		cairo_get_current_point (cr, &x, &y);
	    }
	    if (++i >= len)
		i = 0;
	} while (y < height && cairo_status (cr) == CAIRO_STATUS_SUCCESS);
    }

    cairo_perf_timer_stop ();

    return cairo_perf_timer_elapsed ();
}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:33,代码来源:text.c


示例6: box_outline_aa_stroke

static cairo_time_t
box_outline_aa_stroke (cairo_t *cr, int width, int height, int loops)
{
    cairo_set_source_rgb (cr, 0, 0, 1); /* blue */
    cairo_paint (cr);

    cairo_translate (cr, .5, .5);
    cairo_rectangle (cr,
		     1.5, 1.5,
		     width - 3, height - 3);
    cairo_set_line_width (cr, 1.0);
    cairo_set_source_rgb (cr, 1, 0, 0); /* red */

    cairo_perf_timer_start ();
    cairo_perf_set_thread_aware (cr, FALSE);

    while (loops--) {
	if (loops == 0)
	    cairo_perf_set_thread_aware (cr, TRUE);
	cairo_stroke_preserve (cr);
    }

    cairo_perf_timer_stop ();

    cairo_new_path (cr);

    return cairo_perf_timer_elapsed ();
}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:28,代码来源:box-outline.c


示例7: box_outline_fill

static cairo_perf_ticks_t
box_outline_fill (cairo_t *cr, int width, int height, int loops)
{
    cairo_set_source_rgb (cr, 0, 0, 1); /* blue */
    cairo_paint (cr);

    cairo_rectangle (cr,
		     1.0, 1.0,
		     width - 2, height - 2);
    cairo_rectangle (cr,
		     2.0, 2.0,
		     width - 4, height - 4);
    cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
    cairo_set_source_rgb (cr, 0, 1, 0); /* green */

    cairo_perf_timer_start ();

    while (loops--)
	cairo_fill_preserve (cr);

    cairo_perf_timer_stop ();

    cairo_new_path (cr);

    return cairo_perf_timer_elapsed ();
}
开发者ID:jaglass,项目名称:WinCairoRequirements,代码行数:26,代码来源:box-outline.c


示例8: draw

static cairo_time_t
draw (cairo_t *cr, int width, int height, int loops)
{
    int t_height = height/2;
    int t_width = t_height / m_1_sqrt_3;

    cairo_set_source_rgb (cr, 1, 1, 1);
    cairo_paint (cr);

    cairo_set_source_rgb (cr, 0, 0, 0);
    cairo_set_line_width (cr, 1.);

    cairo_perf_timer_start ();
    cairo_perf_set_thread_aware (cr, FALSE);

    while (loops--) {
	if (loops == 0)
		cairo_perf_set_thread_aware (cr, TRUE);
	cairo_save (cr);
	T (cr, t_width);

	cairo_translate (cr, 0, height);
	cairo_scale (cr, 1, -1);

	T (cr, t_width);

	cairo_stroke (cr);
	cairo_restore (cr);
    }

    cairo_perf_timer_stop ();

    return cairo_perf_timer_elapsed ();
}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:34,代码来源:sierpinski.c


示例9: box_outline_aa_fill

static cairo_time_t
box_outline_aa_fill (cairo_t *cr, int width, int height, int loops)
{
    cairo_set_source_rgb (cr, 0, 0, 1); /* blue */
    cairo_paint (cr);

    cairo_translate (cr, .5, .5);
    cairo_rectangle (cr,
		     1.0, 1.0,
		     width - 2, height - 2);
    cairo_rectangle (cr,
		     2.0, 2.0,
		     width - 4, height - 4);
    cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
    cairo_set_source_rgb (cr, 0, 1, 0); /* green */

    cairo_perf_timer_start ();
    cairo_perf_set_thread_aware (cr, FALSE);

    while (loops--) {
	if (loops == 0)
	    cairo_perf_set_thread_aware (cr, TRUE);
	cairo_fill_preserve (cr);
    }

    cairo_perf_timer_stop ();

    cairo_new_path (cr);

    return cairo_perf_timer_elapsed ();
}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:31,代码来源:box-outline.c


示例10: do_curve_stroke

static cairo_time_t
do_curve_stroke (cairo_t *cr, int width, int height, int loops)
{
    state = 0xc0ffee;
    cairo_set_line_width (cr, 2.);
    cairo_perf_timer_start ();
    cairo_perf_set_thread_aware (cr, FALSE);

    while (loops--) {
	if (loops == 0)
		cairo_perf_set_thread_aware (cr, TRUE);
	double x1 = uniform_random (0, width);
	double x2 = uniform_random (0, width);
	double x3 = uniform_random (0, width);
	double y1 = uniform_random (0, height);
	double y2 = uniform_random (0, height);
	double y3 = uniform_random (0, height);
	cairo_move_to (cr, uniform_random (0, width), uniform_random (0, height));
	cairo_curve_to (cr, x1, y1, x2, y2, x3, y3);
	cairo_stroke(cr);
    }

    cairo_perf_timer_stop ();

    return cairo_perf_timer_elapsed ();
}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:26,代码来源:curve.c


示例11: do_unaligned_clip

static cairo_time_t
do_unaligned_clip (cairo_t *cr, int width, int height, int loops)
{
    cairo_perf_timer_start ();
    cairo_perf_set_thread_aware (cr, FALSE);

    while (loops--) {
	if (loops == 0)
		cairo_perf_set_thread_aware (cr, TRUE);
	cairo_save (cr);

	/* First a triangular clip that obviously isn't along device-pixel
	 * boundaries. */
	cairo_move_to (cr, 50, 50);
	cairo_line_to (cr, 50, 90);
	cairo_line_to (cr, 90, 90);
	cairo_close_path (cr);
	cairo_clip (cr);

	/* Then a rectangular clip that would be but for the non-integer
	 * scaling. */
	cairo_scale (cr, 1.1, 1.1);
	cairo_rectangle (cr, 55, 55, 35, 35);
	cairo_clip (cr);

	/* And paint something to force the clip to be evaluated. */
	cairo_paint (cr);

	cairo_restore (cr);
    }

    cairo_perf_timer_stop ();

    return cairo_perf_timer_elapsed ();
}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:35,代码来源:unaligned-clip.c


示例12: do_pattern_create_radial

static cairo_time_t
do_pattern_create_radial (cairo_t *cr, int width, int height, int loops)
{
    cairo_perf_timer_start ();
    cairo_perf_set_thread_aware (cr, FALSE);

    while (loops--) {
	cairo_pattern_t *pattern;
	int i;

	if (loops == 0)
		cairo_perf_set_thread_aware (cr, TRUE);

	for (i = 0; i < RADIALS_COUNT; i++) {
	    pattern =
		cairo_pattern_create_radial (radials[i].cx0, radials[i].cy0,
					     radials[i].radius0,
					     radials[i].cx1, radials[i].cy1,
					     radials[i].radius1);
	    cairo_pattern_destroy (pattern);
	}
    }

    cairo_perf_timer_stop ();

    return cairo_perf_timer_elapsed ();
}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:27,代码来源:pattern_create_radial.c


示例13: do_wide_fills

static cairo_time_t
do_wide_fills (cairo_t *cr, int width, int height, int loops)
{
    int count;

    /* lots and lots of overlapping stroke-like fills */
    state = 0xc0ffee;
    for (count = 0; count < 1000; count++) {
	cairo_save (cr);
	cairo_translate (cr,
			 uniform_random (0, width),
			 uniform_random (0, height));
	cairo_rotate (cr, uniform_random (-M_PI,M_PI));
	cairo_rectangle (cr, 0, 0, uniform_random (0, width), 5);
	cairo_restore (cr);
    }

    cairo_perf_timer_start ();

    while (loops--)
	cairo_fill_preserve (cr);

    cairo_perf_timer_stop ();

    cairo_new_path (cr);

    return cairo_perf_timer_elapsed ();
}
开发者ID:AZed,项目名称:cairo,代码行数:28,代码来源:wide-fills.c


示例14: do_strokes

static cairo_time_t
do_strokes (cairo_t *cr, int width, int height, int loops)
{
    /* a pair of overlapping rectangles */
    rounded_rectangle (cr,
		       2, 2, width/2. + 10, height/2. + 10,
		       10);
    rounded_rectangle (cr,
		       width/2. - 10, height/2. - 10,
		       width/2. - 2, height/2. - 2,
		       10);

    cairo_set_line_width (cr, 2.);

    cairo_perf_timer_start ();
    cairo_perf_set_thread_aware (cr, FALSE);

    while (loops--) {
	if (loops == 0)
		cairo_perf_set_thread_aware (cr, TRUE);
	cairo_stroke_preserve (cr);
    }

    cairo_perf_timer_stop ();

    cairo_new_path (cr);

    return cairo_perf_timer_elapsed ();
}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:29,代码来源:stroke.c


示例15: draw_spiral_stroke

static cairo_time_t
draw_spiral_stroke (cairo_t *cr,
		    align_t align,
		    int width, int height, int loops)
{
    const int step = 3;
    int side = width < height ? width : height;

    cairo_save (cr);
    cairo_set_source_rgb (cr, 0, 0, 0);
    cairo_paint (cr);

    cairo_translate (cr, 1, 1);
    cairo_set_source_rgb (cr, 1, 0, 0);
    cairo_set_line_width (cr, 4.);
    cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER);
    cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);

    cairo_new_path (cr);
    switch (align) {
    case PIXALIGN: cairo_move_to (cr, 0,0); break;
    case NONALIGN: cairo_move_to (cr, 0.1415926, 0.7182818); break;
    }
    while (side >= step) {
	cairo_rel_line_to (cr, 0, side);
        side -= step;
	if (side <= 0)
	    break;

	cairo_rel_line_to (cr, side, 0);
        side -= step;
	if (side <= 0)
	    break;

	cairo_rel_line_to (cr, 0, -side);
        side -= step;
	if (side <= 0)
	    break;

	cairo_rel_line_to (cr, -side, 0);
        side -= step;
	if (side <= 0)
	    break;
    }

    cairo_perf_timer_start ();
    cairo_perf_set_thread_aware (cr, FALSE);
    while (loops--) {
	if (loops == 0)
	    cairo_perf_set_thread_aware (cr, TRUE);
        cairo_stroke_preserve (cr);
    }

    cairo_perf_timer_stop ();

    cairo_restore (cr);

    return cairo_perf_timer_elapsed ();
}
开发者ID:csyuschmjuh,项目名称:apl,代码行数:59,代码来源:spiral.c


示例16: do_world_map

static cairo_perf_ticks_t
do_world_map (cairo_t *cr, int width, int height, int loops)
{
    const wm_element_t *e;
    double cx, cy;

    cairo_set_line_width (cr, 0.2);

    cairo_perf_timer_start ();

    while (loops--) {
        cairo_set_source_rgb (cr, .68, .85, .90); /* lightblue */
        cairo_rectangle (cr, 0, 0, 800, 400);
        cairo_fill (cr);

        e = &countries[0];
        while (1) {
            switch (e->type) {
            case WM_NEW_PATH:
            case WM_END:
                cairo_set_source_rgb (cr, .75, .75, .75); /* silver */
                cairo_fill_preserve (cr);
                cairo_set_source_rgb (cr, .50, .50, .50); /* gray */
                cairo_stroke (cr);
                cairo_move_to (cr, e->x, e->y);
                break;
            case WM_MOVE_TO:
                cairo_close_path (cr);
                cairo_move_to (cr, e->x, e->y);
                break;
            case WM_LINE_TO:
                cairo_line_to (cr, e->x, e->y);
                break;
            case WM_HLINE_TO:
                cairo_get_current_point (cr, &cx, &cy);
                cairo_line_to (cr, e->x, cy);
                break;
            case WM_VLINE_TO:
                cairo_get_current_point (cr, &cx, &cy);
                cairo_line_to (cr, cx, e->y);
                break;
            case WM_REL_LINE_TO:
                cairo_rel_line_to (cr, e->x, e->y);
                break;
            }
            if (e->type == WM_END)
                break;
            e++;
        }

        cairo_new_path (cr);
    }

    cairo_perf_timer_stop ();

    return cairo_perf_timer_elapsed ();
}
开发者ID:Grlfx,项目名称:WinObjC,代码行数:57,代码来源:world-map.c


示例17: do_long_lines

static cairo_perf_ticks_t
do_long_lines (cairo_t *cr, int width, int height, long_lines_crop_t crop)
{
    int i;
    double x, y, dx, dy, min_x, min_y, max_x, max_y;
    double outer_width, outer_height;

    cairo_save (cr);

    cairo_translate (cr, width / 2, height / 2);

    if (crop == LONG_LINES_UNCROPPED) {
	outer_width = LONG_FACTOR * width;
	outer_height = LONG_FACTOR * height;
	cairo_set_source_rgb (cr, 1.0, 0.0, 0.0); /* red */
    } else {
	outer_width = width;
	outer_height = height;
	cairo_set_source_rgb (cr, 0.0, 1.0, 0.0); /* green */
    }

    min_x = x = - outer_width / 2.0;
    min_y = y = - outer_height / 2.0;
    max_x = outer_width / 2.0;
    max_y = outer_width / 2.0;
    dx = outer_width / NUM_LINES;
    dy = outer_height / NUM_LINES;

    cairo_perf_timer_start ();

    for (i = 0; i < NUM_LINES; i++) {
	cairo_move_to (cr, 0, 0);
	cairo_line_to (cr, x, min_y);
	cairo_stroke (cr);

	cairo_move_to (cr, 0, 0);
	cairo_line_to (cr, x, max_y);
	cairo_stroke (cr);

	cairo_move_to (cr, 0, 0);
	cairo_line_to (cr, min_x, y);
	cairo_stroke (cr);

	cairo_move_to (cr, 0, 0);
	cairo_line_to (cr, max_x, y);
	cairo_stroke (cr);

	x += dx;
	y += dy;
    }

    cairo_perf_timer_stop ();

    cairo_restore (cr);

    return cairo_perf_timer_elapsed ();
}
开发者ID:AliYousuf,项目名称:cairo,代码行数:57,代码来源:long-lines.c


示例18: do_rectangle

static cairo_perf_ticks_t
do_rectangle (cairo_t *cr, int width, int height)
{
    cairo_perf_timer_start ();

    cairo_rectangle (cr, 0, 0, width, height);
    cairo_fill (cr);

    cairo_perf_timer_stop ();

    return cairo_perf_timer_elapsed ();
}
开发者ID:3oyka,项目名称:cairo2,代码行数:12,代码来源:rectangles.c


示例19: do_paint_with_alpha

static cairo_perf_ticks_t
do_paint_with_alpha (cairo_t *cr, int width, int height, int loops)
{
    cairo_perf_timer_start ();

    while (loops--)
	cairo_paint_with_alpha (cr, 0.5);

    cairo_perf_timer_stop ();

    return cairo_perf_timer_elapsed ();
}
开发者ID:jaglass,项目名称:WinCairoRequirements,代码行数:12,代码来源:paint-with-alpha.c


示例20: do_subimage_copy

static cairo_perf_ticks_t
do_subimage_copy (cairo_t *cr, int width, int height)
{
    cairo_rectangle (cr, 2, 2, 4, 4);
    cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);

    cairo_perf_timer_start ();

    cairo_fill (cr);

    cairo_perf_timer_stop ();

    return cairo_perf_timer_elapsed ();
}
开发者ID:3oyka,项目名称:cairo2,代码行数:14,代码来源:subimage_copy.c



注:本文中的cairo_perf_timer_start函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cairo_perf_timer_stop函数代码示例发布时间:2022-05-30
下一篇:
C++ cairo_perf_timer_elapsed函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap