Sends a single drawing instruction to this graphics context
(&mut self, d: Draw)
| 269 | |
| 270 | /// Sends a single drawing instruction to this graphics context |
| 271 | fn draw(&mut self, d: Draw) { |
| 272 | use self::Draw::*; |
| 273 | use self::PathOp::*; |
| 274 | |
| 275 | match d { |
| 276 | StartFrame => self.start_frame(), |
| 277 | ShowFrame => self.show_frame(), |
| 278 | ResetFrame => self.reset_frame(), |
| 279 | Path(NewPath) => self.new_path(), |
| 280 | Path(Move(x, y)) => self.move_to(x, y), |
| 281 | Path(Line(x, y) ) => self.line_to(x, y), |
| 282 | Path(BezierCurve(((cp1x, cp1y), (cp2x, cp2y)), (x1, y1))) => self.bezier_curve_to(x1, y1, cp1x, cp1y, cp2x, cp2y), |
| 283 | Path(ClosePath) => self.close_path(), |
| 284 | Fill => self.fill(), |
| 285 | Stroke => self.stroke(), |
| 286 | LineWidth(width) => self.line_width(width), |
| 287 | LineWidthPixels(width) => self.line_width_pixels(width), |
| 288 | LineJoin(join) => self.line_join(join), |
| 289 | LineCap(cap) => self.line_cap(cap), |
| 290 | WindingRule(rule) => self.winding_rule(rule), |
| 291 | NewDashPattern => self.new_dash_pattern(), |
| 292 | DashLength(dash_length) => self.dash_length(dash_length), |
| 293 | DashOffset(dash_offset) => self.dash_offset(dash_offset), |
| 294 | FillColor(col) => self.fill_color(col), |
| 295 | FillTexture(texture, (x1, y1), (x2, y2)) => self.fill_texture(texture, x1, y1, x2, y2), |
| 296 | FillGradient(gradient, (x1, y1), (x2, y2)) => self.fill_gradient(gradient, x1, y1, x2, y2), |
| 297 | FillTransform(transform) => self.fill_transform(transform), |
| 298 | StrokeColor(col) => self.stroke_color(col), |
| 299 | BlendMode(blendmode) => self.blend_mode(blendmode), |
| 300 | IdentityTransform => self.identity_transform(), |
| 301 | CanvasHeight(height) => self.canvas_height(height), |
| 302 | CenterRegion((minx, miny), (maxx, maxy)) => self.center_region(minx, miny, maxx, maxy), |
| 303 | MultiplyTransform(transform) => self.transform(transform), |
| 304 | Unclip => self.unclip(), |
| 305 | Clip => self.clip(), |
| 306 | Store => self.store(), |
| 307 | Restore => self.restore(), |
| 308 | FreeStoredBuffer => self.free_stored_buffer(), |
| 309 | PushState => self.push_state(), |
| 310 | PopState => self.pop_state(), |
| 311 | ClearCanvas(color) => self.clear_canvas(color), |
| 312 | Layer(layer_id) => self.layer(layer_id), |
| 313 | LayerBlend(layer_id, blend_mode) => self.layer_blend(layer_id, blend_mode), |
| 314 | ClearLayer => self.clear_layer(), |
| 315 | ClearAllLayers => self.clear_all_layers(), |
| 316 | SwapLayers(layer1, layer2) => self.swap_layers(layer1, layer2), |
| 317 | Sprite(sprite_id) => self.sprite(sprite_id), |
| 318 | ClearSprite => self.clear_sprite(), |
| 319 | SpriteTransform(transform) => self.sprite_transform(transform), |
| 320 | DrawSprite(sprite_id) => self.draw_sprite(sprite_id), |
| 321 | |
| 322 | Font(font_id, FontOp::UseFontDefinition(font_data)) => self.define_font_data(font_id, font_data), |
| 323 | Font(font_id, FontOp::FontSize(font_size)) => self.set_font_size(font_id, font_size), |
| 324 | Font(font_id, FontOp::LayoutText(text)) => self.layout_text(font_id, text), |
| 325 | Font(font_id, FontOp::DrawGlyphs(glyphs)) => self.draw_glyphs(font_id, glyphs), |
| 326 | DrawText(font_id, string, x, y) => self.draw_text(font_id, string, x, y), |
| 327 | BeginLineLayout(x, y, alignment) => self.begin_line_layout(x, y, alignment), |
| 328 | DrawLaidOutText => self.draw_text_layout(), |
nothing calls this directly
no test coverage detected