| 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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 } | 779 } |
| 780 | 780 |
| 781 SkCanvas* HTMLCanvasElement::existingDrawingCanvas() const | 781 SkCanvas* HTMLCanvasElement::existingDrawingCanvas() const |
| 782 { | 782 { |
| 783 if (!hasImageBuffer()) | 783 if (!hasImageBuffer()) |
| 784 return nullptr; | 784 return nullptr; |
| 785 | 785 |
| 786 return m_imageBuffer->canvas(); | 786 return m_imageBuffer->canvas(); |
| 787 } | 787 } |
| 788 | 788 |
| 789 CanvasRenderingContext* HTMLCanvasElement::renderingContext() const |
| 790 { |
| 791 return m_context.get(); |
| 792 } |
| 793 |
| 789 ImageBuffer* HTMLCanvasElement::buffer() const | 794 ImageBuffer* HTMLCanvasElement::buffer() const |
| 790 { | 795 { |
| 791 ASSERT(m_context); | 796 ASSERT(m_context); |
| 792 if (!hasImageBuffer() && !m_didFailToCreateImageBuffer) | 797 if (!hasImageBuffer() && !m_didFailToCreateImageBuffer) |
| 793 const_cast<HTMLCanvasElement*>(this)->createImageBuffer(); | 798 const_cast<HTMLCanvasElement*>(this)->createImageBuffer(); |
| 794 return m_imageBuffer.get(); | 799 return m_imageBuffer.get(); |
| 795 } | 800 } |
| 796 | 801 |
| 797 void HTMLCanvasElement::createImageBufferUsingSurfaceForTesting(PassOwnPtr<Image
BufferSurface> surface) | 802 void HTMLCanvasElement::createImageBufferUsingSurfaceForTesting(PassOwnPtr<Image
BufferSurface> surface) |
| 798 { | 803 { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 { | 925 { |
| 921 return FloatSize(width(), height()); | 926 return FloatSize(width(), height()); |
| 922 } | 927 } |
| 923 | 928 |
| 924 bool HTMLCanvasElement::isOpaque() const | 929 bool HTMLCanvasElement::isOpaque() const |
| 925 { | 930 { |
| 926 return m_context && !m_context->hasAlpha(); | 931 return m_context && !m_context->hasAlpha(); |
| 927 } | 932 } |
| 928 | 933 |
| 929 } // blink | 934 } // blink |
| OLD | NEW |