| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 if (!m_finalizeFrameScheduled) { | 153 if (!m_finalizeFrameScheduled) { |
| 154 m_finalizeFrameScheduled = true; | 154 m_finalizeFrameScheduled = true; |
| 155 Platform::current()->currentThread()->addTaskObserver(this); | 155 Platform::current()->currentThread()->addTaskObserver(this); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 | 158 |
| 159 void CanvasRenderingContext::didProcessTask() { | 159 void CanvasRenderingContext::didProcessTask() { |
| 160 Platform::current()->currentThread()->removeTaskObserver(this); | 160 Platform::current()->currentThread()->removeTaskObserver(this); |
| 161 m_finalizeFrameScheduled = false; | 161 m_finalizeFrameScheduled = false; |
| 162 | 162 |
| 163 if (!canvas()) | |
| 164 return; | |
| 165 | |
| 166 // The end of a script task that drew content to the canvas is the point | 163 // The end of a script task that drew content to the canvas is the point |
| 167 // at which the current frame may be considered complete. | 164 // at which the current frame may be considered complete. |
| 168 canvas()->finalizeFrame(); | 165 if (canvas()) |
| 166 canvas()->finalizeFrame(); |
| 167 finalizeFrame(); |
| 169 } | 168 } |
| 170 | 169 |
| 171 CanvasRenderingContext::ContextType CanvasRenderingContext::contextTypeFromId( | 170 CanvasRenderingContext::ContextType CanvasRenderingContext::contextTypeFromId( |
| 172 const String& id) { | 171 const String& id) { |
| 173 if (id == "2d") | 172 if (id == "2d") |
| 174 return Context2d; | 173 return Context2d; |
| 175 if (id == "experimental-webgl") | 174 if (id == "experimental-webgl") |
| 176 return ContextExperimentalWebgl; | 175 return ContextExperimentalWebgl; |
| 177 if (id == "webgl") | 176 if (id == "webgl") |
| 178 return ContextWebgl; | 177 return ContextWebgl; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 220 } |
| 222 return taintOrigin; | 221 return taintOrigin; |
| 223 } | 222 } |
| 224 | 223 |
| 225 DEFINE_TRACE(CanvasRenderingContext) { | 224 DEFINE_TRACE(CanvasRenderingContext) { |
| 226 visitor->trace(m_canvas); | 225 visitor->trace(m_canvas); |
| 227 visitor->trace(m_offscreenCanvas); | 226 visitor->trace(m_offscreenCanvas); |
| 228 } | 227 } |
| 229 | 228 |
| 230 } // namespace blink | 229 } // namespace blink |
| OLD | NEW |