| 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 m_imageBuffer->context()->setImageInterpolationQuality(CanvasDefaultInterpol
ationQuality); | 510 m_imageBuffer->context()->setImageInterpolationQuality(CanvasDefaultInterpol
ationQuality); |
| 511 // Enabling MSAA overrides a request to disable antialiasing. This is true r
egardless of whether the | 511 // Enabling MSAA overrides a request to disable antialiasing. This is true r
egardless of whether the |
| 512 // rendering mode is accelerated or not. For consistency, we don't want to a
pply AA in accelerated | 512 // rendering mode is accelerated or not. For consistency, we don't want to a
pply AA in accelerated |
| 513 // canvases but not in unaccelerated canvases. | 513 // canvases but not in unaccelerated canvases. |
| 514 if (!msaaSampleCount && document().settings() && !document().settings()->ant
ialiased2dCanvasEnabled()) | 514 if (!msaaSampleCount && document().settings() && !document().settings()->ant
ialiased2dCanvasEnabled()) |
| 515 m_imageBuffer->context()->setShouldAntialias(false); | 515 m_imageBuffer->context()->setShouldAntialias(false); |
| 516 // GraphicsContext's defaults don't always agree with the 2d canvas spec. | 516 // GraphicsContext's defaults don't always agree with the 2d canvas spec. |
| 517 // See CanvasRenderingContext2D::State::State() for more information. | 517 // See CanvasRenderingContext2D::State::State() for more information. |
| 518 m_imageBuffer->context()->setMiterLimit(10); | 518 m_imageBuffer->context()->setMiterLimit(10); |
| 519 m_imageBuffer->context()->setStrokeThickness(1); | 519 m_imageBuffer->context()->setStrokeThickness(1); |
| 520 #if !ASSERT_DISABLED | 520 #if ASSERT_ENABLED |
| 521 m_imageBuffer->context()->disableDestructionChecks(); // 2D canvas is allowe
d to leave context in an unfinalized state. | 521 m_imageBuffer->context()->disableDestructionChecks(); // 2D canvas is allowe
d to leave context in an unfinalized state. |
| 522 #endif | 522 #endif |
| 523 m_contextStateSaver = adoptPtr(new GraphicsContextStateSaver(*m_imageBuffer-
>context())); | 523 m_contextStateSaver = adoptPtr(new GraphicsContextStateSaver(*m_imageBuffer-
>context())); |
| 524 | 524 |
| 525 if (m_context) | 525 if (m_context) |
| 526 setNeedsCompositingUpdate(); | 526 setNeedsCompositingUpdate(); |
| 527 } | 527 } |
| 528 | 528 |
| 529 void HTMLCanvasElement::notifySurfaceInvalid() | 529 void HTMLCanvasElement::notifySurfaceInvalid() |
| 530 { | 530 { |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 { | 698 { |
| 699 return !originClean(); | 699 return !originClean(); |
| 700 } | 700 } |
| 701 | 701 |
| 702 FloatSize HTMLCanvasElement::sourceSize() const | 702 FloatSize HTMLCanvasElement::sourceSize() const |
| 703 { | 703 { |
| 704 return FloatSize(width(), height()); | 704 return FloatSize(width(), height()); |
| 705 } | 705 } |
| 706 | 706 |
| 707 } | 707 } |
| OLD | NEW |