| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 } | 631 } |
| 632 | 632 |
| 633 AffineTransform HTMLCanvasElement::baseTransform() const | 633 AffineTransform HTMLCanvasElement::baseTransform() const |
| 634 { | 634 { |
| 635 ASSERT(hasImageBuffer() && !m_didFailToCreateImageBuffer); | 635 ASSERT(hasImageBuffer() && !m_didFailToCreateImageBuffer); |
| 636 return m_imageBuffer->baseTransform(); | 636 return m_imageBuffer->baseTransform(); |
| 637 } | 637 } |
| 638 | 638 |
| 639 void HTMLCanvasElement::didChangeVisibilityState(PageVisibilityState visibility) | 639 void HTMLCanvasElement::didChangeVisibilityState(PageVisibilityState visibility) |
| 640 { | 640 { |
| 641 if (hasImageBuffer()) { | 641 if (!m_context) |
| 642 bool hidden = visibility != PageVisibilityStateVisible; | 642 return; |
| 643 if (hidden) { | 643 bool hidden = visibility != PageVisibilityStateVisible; |
| 644 clearCopiedImage(); | 644 m_context->setIsHidden(hidden); |
| 645 if (is3D()) { | 645 if (hidden) { |
| 646 discardImageBuffer(); | 646 clearCopiedImage(); |
| 647 } | 647 if (is3D()) { |
| 648 } | 648 discardImageBuffer(); |
| 649 if (hasImageBuffer()) { | |
| 650 m_imageBuffer->setIsHidden(hidden); | |
| 651 } | 649 } |
| 652 } | 650 } |
| 653 } | 651 } |
| 654 | 652 |
| 655 void HTMLCanvasElement::didMoveToNewDocument(Document& oldDocument) | 653 void HTMLCanvasElement::didMoveToNewDocument(Document& oldDocument) |
| 656 { | 654 { |
| 657 setObservedDocument(document()); | 655 setObservedDocument(document()); |
| 658 HTMLElement::didMoveToNewDocument(oldDocument); | 656 HTMLElement::didMoveToNewDocument(oldDocument); |
| 659 } | 657 } |
| 660 | 658 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 688 { | 686 { |
| 689 return !originClean(); | 687 return !originClean(); |
| 690 } | 688 } |
| 691 | 689 |
| 692 FloatSize HTMLCanvasElement::sourceSize() const | 690 FloatSize HTMLCanvasElement::sourceSize() const |
| 693 { | 691 { |
| 694 return FloatSize(width(), height()); | 692 return FloatSize(width(), height()); |
| 695 } | 693 } |
| 696 | 694 |
| 697 } | 695 } |
| OLD | NEW |