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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 } | 778 } |
779 | 779 |
780 void HTMLCanvasElement::discardImageBuffer() | 780 void HTMLCanvasElement::discardImageBuffer() |
781 { | 781 { |
782 m_contextStateSaver.clear(); // uses context owned by m_imageBuffer | 782 m_contextStateSaver.clear(); // uses context owned by m_imageBuffer |
783 m_imageBuffer.clear(); | 783 m_imageBuffer.clear(); |
784 m_dirtyRect = FloatRect(); | 784 m_dirtyRect = FloatRect(); |
785 updateExternallyAllocatedMemory(); | 785 updateExternallyAllocatedMemory(); |
786 } | 786 } |
787 | 787 |
788 bool HTMLCanvasElement::hasValidImageBuffer() const | |
789 { | |
790 return m_imageBuffer && m_imageBuffer->isSurfaceValid(); | |
791 } | |
792 | |
793 void HTMLCanvasElement::clearCopiedImage() | 788 void HTMLCanvasElement::clearCopiedImage() |
794 { | 789 { |
795 if (m_copiedImage) { | 790 if (m_copiedImage) { |
796 m_copiedImage.clear(); | 791 m_copiedImage.clear(); |
797 updateExternallyAllocatedMemory(); | 792 updateExternallyAllocatedMemory(); |
798 } | 793 } |
799 } | 794 } |
800 | 795 |
801 AffineTransform HTMLCanvasElement::baseTransform() const | 796 AffineTransform HTMLCanvasElement::baseTransform() const |
802 { | 797 { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 { | 860 { |
866 return !originClean(); | 861 return !originClean(); |
867 } | 862 } |
868 | 863 |
869 FloatSize HTMLCanvasElement::sourceSize() const | 864 FloatSize HTMLCanvasElement::sourceSize() const |
870 { | 865 { |
871 return FloatSize(width(), height()); | 866 return FloatSize(width(), height()); |
872 } | 867 } |
873 | 868 |
874 } | 869 } |
OLD | NEW |