OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r, bool u
seLowQualityScale) | 275 void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r, bool u
seLowQualityScale) |
276 { | 276 { |
277 // Clear the dirty rect | 277 // Clear the dirty rect |
278 m_dirtyRect = FloatRect(); | 278 m_dirtyRect = FloatRect(); |
279 | 279 |
280 if (context->paintingDisabled()) | 280 if (context->paintingDisabled()) |
281 return; | 281 return; |
282 | 282 |
283 if (m_context) { | 283 if (m_context) { |
284 if (!m_context->paintsIntoCanvasBuffer()) | 284 if (!m_context->paintsIntoCanvasBuffer() && !document()->printing()) |
285 return; | 285 return; |
286 m_context->paintRenderingResultsToCanvas(); | 286 m_context->paintRenderingResultsToCanvas(); |
287 } | 287 } |
288 | 288 |
289 if (hasCreatedImageBuffer()) { | 289 if (hasCreatedImageBuffer()) { |
290 ImageBuffer* imageBuffer = buffer(); | 290 ImageBuffer* imageBuffer = buffer(); |
291 if (imageBuffer) { | 291 if (imageBuffer) { |
292 if (m_presentedImage) | 292 if (m_presentedImage) |
293 context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB,
r, CompositeSourceOver, useLowQualityScale); | 293 context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB,
r, CompositeSourceOver, useLowQualityScale); |
294 else | 294 else |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 ASSERT(m_hasCreatedImageBuffer); | 497 ASSERT(m_hasCreatedImageBuffer); |
498 FloatSize unscaledSize(width(), height()); | 498 FloatSize unscaledSize(width(), height()); |
499 IntSize size = convertLogicalToDevice(unscaledSize); | 499 IntSize size = convertLogicalToDevice(unscaledSize); |
500 AffineTransform transform; | 500 AffineTransform transform; |
501 if (size.width() && size.height()) | 501 if (size.width() && size.height()) |
502 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig
ht() / unscaledSize.height()); | 502 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig
ht() / unscaledSize.height()); |
503 return m_imageBuffer->baseTransform() * transform; | 503 return m_imageBuffer->baseTransform() * transform; |
504 } | 504 } |
505 | 505 |
506 } | 506 } |
OLD | NEW |