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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 // Subtracting two intptr_t that are known to be positive will never underfl
ow. | 734 // Subtracting two intptr_t that are known to be positive will never underfl
ow. |
735 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(externallyA
llocatedMemory - m_externallyAllocatedMemory); | 735 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(externallyA
llocatedMemory - m_externallyAllocatedMemory); |
736 m_externallyAllocatedMemory = externallyAllocatedMemory; | 736 m_externallyAllocatedMemory = externallyAllocatedMemory; |
737 } | 737 } |
738 | 738 |
739 GraphicsContext* HTMLCanvasElement::drawingContext() const | 739 GraphicsContext* HTMLCanvasElement::drawingContext() const |
740 { | 740 { |
741 return buffer() ? m_imageBuffer->context() : nullptr; | 741 return buffer() ? m_imageBuffer->context() : nullptr; |
742 } | 742 } |
743 | 743 |
744 GraphicsContext* HTMLCanvasElement::existingDrawingContext() const | |
745 { | |
746 if (!hasImageBuffer()) | |
747 return nullptr; | |
748 | |
749 return drawingContext(); | |
750 } | |
751 | |
752 SkCanvas* HTMLCanvasElement::drawingCanvas() const | 744 SkCanvas* HTMLCanvasElement::drawingCanvas() const |
753 { | 745 { |
754 return buffer() ? m_imageBuffer->canvas() : nullptr; | 746 return buffer() ? m_imageBuffer->canvas() : nullptr; |
755 } | 747 } |
756 | 748 |
757 SkCanvas* HTMLCanvasElement::existingDrawingCanvas() const | 749 SkCanvas* HTMLCanvasElement::existingDrawingCanvas() const |
758 { | 750 { |
759 if (!hasImageBuffer()) | 751 if (!hasImageBuffer()) |
760 return nullptr; | 752 return nullptr; |
761 | 753 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 { | 885 { |
894 return FloatSize(width(), height()); | 886 return FloatSize(width(), height()); |
895 } | 887 } |
896 | 888 |
897 bool HTMLCanvasElement::isOpaque() const | 889 bool HTMLCanvasElement::isOpaque() const |
898 { | 890 { |
899 return m_context && !m_context->hasAlpha(); | 891 return m_context && !m_context->hasAlpha(); |
900 } | 892 } |
901 | 893 |
902 } // blink | 894 } // blink |
OLD | NEW |