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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 const FloatRect& bounds = displayList->bounds(); | 542 const FloatRect& bounds = displayList->bounds(); |
543 if (bounds.x() || bounds.y()) | 543 if (bounds.x() || bounds.y()) |
544 m_canvas->translate(bounds.x(), bounds.y()); | 544 m_canvas->translate(bounds.x(), bounds.y()); |
545 | 545 |
546 m_canvas->drawPicture(displayList->picture()); | 546 m_canvas->drawPicture(displayList->picture()); |
547 | 547 |
548 if (bounds.x() || bounds.y()) | 548 if (bounds.x() || bounds.y()) |
549 m_canvas->translate(-bounds.x(), -bounds.y()); | 549 m_canvas->translate(-bounds.x(), -bounds.y()); |
550 } | 550 } |
551 | 551 |
552 void GraphicsContext::setupPaintForFilling(SkPaint* paint) const | |
553 { | |
554 if (contextDisabled()) | |
555 return; | |
556 | |
557 *paint = immutableState()->fillPaint(); | |
558 } | |
559 | |
560 void GraphicsContext::setupPaintForStroking(SkPaint* paint) const | |
561 { | |
562 if (contextDisabled()) | |
563 return; | |
564 | |
565 *paint = immutableState()->strokePaint(); | |
566 } | |
567 | |
568 void GraphicsContext::drawConvexPolygon(size_t numPoints, const FloatPoint* poin
ts, bool shouldAntialias) | 552 void GraphicsContext::drawConvexPolygon(size_t numPoints, const FloatPoint* poin
ts, bool shouldAntialias) |
569 { | 553 { |
570 if (contextDisabled()) | 554 if (contextDisabled()) |
571 return; | 555 return; |
572 | 556 |
573 if (numPoints <= 1) | 557 if (numPoints <= 1) |
574 return; | 558 return; |
575 | 559 |
576 SkPath path; | 560 SkPath path; |
577 setPathFromConvexPoints(&path, numPoints, points); | 561 setPathFromConvexPoints(&path, numPoints, points); |
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1842 | 1826 |
1843 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 1827 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
1844 { | 1828 { |
1845 if (m_trackTextRegion) { | 1829 if (m_trackTextRegion) { |
1846 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); | 1830 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); |
1847 m_textRegion.join(textRect); | 1831 m_textRegion.join(textRect); |
1848 } | 1832 } |
1849 } | 1833 } |
1850 | 1834 |
1851 } | 1835 } |
OLD | NEW |