| 457 | | return IntPoint(matrix.x0, matrix.y0); |
| | 475 | return IntPoint((int)matrix.x0, (int)matrix.y0); |
| | 476 | } |
| | 477 | |
| | 478 | void GraphicsContext::setPlatformFillColor(const Color& col) |
| | 479 | { |
| | 480 | // FIXME: this is probably a no-op but I'm not sure |
| | 481 | notImplemented(); |
| | 482 | } |
| | 483 | |
| | 484 | void GraphicsContext::setPlatformStrokeColor(const Color& col) |
| | 485 | { |
| | 486 | // FIXME: this is probably a no-op but I'm not sure |
| | 487 | notImplemented(); |
| | 488 | } |
| | 489 | |
| | 490 | void GraphicsContext::setPlatformStrokeThickness(float strokeThickness) |
| | 491 | { |
| | 492 | cairo_set_line_width(m_data->context, strokeThickness); |
| | 493 | } |
| | 494 | |
| | 495 | void GraphicsContext::setPlatformStrokeStyle(const StrokeStyle& strokeStyle) |
| | 496 | { |
| | 497 | static double dashPattern[] = {5.0, 5.0}; |
| | 498 | static double dotPattern[] = {1.0, 1.0}; |
| | 499 | |
| | 500 | if (paintingDisabled()) |
| | 501 | return; |
| | 502 | |
| | 503 | switch (strokeStyle) { |
| | 504 | case NoStroke: |
| | 505 | // FIXME: is it the right way to emulate NoStroke? |
| | 506 | cairo_set_line_width(m_data->context, 0); |
| | 507 | break; |
| | 508 | case SolidStroke: |
| | 509 | cairo_set_dash(m_data->context, 0, 0, 0); |
| | 510 | break; |
| | 511 | case DottedStroke: |
| | 512 | cairo_set_dash(m_data->context, dotPattern, 2, 0); |
| | 513 | break; |
| | 514 | case DashedStroke: |
| | 515 | cairo_set_dash(m_data->context, dashPattern, 2, 0); |
| | 516 | break; |
| | 517 | default: |
| | 518 | notImplemented(); |
| | 519 | break; |
| | 520 | } |
| | 521 | } |
| | 522 | |
| | 523 | void GraphicsContext::setPlatformFont(const Font& font) |
| | 524 | { |
| | 525 | if (paintingDisabled()) |
| | 526 | return; |
| | 527 | |
| | 528 | #if PLATFORM(GDK) |
| | 529 | // FIXME: is it the right thing to do? Also, doesn't work on Win because |
| | 530 | // there FontData doesn't have ::setFont() |
| | 531 | const FontData *fontData = font.primaryFont(); |
| | 532 | fontData->setFont(m_data->context); |
| | 533 | #endif |
| | 538 | notImplemented(); |
| | 539 | } |
| | 540 | |
| | 541 | void GraphicsContext::addRoundedRectClip(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight, |
| | 542 | const IntSize& bottomLeft, const IntSize& bottomRight) |
| | 543 | { |
| | 544 | notImplemented(); |
| | 545 | } |
| | 546 | |
| | 547 | void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness) |
| | 548 | { |
| | 549 | notImplemented(); |
| | 550 | } |
| | 551 | |
| | 552 | void GraphicsContext::setShadow(IntSize const&, int, Color const&) |
| | 553 | { |
| | 554 | notImplemented(); |
| | 555 | } |
| | 556 | |
| | 557 | void GraphicsContext::clearShadow() |
| | 558 | { |
| | 559 | notImplemented(); |
| | 560 | } |
| | 561 | |
| | 562 | void GraphicsContext::beginTransparencyLayer(float) |
| | 563 | { |
| | 564 | notImplemented(); |
| | 565 | } |
| | 566 | |
| | 567 | void GraphicsContext::endTransparencyLayer() |
| | 568 | { |
| | 569 | notImplemented(); |
| | 570 | } |
| | 571 | |
| | 572 | void GraphicsContext::clearRect(const FloatRect&) |
| | 573 | { |
| | 574 | notImplemented(); |
| | 575 | } |
| | 576 | |
| | 577 | void GraphicsContext::strokeRect(const FloatRect&, float) |
| | 578 | { |
| | 579 | notImplemented(); |
| | 580 | } |
| | 581 | |
| | 582 | void GraphicsContext::setLineCap(LineCap) |
| | 583 | { |
| | 584 | notImplemented(); |
| | 585 | } |
| | 586 | |
| | 587 | void GraphicsContext::setLineJoin(LineJoin) |
| | 588 | { |
| | 589 | notImplemented(); |
| | 590 | } |
| | 591 | |
| | 592 | void GraphicsContext::setMiterLimit(float) |
| | 593 | { |
| | 594 | notImplemented(); |
| | 595 | } |
| | 596 | |
| | 597 | void GraphicsContext::setAlpha(float) |
| | 598 | { |
| | 599 | notImplemented(); |
| | 600 | } |
| | 601 | |
| | 602 | static inline cairo_operator_t toCairoOperator(CompositeOperator op) |
| | 603 | { |
| | 604 | switch (op) { |
| | 605 | case CompositeClear: |
| | 606 | return CAIRO_OPERATOR_CLEAR; |
| | 607 | case CompositeCopy: |
| | 608 | return CAIRO_OPERATOR_SOURCE; |
| | 609 | case CompositeSourceOver: |
| | 610 | return CAIRO_OPERATOR_OVER; |
| | 611 | case CompositeSourceIn: |
| | 612 | return CAIRO_OPERATOR_IN; |
| | 613 | case CompositeSourceOut: |
| | 614 | return CAIRO_OPERATOR_OUT; |
| | 615 | case CompositeSourceAtop: |
| | 616 | return CAIRO_OPERATOR_ATOP; |
| | 617 | case CompositeDestinationOver: |
| | 618 | return CAIRO_OPERATOR_DEST_OVER; |
| | 619 | case CompositeDestinationIn: |
| | 620 | return CAIRO_OPERATOR_DEST_IN; |
| | 621 | case CompositeDestinationOut: |
| | 622 | return CAIRO_OPERATOR_DEST_OUT; |
| | 623 | case CompositeDestinationAtop: |
| | 624 | return CAIRO_OPERATOR_DEST_ATOP; |
| | 625 | case CompositeXOR: |
| | 626 | return CAIRO_OPERATOR_XOR; |
| | 627 | case CompositePlusDarker: |
| | 628 | return CAIRO_OPERATOR_OVER; |
| | 629 | case CompositeHighlight: |
| | 630 | return CAIRO_OPERATOR_OVER; |
| | 631 | case CompositePlusLighter: |
| | 632 | return CAIRO_OPERATOR_OVER; |
| | 633 | } |
| | 634 | |
| | 635 | return CAIRO_OPERATOR_OVER; |
| | 636 | } |
| | 637 | |
| | 638 | void GraphicsContext::setCompositeOperation(CompositeOperator op) |
| | 639 | { |
| | 640 | cairo_set_operator(m_data->context, toCairoOperator(op)); |
| | 641 | } |
| | 642 | |
| | 643 | void GraphicsContext::clip(const Path&) |
| | 644 | { |
| | 645 | notImplemented(); |
| | 646 | } |
| | 647 | |
| | 648 | void GraphicsContext::rotate(float) |
| | 649 | { |
| | 650 | notImplemented(); |
| | 651 | } |
| | 652 | |
| | 653 | void GraphicsContext::scale(const FloatSize&) |
| | 654 | { |
| | 655 | notImplemented(); |
| | 656 | } |
| | 657 | |
| | 658 | void GraphicsContext::clipOut(const IntRect&) |
| | 659 | { |
| | 660 | notImplemented(); |
| | 661 | } |
| | 662 | |
| | 663 | void GraphicsContext::clipOutEllipseInRect(const IntRect&) |
| | 664 | { |
| | 665 | notImplemented(); |
| | 666 | } |
| | 667 | |
| | 668 | void GraphicsContext::fillRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color&) |
| | 669 | { |
| | 670 | notImplemented(); |