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 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 clipRoundedRect(rect, SkRegion::kDifference_Op); | 1513 clipRoundedRect(rect, SkRegion::kDifference_Op); |
1514 } | 1514 } |
1515 | 1515 |
1516 void GraphicsContext::clipRect(const SkRect& rect, AntiAliasingMode aa, SkRegion
::Op op) | 1516 void GraphicsContext::clipRect(const SkRect& rect, AntiAliasingMode aa, SkRegion
::Op op) |
1517 { | 1517 { |
1518 ASSERT(m_canvas); | 1518 ASSERT(m_canvas); |
1519 if (contextDisabled()) | 1519 if (contextDisabled()) |
1520 return; | 1520 return; |
1521 | 1521 |
1522 if (op != SkRegion::kIntersect_Op && op != SkRegion::kReplace_Op) | 1522 if (op != SkRegion::kIntersect_Op && op != SkRegion::kReplace_Op) |
1523 mutableState()->setHasComplexClip(); | 1523 setHasComplexClip(); |
1524 | 1524 |
1525 m_canvas->clipRect(rect, op, aa == AntiAliased); | 1525 m_canvas->clipRect(rect, op, aa == AntiAliased); |
1526 } | 1526 } |
1527 | 1527 |
1528 void GraphicsContext::clipPath(const SkPath& path, AntiAliasingMode aa, SkRegion
::Op op) | 1528 void GraphicsContext::clipPath(const SkPath& path, AntiAliasingMode aa, SkRegion
::Op op) |
1529 { | 1529 { |
1530 ASSERT(m_canvas); | 1530 ASSERT(m_canvas); |
1531 if (contextDisabled()) | 1531 if (contextDisabled()) |
1532 return; | 1532 return; |
1533 | 1533 |
1534 if (!path.isRect(0) || (op != SkRegion::kIntersect_Op && op != SkRegion::kRe
place_Op)) | 1534 if (!path.isRect(0) || (op != SkRegion::kIntersect_Op && op != SkRegion::kRe
place_Op)) |
1535 mutableState()->setHasComplexClip(); | 1535 setHasComplexClip(); |
1536 | 1536 |
1537 m_canvas->clipPath(path, op, aa == AntiAliased); | 1537 m_canvas->clipPath(path, op, aa == AntiAliased); |
1538 } | 1538 } |
1539 | 1539 |
1540 void GraphicsContext::clipRRect(const SkRRect& rect, AntiAliasingMode aa, SkRegi
on::Op op) | 1540 void GraphicsContext::clipRRect(const SkRRect& rect, AntiAliasingMode aa, SkRegi
on::Op op) |
1541 { | 1541 { |
1542 ASSERT(m_canvas); | 1542 ASSERT(m_canvas); |
1543 if (contextDisabled()) | 1543 if (contextDisabled()) |
1544 return; | 1544 return; |
1545 | 1545 |
1546 if (!rect.isRect() || (op != SkRegion::kIntersect_Op && op != SkRegion::kRep
lace_Op)) | 1546 if (!rect.isRect() || (op != SkRegion::kIntersect_Op && op != SkRegion::kRep
lace_Op)) |
1547 mutableState()->setHasComplexClip(); | 1547 setHasComplexClip(); |
1548 | 1548 |
1549 m_canvas->clipRRect(rect, op, aa == AntiAliased); | 1549 m_canvas->clipRRect(rect, op, aa == AntiAliased); |
1550 } | 1550 } |
1551 | 1551 |
1552 void GraphicsContext::rotate(float angleInRadians) | 1552 void GraphicsContext::rotate(float angleInRadians) |
1553 { | 1553 { |
1554 ASSERT(m_canvas); | 1554 ASSERT(m_canvas); |
1555 if (contextDisabled()) | 1555 if (contextDisabled()) |
1556 return; | 1556 return; |
1557 | 1557 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 return initialSaveCount; | 1942 return initialSaveCount; |
1943 } | 1943 } |
1944 | 1944 |
1945 void GraphicsContext::setClient(GraphicsContextClient* client) | 1945 void GraphicsContext::setClient(GraphicsContextClient* client) |
1946 { | 1946 { |
1947 ASSERT(client == 0 || m_client == 0); // No clobbering | 1947 ASSERT(client == 0 || m_client == 0); // No clobbering |
1948 m_client = client; | 1948 m_client = client; |
1949 } | 1949 } |
1950 | 1950 |
1951 } // namespace blink | 1951 } // namespace blink |
OLD | NEW |