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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 | 140 |
141 DEFINE_NODE_FACTORY(HTMLCanvasElement) | 141 DEFINE_NODE_FACTORY(HTMLCanvasElement) |
142 | 142 |
143 HTMLCanvasElement::~HTMLCanvasElement() { | 143 HTMLCanvasElement::~HTMLCanvasElement() { |
144 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory( | 144 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory( |
145 -m_externallyAllocatedMemory); | 145 -m_externallyAllocatedMemory); |
146 } | 146 } |
147 | 147 |
148 void HTMLCanvasElement::dispose() { | 148 void HTMLCanvasElement::dispose() { |
149 releasePlaceholderFrame(); | 149 if (placeholderFrame()) |
| 150 releasePlaceholderFrame(); |
150 | 151 |
151 if (m_context) { | 152 if (m_context) { |
152 m_context->detachCanvas(); | 153 m_context->detachCanvas(); |
153 m_context = nullptr; | 154 m_context = nullptr; |
154 } | 155 } |
155 | 156 |
156 if (m_imageBuffer) { | 157 if (m_imageBuffer) { |
157 m_imageBuffer->setClient(nullptr); | 158 m_imageBuffer->setClient(nullptr); |
158 m_imageBuffer = nullptr; | 159 m_imageBuffer = nullptr; |
159 } | 160 } |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 mojom::blink::OffscreenCanvasSurfacePtr service; | 1399 mojom::blink::OffscreenCanvasSurfacePtr service; |
1399 Platform::current()->interfaceProvider()->getInterface( | 1400 Platform::current()->interfaceProvider()->getInterface( |
1400 mojo::GetProxy(&service)); | 1401 mojo::GetProxy(&service)); |
1401 m_surfaceLayerBridge = | 1402 m_surfaceLayerBridge = |
1402 WTF::wrapUnique(new CanvasSurfaceLayerBridge(std::move(service))); | 1403 WTF::wrapUnique(new CanvasSurfaceLayerBridge(std::move(service))); |
1403 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), | 1404 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), |
1404 this->height()); | 1405 this->height()); |
1405 } | 1406 } |
1406 | 1407 |
1407 } // namespace blink | 1408 } // namespace blink |
OLD | NEW |