Home | History | Annotate | Download | only in cairo

Lines Matching refs:cr

69 static inline void setColor(cairo_t* cr, const Color& col)
73 cairo_set_source_rgba(cr, red, green, blue, alpha);
76 static inline void setPlatformFill(GraphicsContext* context, cairo_t* cr, GraphicsContextPrivate* gcp)
78 cairo_save(cr);
81 cairo_set_source(cr, gcp->state.fillPattern->createPlatformPattern(affine));
83 cairo_set_source(cr, gcp->state.fillGradient->platformGradient());
85 setColor(cr, context->fillColor());
86 cairo_clip_preserve(cr);
87 cairo_paint_with_alpha(cr, gcp->state.globalAlpha);
88 cairo_restore(cr);
91 static inline void setPlatformStroke(GraphicsContext* context, cairo_t* cr, GraphicsContextPrivate* gcp)
93 cairo_save(cr);
96 cairo_set_source(cr, gcp->state.strokePattern->createPlatformPattern(affine));
98 cairo_set_source(cr, gcp->state.strokeGradient->platformGradient());
101 setColor(cr, strokeColor);
104 cairo_push_group(cr);
105 cairo_paint_with_alpha(cr, gcp->state.globalAlpha);
106 cairo_pop_group_to_source(cr);
108 cairo_stroke_preserve(cr);
109 cairo_restore(cr);
113 static inline void fillRectSourceOver(cairo_t* cr, const FloatRect& rect, const Color& col)
115 setColor(cr, col);
116 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
117 cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
118 cairo_fill(cr);
163 cairo_t* cr = context->platformContext();
164 cairo_path_t* path = cairo_copy_path(cr);
167 cairo_stroke_extents(cr, &x0, &y0, &x1, &y1);
169 cairo_fill_extents(cr, &x0, &y0, &x1, &y1);
182 copyContextProperties(cr, shadowContext);
196 GraphicsContext::GraphicsContext(PlatformGraphicsContext* cr)
200 m_data->cr = cairo_reference(cr);
201 m_data->syncContext(cr);
202 setPaintingDisabled(!cr);
213 cairo_t* cr = platformContext();
215 cairo_get_matrix(cr, &m);
221 return m_data->cr;
226 cairo_save(m_data->cr);
232 cairo_restore(m_data->cr);
242 cairo_t* cr = m_data->cr;
243 cairo_save(cr);
246 fillRectSourceOver(cr, rect, fillColor());
249 setColor(cr, strokeColor());
252 cairo_rectangle(cr, r.x(), r.y(), r.width(), r.height());
253 cairo_set_line_width(cr, 1.0);
254 cairo_stroke(cr);
257 cairo_restore(cr);
270 cairo_t* cr = m_data->cr;
271 cairo_save(cr);
282 cairo_set_line_width(cr, width);
297 setColor(cr, strokeColor());
299 cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
305 fillRectSourceOver(cr, FloatRect(p1.x() - width/2, p1.y() - width, width, width), strokeColor());
306 fillRectSourceOver(cr, FloatRect(p2.x() - width/2, p2.y(), width, width), strokeColor());
308 fillRectSourceOver(cr, FloatRect(p1.x() - width, p1.y() - width/2, width, width), strokeColor());
309 fillRectSourceOver(cr, FloatRect(p2.x(), p2.y() - width/2, width, width), strokeColor());
341 cairo_set_dash(cr, &dash, 1, patternOffset);
344 cairo_move_to(cr, p1.x(), p1.y());
345 cairo_line_to(cr, p2.x(), p2.y());
347 cairo_stroke(cr);
348 cairo_restore(cr);
357 cairo_t* cr = m_data->cr;
358 cairo_save(cr);
361 cairo_translate(cr, rect.x() + xRadius, rect.y() + yRadius);
362 cairo_scale(cr, xRadius, yRadius);
363 cairo_arc(cr, 0., 0., 1., 0., 2 * M_PI);
364 cairo_restore(cr);
367 setColor(cr, fillColor());
368 cairo_fill_preserve(cr);
372 setColor(cr, strokeColor());
373 cairo_set_line_width(cr, strokeThickness());
374 cairo_stroke(cr);
377 cairo_new_path(cr);
397 cairo_t* cr = m_data->cr;
398 cairo_save(cr);
401 cairo_scale(cr, 1., scaleFactor);
403 cairo_arc_negative(cr, x + hRadius, (y + vRadius) * reverseScaleFactor, hRadius, -fa * M_PI/180, -falen * M_PI/180);
406 cairo_scale(cr, 1., reverseScaleFactor);
422 setColor(cr, strokeColor());
459 cairo_set_dash(cr, &dash, 1, patternOffset);
462 cairo_stroke(cr);
463 cairo_restore(cr);
474 cairo_t* cr = m_data->cr;
476 cairo_save(cr);
477 cairo_set_antialias(cr, shouldAntialias ? CAIRO_ANTIALIAS_DEFAULT : CAIRO_ANTIALIAS_NONE);
478 cairo_move_to(cr, points[0].x(), points[0].y());
480 cairo_line_to(cr, points[i].x(), points[i].y());
481 cairo_close_path(cr);
484 setColor(cr, fillColor());
485 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
486 cairo_fill_preserve(cr);
490 setColor(cr, strokeColor());
491 cairo_set_line_width(cr, strokeThickness());
492 cairo_stroke(cr);
495 cairo_new_path(cr);
496 cairo_restore(cr);
504 cairo_t* cr = m_data->cr;
506 cairo_set_fill_rule(cr, fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
509 setPlatformFill(this, cr, m_common);
510 cairo_new_path(cr);
518 cairo_t* cr = m_data->cr;
521 setPlatformStroke(this, cr
522 cairo_new_path(cr);
531 cairo_t* cr = m_data->cr;
533 cairo_set_fill_rule(cr, fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
536 setPlatformFill(this, cr, m_common);
537 setPlatformStroke(this, cr, m_common);
538 cairo_new_path(cr);
546 cairo_t* cr = m_data->cr;
547 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
582 fillRectSourceOver(m_data->cr, rect, color);
590 cairo_t* cr = m_data->cr;
591 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
592 cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
593 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_WINDING);
594 cairo_clip(cr);
595 cairo_set_fill_rule(cr, savedFillRule);
604 cairo_t* cr = m_data->cr;
605 cairo_set_fill_rule(cr, clipRule == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
606 cairo_clip(cr);
621 cairo_t* cr = m_data->cr;
622 cairo_save(cr);
623 cairo_push_group(cr);
624 cairo_new_path(cr);
632 gdk_cairo_region(cr, reg);
635 setColor(cr, color);
636 cairo_set_line_width(cr, 2.0f);
645 setColor(cr, ringColor);
646 cairo_set_line_width(cr, width);
650 cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
651 cairo_stroke_preserve(cr);
653 cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
654 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_WINDING);
655 cairo_fill(cr);
657 cairo_pop_group_to_source(cr);
658 cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
659 cairo_paint(cr);
660 cairo_restore(cr);
683 cairo_t* cr = m_data->cr;
684 cairo_save(cr);
689 cairo_set_source_rgb(cr, 0, 1, 0);
691 cairo_set_source_rgb(cr, 1, 0, 0);
695 pango_cairo_show_error_underline(cr, origin.x(), origin.y(), width, cMisspellingLineThickness);
700 cairo_restore(cr);
708 cairo_t* cr = m_data->cr;
709 cairo_user_to_device(cr, &x, &y);
712 cairo_device_to_user(cr, &x, &y);
717 cairo_user_to_device_distance(cr, &x, &y);
720 cairo_device_to_user_distance(cr, &x, &y);
731 cairo_t* cr = m_data->cr;
732 cairo_translate(cr, x, y);
739 cairo_t* cr = m_data->cr;
740 cairo_get_matrix(cr, &matrix);
761 cairo_set_line_width(m_data->cr, strokeThickness);
775 cairo_set_line_width(m_data->cr, 0);
778 cairo_set_dash(m_data->cr, 0, 0, 0);
781 cairo_set_dash(m_data->cr, dotPattern, 2, 0);
784 cairo_set_dash(m_data->cr, dashPattern, 2, 0);
799 cairo_t* cr = m_data->cr;
801 cairo_transform(cr, &matrix);
821 cairo_t* cr = m_data->cr;
822 cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
823 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
824 cairo_clip(cr);
825 cairo_set_fill_rule(cr, savedFillRule);
851 cairo_t* cr = m_data->cr;
855 setColor(cr, shadowColor);
856 cairo_mask_surface(cr, buffer->image()->nativeImageForCurrentFrame(), shadowRect.x(), shadowRect.y());
875 setColor(cr, shadowColor);
876 cairo_mask_surface(cr, blur->resultImage()->image()->nativeImageForCurrentFrame(), shadowRect.x(), shadowRect.y());
890 cairo_t* cr = m_data->cr;
891 cairo_push_group(cr);
901 cairo_t* cr = m_data->cr;
903 cairo_pop_group_to_source(cr);
904 cairo_paint_with_alpha(cr, m_data->layers.last());
914 cairo_t* cr = m_data->cr;
916 cairo_save(cr);
917 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
918 cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
919 cairo_fill(cr);
920 cairo_restore(cr);
928 cairo_t* cr = m_data->cr;
929 cairo_save(cr);
930 cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
931 cairo_set_line_width(cr, width);
933 cairo_restore(cr);
953 cairo_set_line_cap(m_data->cr, cairoCap);
958 cairo_set_dash(m_data->cr, dashes.data(), dashes.size(), dashOffset);
978 cairo_set_line_join(m_data->cr, cairoJoin);
986 cairo_set_miter_limit(m_data->cr, miter);
1041 cairo_set_operator(m_data->cr, toCairoOperator(op));
1049 cairo_t* cr = m_data->cr;
1050 cairo_new_path(cr);
1058 cairo_t* cr = m_data->cr;
1060 cairo_append_path(cr, p);
1069 cairo_t* cr = m_data->cr;
1071 cairo_append_path(cr, p);
1073 cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
1074 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_WINDING);
1075 cairo_clip(cr);
1076 cairo_set_fill_rule(cr, savedFillRule);
1090 cairo_t* cr = m_data->cr;
1092 cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
1093 cairo_rectangle(cr, x1, y1, x2 - x1, y2 - y1);
1096 cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
1097 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
1098 cairo_clip(cr);
1099 cairo_set_fill_rule(cr, savedFillRule);
1107 cairo_rotate(m_data->cr, radians);
1116 cairo_scale(m_data->cr, size.width(), size.height());
1125 cairo_t* cr = m_data->cr;
1127 cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
1128 cairo_rectangle(cr, x1, y1, x2 - x1, y2 - y1);
1129 cairo_rectangle(cr, r.x(), r.y(), r.width(), r.height());
1130 cr);
1131 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
1132 cairo_clip(cr);
1133 cairo_set_fill_rule(cr, savedFillRule);
1151 cairo_t* cr = m_data->cr;
1152 cairo_save(cr);
1155 setColor(cr, color);
1157 cairo_fill(cr);
1158 cairo_restore(cr);
1189 cairo_set_antialias(m_data->cr, enable ? CAIRO_ANTIALIAS_DEFAULT : CAIRO_ANTIALIAS_NONE);