| 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 4985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4996 return; | 4996 return; |
| 4997 | 4997 |
| 4998 m_contextLostMode = mode; | 4998 m_contextLostMode = mode; |
| 4999 ASSERT(m_contextLostMode != NotLostContext); | 4999 ASSERT(m_contextLostMode != NotLostContext); |
| 5000 m_autoRecoveryMethod = autoRecoveryMethod; | 5000 m_autoRecoveryMethod = autoRecoveryMethod; |
| 5001 | 5001 |
| 5002 if (mode == RealLostContext) { | 5002 if (mode == RealLostContext) { |
| 5003 // Inform the embedder that a lost context was received. In response, th
e embedder might | 5003 // Inform the embedder that a lost context was received. In response, th
e embedder might |
| 5004 // decide to take action such as asking the user for permission to use W
ebGL again. | 5004 // decide to take action such as asking the user for permission to use W
ebGL again. |
| 5005 if (LocalFrame* frame = canvas()->document().frame()) | 5005 if (LocalFrame* frame = canvas()->document().frame()) |
| 5006 frame->loader().client()->didLoseWebGLContext(webContext()->getGraph
icsResetStatusARB()); | 5006 frame->loader().client()->didLoseWebGLContext(contextGL()->GetGraphi
csResetStatusKHR()); |
| 5007 } | 5007 } |
| 5008 | 5008 |
| 5009 // Make absolutely sure we do not refer to an already-deleted texture or fra
mebuffer. | 5009 // Make absolutely sure we do not refer to an already-deleted texture or fra
mebuffer. |
| 5010 drawingBuffer()->setTexture2DBinding(0); | 5010 drawingBuffer()->setTexture2DBinding(0); |
| 5011 drawingBuffer()->setFramebufferBinding(GL_FRAMEBUFFER, 0); | 5011 drawingBuffer()->setFramebufferBinding(GL_FRAMEBUFFER, 0); |
| 5012 | 5012 |
| 5013 detachAndRemoveAllObjects(); | 5013 detachAndRemoveAllObjects(); |
| 5014 | 5014 |
| 5015 // Lose all the extensions. | 5015 // Lose all the extensions. |
| 5016 for (size_t i = 0; i < m_extensions.size(); ++i) { | 5016 for (size_t i = 0; i < m_extensions.size(); ++i) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5067 { | 5067 { |
| 5068 if (!isContextLost() && drawingBuffer()) { | 5068 if (!isContextLost() && drawingBuffer()) { |
| 5069 drawingBuffer()->setFilterQuality(filterQuality); | 5069 drawingBuffer()->setFilterQuality(filterQuality); |
| 5070 } | 5070 } |
| 5071 } | 5071 } |
| 5072 | 5072 |
| 5073 Extensions3DUtil* WebGLRenderingContextBase::extensionsUtil() | 5073 Extensions3DUtil* WebGLRenderingContextBase::extensionsUtil() |
| 5074 { | 5074 { |
| 5075 if (!m_extensionsUtil) { | 5075 if (!m_extensionsUtil) { |
| 5076 WebGraphicsContext3D* context = webContext(); | 5076 WebGraphicsContext3D* context = webContext(); |
| 5077 gpu::gles2::GLES2Interface* gl = context->getGLES2Interface(); | 5077 gpu::gles2::GLES2Interface* gl = contextGL(); |
| 5078 m_extensionsUtil = Extensions3DUtil::create(context, gl); | 5078 m_extensionsUtil = Extensions3DUtil::create(context, gl); |
| 5079 // The only reason the ExtensionsUtil should be invalid is if the webCon
text is lost. | 5079 // The only reason the ExtensionsUtil should be invalid is if the webCon
text is lost. |
| 5080 ASSERT(m_extensionsUtil->isValid() || gl->GetGraphicsResetStatusKHR() !=
GL_NO_ERROR); | 5080 ASSERT(m_extensionsUtil->isValid() || gl->GetGraphicsResetStatusKHR() !=
GL_NO_ERROR); |
| 5081 } | 5081 } |
| 5082 return m_extensionsUtil.get(); | 5082 return m_extensionsUtil.get(); |
| 5083 } | 5083 } |
| 5084 | 5084 |
| 5085 void WebGLRenderingContextBase::removeSharedObject(WebGLSharedObject* object) | 5085 void WebGLRenderingContextBase::removeSharedObject(WebGLSharedObject* object) |
| 5086 { | 5086 { |
| 5087 m_contextGroup->removeObject(object); | 5087 m_contextGroup->removeObject(object); |
| (...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6288 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); | 6288 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 6289 } | 6289 } |
| 6290 | 6290 |
| 6291 void WebGLRenderingContextBase::restoreUnpackParameters() | 6291 void WebGLRenderingContextBase::restoreUnpackParameters() |
| 6292 { | 6292 { |
| 6293 if (m_unpackAlignment != 1) | 6293 if (m_unpackAlignment != 1) |
| 6294 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); | 6294 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); |
| 6295 } | 6295 } |
| 6296 | 6296 |
| 6297 } // namespace blink | 6297 } // namespace blink |
| OLD | NEW |