Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 1747283003: Remove redundant codepath for webgl api blocking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better handle 'exit_on_context_lost' Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4988 matching lines...) Expand 10 before | Expand all | Expand 10 after
4999 4999
5000 void WebGLRenderingContextBase::loseContextImpl(WebGLRenderingContextBase::LostC ontextMode mode, AutoRecoveryMethod autoRecoveryMethod) 5000 void WebGLRenderingContextBase::loseContextImpl(WebGLRenderingContextBase::LostC ontextMode mode, AutoRecoveryMethod autoRecoveryMethod)
5001 { 5001 {
5002 if (isContextLost()) 5002 if (isContextLost())
5003 return; 5003 return;
5004 5004
5005 m_contextLostMode = mode; 5005 m_contextLostMode = mode;
5006 ASSERT(m_contextLostMode != NotLostContext); 5006 ASSERT(m_contextLostMode != NotLostContext);
5007 m_autoRecoveryMethod = autoRecoveryMethod; 5007 m_autoRecoveryMethod = autoRecoveryMethod;
5008 5008
5009 if (mode == RealLostContext) {
5010 // Inform the embedder that a lost context was received. In response, th e embedder might
5011 // decide to take action such as asking the user for permission to use W ebGL again.
5012 if (LocalFrame* frame = canvas()->document().frame())
5013 frame->loader().client()->didLoseWebGLContext(contextGL()->GetGraphi csResetStatusKHR());
5014 }
5015
5016 // 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.
5017 drawingBuffer()->setTexture2DBinding(0); 5010 drawingBuffer()->setTexture2DBinding(0);
5018 drawingBuffer()->setFramebufferBinding(GL_FRAMEBUFFER, 0); 5011 drawingBuffer()->setFramebufferBinding(GL_FRAMEBUFFER, 0);
5019 5012
5020 detachAndRemoveAllObjects(); 5013 detachAndRemoveAllObjects();
5021 5014
5022 // Lose all the extensions. 5015 // Lose all the extensions.
5023 for (size_t i = 0; i < m_extensions.size(); ++i) { 5016 for (size_t i = 0; i < m_extensions.size(); ++i) {
5024 ExtensionTracker* tracker = m_extensions[i]; 5017 ExtensionTracker* tracker = m_extensions[i];
5025 tracker->loseExtension(false); 5018 tracker->loseExtension(false);
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
6295 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); 6288 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1);
6296 } 6289 }
6297 6290
6298 void WebGLRenderingContextBase::restoreUnpackParameters() 6291 void WebGLRenderingContextBase::restoreUnpackParameters()
6299 { 6292 {
6300 if (m_unpackAlignment != 1) 6293 if (m_unpackAlignment != 1)
6301 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); 6294 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
6302 } 6295 }
6303 6296
6304 } // namespace blink 6297 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698