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

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

Issue 1849023003: Remove the MSAA WebSetting, which is not read or used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rm-alphadepthetc
Patch Set: 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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 , m_contextLostMode(NotLostContext) 828 , m_contextLostMode(NotLostContext)
829 , m_autoRecoveryMethod(Manual) 829 , m_autoRecoveryMethod(Manual)
830 , m_dispatchContextLostEventTimer(this, &WebGLRenderingContextBase::dispatch ContextLostEvent) 830 , m_dispatchContextLostEventTimer(this, &WebGLRenderingContextBase::dispatch ContextLostEvent)
831 , m_restoreAllowed(false) 831 , m_restoreAllowed(false)
832 , m_restoreTimer(this, &WebGLRenderingContextBase::maybeRestoreContext) 832 , m_restoreTimer(this, &WebGLRenderingContextBase::maybeRestoreContext)
833 , m_preservedDefaultVAOObjectWrapper(false) 833 , m_preservedDefaultVAOObjectWrapper(false)
834 , m_generatedImageCache(4) 834 , m_generatedImageCache(4)
835 , m_requestedAttributes(requestedAttributes) 835 , m_requestedAttributes(requestedAttributes)
836 , m_synthesizedErrorsToConsole(true) 836 , m_synthesizedErrorsToConsole(true)
837 , m_numGLErrorsToConsoleAllowed(maxGLErrorsAllowedToConsole) 837 , m_numGLErrorsToConsoleAllowed(maxGLErrorsAllowedToConsole)
838 , m_multisamplingAllowed(false)
839 , m_multisamplingObserverRegistered(false)
840 , m_onePlusMaxNonDefaultTextureUnit(0) 838 , m_onePlusMaxNonDefaultTextureUnit(0)
841 , m_isWebGL2FormatsTypesAdded(false) 839 , m_isWebGL2FormatsTypesAdded(false)
842 , m_isWebGL2InternalFormatsCopyTexImageAdded(false) 840 , m_isWebGL2InternalFormatsCopyTexImageAdded(false)
843 , m_isOESTextureFloatFormatsTypesAdded(false) 841 , m_isOESTextureFloatFormatsTypesAdded(false)
844 , m_isOESTextureHalfFloatFormatsTypesAdded(false) 842 , m_isOESTextureHalfFloatFormatsTypesAdded(false)
845 , m_isWebGLDepthTextureFormatsTypesAdded(false) 843 , m_isWebGLDepthTextureFormatsTypesAdded(false)
846 , m_isEXTsRGBFormatsTypesAdded(false) 844 , m_isEXTsRGBFormatsTypesAdded(false)
847 #if !ENABLE(OILPAN) 845 #if !ENABLE(OILPAN)
848 , m_weakPtrFactory(this) 846 , m_weakPtrFactory(this)
849 #endif 847 #endif
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 ADD_VALUES_TO_SET(m_supportedTypes, kSupportedTypesES2); 1011 ADD_VALUES_TO_SET(m_supportedTypes, kSupportedTypesES2);
1014 1012
1015 activateContext(this); 1013 activateContext(this);
1016 } 1014 }
1017 1015
1018 void WebGLRenderingContextBase::setupFlags() 1016 void WebGLRenderingContextBase::setupFlags()
1019 { 1017 {
1020 ASSERT(drawingBuffer()); 1018 ASSERT(drawingBuffer());
1021 if (Page* p = canvas()->document().page()) { 1019 if (Page* p = canvas()->document().page()) {
1022 m_synthesizedErrorsToConsole = p->settings().webGLErrorsToConsoleEnabled (); 1020 m_synthesizedErrorsToConsole = p->settings().webGLErrorsToConsoleEnabled ();
1023
1024 if (!m_multisamplingObserverRegistered && m_requestedAttributes.antialia s()) {
1025 m_multisamplingAllowed = drawingBuffer()->multisample();
1026 p->addMultisamplingChangedObserver(this);
1027 m_multisamplingObserverRegistered = true;
1028 }
1029 } 1021 }
1030 1022
1031 m_isDepthStencilSupported = extensionsUtil()->isExtensionEnabled("GL_OES_pac ked_depth_stencil"); 1023 m_isDepthStencilSupported = extensionsUtil()->isExtensionEnabled("GL_OES_pac ked_depth_stencil");
1032 } 1024 }
1033 1025
1034 void WebGLRenderingContextBase::addCompressedTextureFormat(GLenum format) 1026 void WebGLRenderingContextBase::addCompressedTextureFormat(GLenum format)
1035 { 1027 {
1036 if (!m_compressedTextureFormats.contains(format)) 1028 if (!m_compressedTextureFormats.contains(format))
1037 m_compressedTextureFormats.append(format); 1029 m_compressedTextureFormats.append(format);
1038 } 1030 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 tracker->loseExtension(true); 1071 tracker->loseExtension(true);
1080 } 1072 }
1081 m_extensions.clear(); 1073 m_extensions.clear();
1082 1074
1083 // Context must be removed from the group prior to the destruction of the 1075 // Context must be removed from the group prior to the destruction of the
1084 // WebGraphicsContext3D, otherwise shared objects may not be properly delete d. 1076 // WebGraphicsContext3D, otherwise shared objects may not be properly delete d.
1085 m_contextGroup->removeContext(this); 1077 m_contextGroup->removeContext(this);
1086 1078
1087 destroyContext(); 1079 destroyContext();
1088 1080
1089 #if !ENABLE(OILPAN)
1090 if (m_multisamplingObserverRegistered) {
1091 if (Page* page = canvas()->document().page())
1092 page->removeMultisamplingChangedObserver(this);
1093 }
1094 #endif
1095
1096 willDestroyContext(this); 1081 willDestroyContext(this);
1097 } 1082 }
1098 1083
1099 void WebGLRenderingContextBase::destroyContext() 1084 void WebGLRenderingContextBase::destroyContext()
1100 { 1085 {
1101 if (!drawingBuffer()) 1086 if (!drawingBuffer())
1102 return; 1087 return;
1103 1088
1104 m_extensionsUtil.clear(); 1089 m_extensionsUtil.clear();
1105 1090
(...skipping 5107 matching lines...) Expand 10 before | Expand all | Expand 10 after
6213 void WebGLRenderingContextBase::restoreCurrentFramebuffer() 6198 void WebGLRenderingContextBase::restoreCurrentFramebuffer()
6214 { 6199 {
6215 bindFramebuffer(nullptr, GL_FRAMEBUFFER, m_framebufferBinding.get()); 6200 bindFramebuffer(nullptr, GL_FRAMEBUFFER, m_framebufferBinding.get());
6216 } 6201 }
6217 6202
6218 void WebGLRenderingContextBase::restoreCurrentTexture2D() 6203 void WebGLRenderingContextBase::restoreCurrentTexture2D()
6219 { 6204 {
6220 bindTexture(nullptr, GL_TEXTURE_2D, m_textureUnits[m_activeTextureUnit].m_te xture2DBinding.get()); 6205 bindTexture(nullptr, GL_TEXTURE_2D, m_textureUnits[m_activeTextureUnit].m_te xture2DBinding.get());
6221 } 6206 }
6222 6207
6223 void WebGLRenderingContextBase::multisamplingChanged(bool enabled)
6224 {
6225 if (m_multisamplingAllowed != enabled) {
6226 m_multisamplingAllowed = enabled;
6227 forceLostContext(WebGLRenderingContextBase::SyntheticLostContext, WebGLR enderingContextBase::Auto);
6228 }
6229 }
6230
6231 void WebGLRenderingContextBase::findNewMaxNonDefaultTextureUnit() 6208 void WebGLRenderingContextBase::findNewMaxNonDefaultTextureUnit()
6232 { 6209 {
6233 // Trace backwards from the current max to find the new max non-default text ure unit 6210 // Trace backwards from the current max to find the new max non-default text ure unit
6234 int startIndex = m_onePlusMaxNonDefaultTextureUnit - 1; 6211 int startIndex = m_onePlusMaxNonDefaultTextureUnit - 1;
6235 for (int i = startIndex; i >= 0; --i) { 6212 for (int i = startIndex; i >= 0; --i) {
6236 if (m_textureUnits[i].m_texture2DBinding 6213 if (m_textureUnits[i].m_texture2DBinding
6237 || m_textureUnits[i].m_textureCubeMapBinding) { 6214 || m_textureUnits[i].m_textureCubeMapBinding) {
6238 m_onePlusMaxNonDefaultTextureUnit = i + 1; 6215 m_onePlusMaxNonDefaultTextureUnit = i + 1;
6239 return; 6216 return;
6240 } 6217 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
6351 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1); 6328 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, 1);
6352 } 6329 }
6353 6330
6354 void WebGLRenderingContextBase::restoreUnpackParameters() 6331 void WebGLRenderingContextBase::restoreUnpackParameters()
6355 { 6332 {
6356 if (m_unpackAlignment != 1) 6333 if (m_unpackAlignment != 1)
6357 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); 6334 contextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
6358 } 6335 }
6359 6336
6360 } // namespace blink 6337 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698