| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // HTMLCanvasElement and CanvasRenderingContext have a circular reference. | 111 // HTMLCanvasElement and CanvasRenderingContext have a circular reference. |
| 112 // When the pair is no longer reachable, their destruction order is non- | 112 // When the pair is no longer reachable, their destruction order is non- |
| 113 // deterministic, so the first of the two to be destroyed needs to notify | 113 // deterministic, so the first of the two to be destroyed needs to notify |
| 114 // the other in order to break the circular reference. This is to avoid | 114 // the other in order to break the circular reference. This is to avoid |
| 115 // an error when CanvasRenderingContext2D::didProcessTask() is invoked | 115 // an error when CanvasRenderingContext2D::didProcessTask() is invoked |
| 116 // after the HTMLCanvasElement is destroyed. | 116 // after the HTMLCanvasElement is destroyed. |
| 117 if (canvas()) { | 117 if (canvas()) { |
| 118 canvas()->detachContext(); | 118 canvas()->detachContext(); |
| 119 m_canvas = nullptr; | 119 m_canvas = nullptr; |
| 120 } | 120 } |
| 121 if (offscreenCanvas()) { |
| 122 offscreenCanvas()->detachContext(); |
| 123 m_offscreenCanvas = nullptr; |
| 124 } |
| 121 } | 125 } |
| 122 | 126 |
| 123 CanvasRenderingContext::ContextType CanvasRenderingContext::contextTypeFromId( | 127 CanvasRenderingContext::ContextType CanvasRenderingContext::contextTypeFromId( |
| 124 const String& id) { | 128 const String& id) { |
| 125 if (id == "2d") | 129 if (id == "2d") |
| 126 return Context2d; | 130 return Context2d; |
| 127 if (id == "experimental-webgl") | 131 if (id == "experimental-webgl") |
| 128 return ContextExperimentalWebgl; | 132 return ContextExperimentalWebgl; |
| 129 if (id == "webgl") | 133 if (id == "webgl") |
| 130 return ContextWebgl; | 134 return ContextWebgl; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 177 } |
| 174 return taintOrigin; | 178 return taintOrigin; |
| 175 } | 179 } |
| 176 | 180 |
| 177 DEFINE_TRACE(CanvasRenderingContext) { | 181 DEFINE_TRACE(CanvasRenderingContext) { |
| 178 visitor->trace(m_canvas); | 182 visitor->trace(m_canvas); |
| 179 visitor->trace(m_offscreenCanvas); | 183 visitor->trace(m_offscreenCanvas); |
| 180 } | 184 } |
| 181 | 185 |
| 182 } // namespace blink | 186 } // namespace blink |
| OLD | NEW |