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