OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
10 * | 10 * |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
589 return; | 589 return; |
590 realizeSaves(); | 590 realizeSaves(); |
591 modifiableState().m_globalComposite = op; | 591 modifiableState().m_globalComposite = op; |
592 modifiableState().m_globalBlend = blendMode; | 592 modifiableState().m_globalBlend = blendMode; |
593 GraphicsContext* c = drawingContext(); | 593 GraphicsContext* c = drawingContext(); |
594 if (!c) | 594 if (!c) |
595 return; | 595 return; |
596 c->setCompositeOperation(op, blendMode); | 596 c->setCompositeOperation(op, blendMode); |
597 } | 597 } |
598 | 598 |
599 void CanvasRenderingContext2D::setCurrentTransform(const SVGMatrix& matrix) | |
600 { | |
601 setTransform(matrix.a(), matrix.b(), matrix.c(), matrix.d(), matrix.e(), mat rix.f()); | |
602 } | |
603 | |
599 void CanvasRenderingContext2D::scale(float sx, float sy) | 604 void CanvasRenderingContext2D::scale(float sx, float sy) |
600 { | 605 { |
601 GraphicsContext* c = drawingContext(); | 606 GraphicsContext* c = drawingContext(); |
602 if (!c) | 607 if (!c) |
603 return; | 608 return; |
604 if (!state().m_invertibleCTM) | 609 if (!state().m_invertibleCTM) |
605 return; | 610 return; |
606 | 611 |
607 if (!std::isfinite(sx) | !std::isfinite(sy)) | 612 if (!std::isfinite(sx) | !std::isfinite(sy)) |
608 return; | 613 return; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
691 if (!std::isfinite(m11) | !std::isfinite(m21) | !std::isfinite(dx) | !std::i sfinite(m12) | !std::isfinite(m22) | !std::isfinite(dy)) | 696 if (!std::isfinite(m11) | !std::isfinite(m21) | !std::isfinite(dx) | !std::i sfinite(m12) | !std::isfinite(m22) | !std::isfinite(dy)) |
692 return; | 697 return; |
693 | 698 |
694 AffineTransform transform(m11, m12, m21, m22, dx, dy); | 699 AffineTransform transform(m11, m12, m21, m22, dx, dy); |
695 AffineTransform newTransform = state().m_transform * transform; | 700 AffineTransform newTransform = state().m_transform * transform; |
696 if (state().m_transform == newTransform) | 701 if (state().m_transform == newTransform) |
697 return; | 702 return; |
698 | 703 |
699 realizeSaves(); | 704 realizeSaves(); |
700 | 705 |
706 modifiableState().m_transform = newTransform; | |
Justin Novosad
2013/10/09 17:17:04
Interesting bug you fixed here, but is this the ri
dshwang
2013/10/09 17:48:20
exactly. This change is only for currentTransform
| |
701 if (!newTransform.isInvertible()) { | 707 if (!newTransform.isInvertible()) { |
702 modifiableState().m_invertibleCTM = false; | 708 modifiableState().m_invertibleCTM = false; |
703 return; | 709 return; |
704 } | 710 } |
705 | 711 |
706 modifiableState().m_transform = newTransform; | |
707 c->concatCTM(transform); | 712 c->concatCTM(transform); |
708 m_path.transform(transform.inverse()); | 713 m_path.transform(transform.inverse()); |
709 } | 714 } |
710 | 715 |
711 void CanvasRenderingContext2D::resetTransform() | 716 void CanvasRenderingContext2D::resetTransform() |
712 { | 717 { |
713 GraphicsContext* c = drawingContext(); | 718 GraphicsContext* c = drawingContext(); |
714 if (!c) | 719 if (!c) |
715 return; | 720 return; |
716 | 721 |
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2414 const int focusRingWidth = 5; | 2419 const int focusRingWidth = 5; |
2415 const int focusRingOutline = 0; | 2420 const int focusRingOutline = 0; |
2416 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); | 2421 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); |
2417 | 2422 |
2418 c->restore(); | 2423 c->restore(); |
2419 | 2424 |
2420 didDraw(dirtyRect); | 2425 didDraw(dirtyRect); |
2421 } | 2426 } |
2422 | 2427 |
2423 } // namespace WebCore | 2428 } // namespace WebCore |
OLD | NEW |