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

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: rebase Created 4 years, 8 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 5023 matching lines...) Expand 10 before | Expand all | Expand 10 after
5034 5034
5035 void WebGLRenderingContextBase::loseContextImpl(WebGLRenderingContextBase::LostC ontextMode mode, AutoRecoveryMethod autoRecoveryMethod) 5035 void WebGLRenderingContextBase::loseContextImpl(WebGLRenderingContextBase::LostC ontextMode mode, AutoRecoveryMethod autoRecoveryMethod)
5036 { 5036 {
5037 if (isContextLost()) 5037 if (isContextLost())
5038 return; 5038 return;
5039 5039
5040 m_contextLostMode = mode; 5040 m_contextLostMode = mode;
5041 ASSERT(m_contextLostMode != NotLostContext); 5041 ASSERT(m_contextLostMode != NotLostContext);
5042 m_autoRecoveryMethod = autoRecoveryMethod; 5042 m_autoRecoveryMethod = autoRecoveryMethod;
5043 5043
5044 if (mode == RealLostContext) {
5045 // Inform the embedder that a lost context was received. In response, th e embedder might
5046 // decide to take action such as asking the user for permission to use W ebGL again.
5047 if (LocalFrame* frame = canvas()->document().frame())
5048 frame->loader().client()->didLoseWebGLContext(contextGL()->GetGraphi csResetStatusKHR());
5049 }
5050
5051 // Make absolutely sure we do not refer to an already-deleted texture or fra mebuffer. 5044 // Make absolutely sure we do not refer to an already-deleted texture or fra mebuffer.
5052 drawingBuffer()->setTexture2DBinding(0); 5045 drawingBuffer()->setTexture2DBinding(0);
5053 drawingBuffer()->setFramebufferBinding(GL_FRAMEBUFFER, 0); 5046 drawingBuffer()->setFramebufferBinding(GL_FRAMEBUFFER, 0);
5054 5047
5055 detachAndRemoveAllObjects(); 5048 detachAndRemoveAllObjects();
5056 5049
5057 // Lose all the extensions. 5050 // Lose all the extensions.
5058 for (size_t i = 0; i < m_extensions.size(); ++i) { 5051 for (size_t i = 0; i < m_extensions.size(); ++i) {
5059 ExtensionTracker* tracker = m_extensions[i]; 5052 ExtensionTracker* tracker = m_extensions[i];
5060 tracker->loseExtension(false); 5053 tracker->loseExtension(false);
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after
6321 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); 6314 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1);
6322 } 6315 }
6323 6316
6324 void WebGLRenderingContextBase::restoreUnpackParameters() 6317 void WebGLRenderingContextBase::restoreUnpackParameters()
6325 { 6318 {
6326 if (m_unpackAlignment != 1) 6319 if (m_unpackAlignment != 1)
6327 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); 6320 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
6328 } 6321 }
6329 6322
6330 } // namespace blink 6323 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoaderClient.h ('k') | third_party/WebKit/Source/web/FrameLoaderClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698