| 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 7279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7290 synthesizeGLError(GL_INVALID_FRAMEBUFFER_OPERATION, functionName, reason); | 7290 synthesizeGLError(GL_INVALID_FRAMEBUFFER_OPERATION, functionName, reason); |
| 7291 return false; | 7291 return false; |
| 7292 } | 7292 } |
| 7293 | 7293 |
| 7294 return true; | 7294 return true; |
| 7295 } | 7295 } |
| 7296 | 7296 |
| 7297 void WebGLRenderingContextBase::dispatchContextLostEvent(TimerBase*) { | 7297 void WebGLRenderingContextBase::dispatchContextLostEvent(TimerBase*) { |
| 7298 WebGLContextEvent* event = WebGLContextEvent::create( | 7298 WebGLContextEvent* event = WebGLContextEvent::create( |
| 7299 EventTypeNames::webglcontextlost, false, true, ""); | 7299 EventTypeNames::webglcontextlost, false, true, ""); |
| 7300 canvas()->dispatchEvent(event); | 7300 if (getOffscreenCanvas()) |
| 7301 getOffscreenCanvas()->dispatchEvent(event); |
| 7302 else |
| 7303 canvas()->dispatchEvent(event); |
| 7301 m_restoreAllowed = event->defaultPrevented(); | 7304 m_restoreAllowed = event->defaultPrevented(); |
| 7302 if (m_restoreAllowed && !m_isHidden) { | 7305 if (m_restoreAllowed && !m_isHidden) { |
| 7303 if (m_autoRecoveryMethod == Auto) | 7306 if (m_autoRecoveryMethod == Auto) |
| 7304 m_restoreTimer.startOneShot(0, BLINK_FROM_HERE); | 7307 m_restoreTimer.startOneShot(0, BLINK_FROM_HERE); |
| 7305 } | 7308 } |
| 7306 } | 7309 } |
| 7307 | 7310 |
| 7308 void WebGLRenderingContextBase::maybeRestoreContext(TimerBase*) { | 7311 void WebGLRenderingContextBase::maybeRestoreContext(TimerBase*) { |
| 7309 ASSERT(isContextLost()); | 7312 ASSERT(isContextLost()); |
| 7310 | 7313 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7668 | 7671 |
| 7669 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7672 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
| 7670 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7673 HTMLCanvasElementOrOffscreenCanvas& result) const { |
| 7671 if (canvas()) | 7674 if (canvas()) |
| 7672 result.setHTMLCanvasElement(canvas()); | 7675 result.setHTMLCanvasElement(canvas()); |
| 7673 else | 7676 else |
| 7674 result.setOffscreenCanvas(getOffscreenCanvas()); | 7677 result.setOffscreenCanvas(getOffscreenCanvas()); |
| 7675 } | 7678 } |
| 7676 | 7679 |
| 7677 } // namespace blink | 7680 } // namespace blink |
| OLD | NEW |