| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 realizeSave(SkCanvas::kMatrix_SaveFlag); | 458 realizeSave(SkCanvas::kMatrix_SaveFlag); |
| 459 | 459 |
| 460 m_canvas->setMatrix(matrix); | 460 m_canvas->setMatrix(matrix); |
| 461 } | 461 } |
| 462 | 462 |
| 463 bool GraphicsContext::concat(const SkMatrix& matrix) | 463 bool GraphicsContext::concat(const SkMatrix& matrix) |
| 464 { | 464 { |
| 465 if (paintingDisabled()) | 465 if (paintingDisabled()) |
| 466 return false; | 466 return false; |
| 467 | 467 |
| 468 if (matrix.isIdentity()) |
| 469 return true; |
| 470 |
| 468 realizeSave(SkCanvas::kMatrix_SaveFlag); | 471 realizeSave(SkCanvas::kMatrix_SaveFlag); |
| 469 | 472 |
| 470 return m_canvas->concat(matrix); | 473 return m_canvas->concat(matrix); |
| 471 } | 474 } |
| 472 | 475 |
| 473 void GraphicsContext::beginTransparencyLayer(float opacity, const FloatRect* bou
nds) | 476 void GraphicsContext::beginTransparencyLayer(float opacity, const FloatRect* bou
nds) |
| 474 { | 477 { |
| 475 beginLayer(opacity, m_state->m_compositeOperator, bounds); | 478 beginLayer(opacity, m_state->m_compositeOperator, bounds); |
| 476 } | 479 } |
| 477 | 480 |
| (...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 realizeSave(SkCanvas::kMatrix_SaveFlag); | 1583 realizeSave(SkCanvas::kMatrix_SaveFlag); |
| 1581 | 1584 |
| 1582 m_canvas->rotate(WebCoreFloatToSkScalar(angleInRadians * (180.0f / 3.1415926
5f))); | 1585 m_canvas->rotate(WebCoreFloatToSkScalar(angleInRadians * (180.0f / 3.1415926
5f))); |
| 1583 } | 1586 } |
| 1584 | 1587 |
| 1585 void GraphicsContext::translate(float w, float h) | 1588 void GraphicsContext::translate(float w, float h) |
| 1586 { | 1589 { |
| 1587 if (paintingDisabled()) | 1590 if (paintingDisabled()) |
| 1588 return; | 1591 return; |
| 1589 | 1592 |
| 1593 if (!w && !h) |
| 1594 return; |
| 1595 |
| 1590 realizeSave(SkCanvas::kMatrix_SaveFlag); | 1596 realizeSave(SkCanvas::kMatrix_SaveFlag); |
| 1591 | 1597 |
| 1592 m_canvas->translate(WebCoreFloatToSkScalar(w), WebCoreFloatToSkScalar(h)); | 1598 m_canvas->translate(WebCoreFloatToSkScalar(w), WebCoreFloatToSkScalar(h)); |
| 1593 } | 1599 } |
| 1594 | 1600 |
| 1595 void GraphicsContext::scale(const FloatSize& size) | 1601 void GraphicsContext::scale(const FloatSize& size) |
| 1596 { | 1602 { |
| 1597 if (paintingDisabled()) | 1603 if (paintingDisabled()) |
| 1598 return; | 1604 return; |
| 1599 | 1605 |
| 1606 if (size.width() == 1.0f && size.height() == 1.0f) |
| 1607 return; |
| 1608 |
| 1600 realizeSave(SkCanvas::kMatrix_SaveFlag); | 1609 realizeSave(SkCanvas::kMatrix_SaveFlag); |
| 1601 | 1610 |
| 1602 m_canvas->scale(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar
(size.height())); | 1611 m_canvas->scale(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar
(size.height())); |
| 1603 } | 1612 } |
| 1604 | 1613 |
| 1605 void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect) | 1614 void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect) |
| 1606 { | 1615 { |
| 1607 if (paintingDisabled()) | 1616 if (paintingDisabled()) |
| 1608 return; | 1617 return; |
| 1609 | 1618 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 | 2004 |
| 1996 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 2005 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
| 1997 { | 2006 { |
| 1998 if (m_trackTextRegion) { | 2007 if (m_trackTextRegion) { |
| 1999 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); | 2008 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); |
| 2000 m_textRegion.join(textRect); | 2009 m_textRegion.join(textRect); |
| 2001 } | 2010 } |
| 2002 } | 2011 } |
| 2003 | 2012 |
| 2004 } | 2013 } |
| OLD | NEW |