| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 { | 900 { |
| 901 if (paintingDisabled()) | 901 if (paintingDisabled()) |
| 902 return; | 902 return; |
| 903 CGContextConcatCTM(platformContext(), transform); | 903 CGContextConcatCTM(platformContext(), transform); |
| 904 m_data->concatCTM(transform); | 904 m_data->concatCTM(transform); |
| 905 m_data->m_userToDeviceTransformKnownToBeIdentity = false; | 905 m_data->m_userToDeviceTransformKnownToBeIdentity = false; |
| 906 } | 906 } |
| 907 | 907 |
| 908 TransformationMatrix GraphicsContext::getCTM() const | 908 TransformationMatrix GraphicsContext::getCTM() const |
| 909 { | 909 { |
| 910 return CGContextGetCTM(platformContext()); | 910 CGAffineTransform t = CGContextGetCTM(platformContext()); |
| 911 return TransformationMatrix(t.a, t.b, t.c, t.d, t.tx, t.ty); |
| 911 } | 912 } |
| 912 | 913 |
| 913 FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect) | 914 FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect) |
| 914 { | 915 { |
| 915 // It is not enough just to round to pixels in device space. The rotation pa
rt of the | 916 // It is not enough just to round to pixels in device space. The rotation pa
rt of the |
| 916 // affine transform matrix to device space can mess with this conversion if
we have a | 917 // affine transform matrix to device space can mess with this conversion if
we have a |
| 917 // rotating image like the hands of the world clock widget. We just need the
scale, so | 918 // rotating image like the hands of the world clock widget. We just need the
scale, so |
| 918 // we get the affine transform matrix and extract the scale. | 919 // we get the affine transform matrix and extract the scale. |
| 919 | 920 |
| 920 if (m_data->m_userToDeviceTransformKnownToBeIdentity) | 921 if (m_data->m_userToDeviceTransformKnownToBeIdentity) |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 target = kCGBlendModePlusLighter; | 1191 target = kCGBlendModePlusLighter; |
| 1191 break; | 1192 break; |
| 1192 } | 1193 } |
| 1193 CGContextSetBlendMode(platformContext(), target); | 1194 CGContextSetBlendMode(platformContext(), target); |
| 1194 } | 1195 } |
| 1195 #endif | 1196 #endif |
| 1196 | 1197 |
| 1197 } | 1198 } |
| 1198 | 1199 |
| 1199 | 1200 |
| OLD | NEW |