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