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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 427 |
428 if (is3D() && paintsIntoCanvasBuffer()) | 428 if (is3D() && paintsIntoCanvasBuffer()) |
429 m_context->markLayerComposited(); | 429 m_context->markLayerComposited(); |
430 } | 430 } |
431 | 431 |
432 bool HTMLCanvasElement::is3D() const | 432 bool HTMLCanvasElement::is3D() const |
433 { | 433 { |
434 return m_context && m_context->is3d(); | 434 return m_context && m_context->is3d(); |
435 } | 435 } |
436 | 436 |
| 437 bool HTMLCanvasElement::isAnimated2D() const |
| 438 { |
| 439 return m_context && m_context->is2d() && hasImageBuffer() && m_imageBuffer->
wasDrawnToAfterSnapshot(); |
| 440 } |
| 441 |
437 void HTMLCanvasElement::setSurfaceSize(const IntSize& size) | 442 void HTMLCanvasElement::setSurfaceSize(const IntSize& size) |
438 { | 443 { |
439 m_size = size; | 444 m_size = size; |
440 m_didFailToCreateImageBuffer = false; | 445 m_didFailToCreateImageBuffer = false; |
441 discardImageBuffer(); | 446 discardImageBuffer(); |
442 clearCopiedImage(); | 447 clearCopiedImage(); |
443 if (m_context && m_context->is2d() && m_context->isContextLost()) { | 448 if (m_context && m_context->is2d() && m_context->isContextLost()) { |
444 m_context->didSetSurfaceSize(); | 449 m_context->didSetSurfaceSize(); |
445 } | 450 } |
446 } | 451 } |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 { | 897 { |
893 return FloatSize(width(), height()); | 898 return FloatSize(width(), height()); |
894 } | 899 } |
895 | 900 |
896 bool HTMLCanvasElement::isOpaque() const | 901 bool HTMLCanvasElement::isOpaque() const |
897 { | 902 { |
898 return m_context && !m_context->hasAlpha(); | 903 return m_context && !m_context->hasAlpha(); |
899 } | 904 } |
900 | 905 |
901 } // blink | 906 } // blink |
OLD | NEW |