Chromium Code Reviews| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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()) | 163 if (!canvas()) |
| 164 return; | 164 return; |
| 165 | 165 |
| 166 // The end of a script task that drew content to the canvas is the point | 166 // 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. | 167 // at which the current frame may be considered complete. |
| 168 canvas()->finalizeFrame(); | 168 canvas()->finalizeFrame(); |
| 169 finalizeFrame(); | |
|
Ken Russell (switch to Gerrit)
2017/02/18 00:08:01
Why is this being added here instead of inside HTM
Justin Novosad
2017/02/21 18:06:21
Because not all rendering contexts have an HTMLCan
Ken Russell (switch to Gerrit)
2017/02/21 19:23:10
Ah right. Thanks.
xlai (Olivia)
2017/02/21 19:56:56
What would be the scenarios when finalizeFrame() i
| |
| 169 } | 170 } |
| 170 | 171 |
| 171 CanvasRenderingContext::ContextType CanvasRenderingContext::contextTypeFromId( | 172 CanvasRenderingContext::ContextType CanvasRenderingContext::contextTypeFromId( |
| 172 const String& id) { | 173 const String& id) { |
| 173 if (id == "2d") | 174 if (id == "2d") |
| 174 return Context2d; | 175 return Context2d; |
| 175 if (id == "experimental-webgl") | 176 if (id == "experimental-webgl") |
| 176 return ContextExperimentalWebgl; | 177 return ContextExperimentalWebgl; |
| 177 if (id == "webgl") | 178 if (id == "webgl") |
| 178 return ContextWebgl; | 179 return ContextWebgl; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 } | 222 } |
| 222 return taintOrigin; | 223 return taintOrigin; |
| 223 } | 224 } |
| 224 | 225 |
| 225 DEFINE_TRACE(CanvasRenderingContext) { | 226 DEFINE_TRACE(CanvasRenderingContext) { |
| 226 visitor->trace(m_canvas); | 227 visitor->trace(m_canvas); |
| 227 visitor->trace(m_offscreenCanvas); | 228 visitor->trace(m_offscreenCanvas); |
| 228 } | 229 } |
| 229 | 230 |
| 230 } // namespace blink | 231 } // namespace blink |
| OLD | NEW |