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