Changeset 203938 in webkit
- Timestamp:
- Jul 29, 2016 8:22:19 PM (8 years ago)
- Location:
- trunk/Source/ThirdParty/ANGLE
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/ThirdParty/ANGLE/ChangeLog
r203169 r203938 1 2016-07-29 David Kilzer <ddkilzer@apple.com> 2 3 ANGLE: Fix global constructors and exit-time destructors 4 <https://webkit.org/b/160332> 5 6 Reviewed by Darin Adler. 7 8 * Configurations/Base.xcconfig: 9 - Add warning flags. 10 11 * src/common/angleutils.cpp: 12 (FormatString): 13 * src/common/angleutils.h: 14 (MakeStaticString): 15 * src/common/debug.cpp: 16 * src/common/mathutil.cpp: 17 (gl::g_sharedexp_max): 18 (gl::convertRGBFloatsTo999E5): 19 * src/compiler/translator/ShaderLang.cpp: 20 (ShGetUniformRegisterMap): 21 * src/libANGLE/Caps.cpp: 22 (gl::TextureCapsMap::get): 23 * src/libANGLE/Device.cpp: 24 (egl::GetDeviceSet): 25 * src/libANGLE/Display.cpp: 26 (egl::Display::getClientExtensionString): 27 * src/libANGLE/formatutils.cpp: 28 (gl::BuildFormatMap): 29 (gl::BuildInternalFormatInfoMap): 30 (gl::GetInternalFormatMap): 31 (gl::BuildAllSizedInternalFormatSet): 32 (gl::GetSizedInternalFormat): 33 (gl::GetAllSizedInternalFormats): 34 * src/libANGLE/validationES3.cpp: 35 (gl::BuildES3FormatSet): 36 (gl::ValidateTexImageFormatCombination): 37 (gl::BuildSizedEffectiveInternalFormatList): 38 (gl::BuildUnsizedEffectiveInternalFormatList): 39 (gl::GetEffectiveInternalFormat): 40 (gl::BuildValidES3CopyTexImageCombinations): 41 (gl::IsValidES3CopyTexImageCombination): 42 - Fix global constructors and exit-time destructors. 43 1 44 2016-07-13 Enrica Casucci <enrica@apple.com> 2 45 -
trunk/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig
r203169 r203938 43 43 PREBINDING = NO; 44 44 STRIP_INSTALLED_PRODUCT = NO; 45 WARNING_CFLAGS = -Wexit-time-destructors -Wglobal-constructors; 45 46 46 47 SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx appletvos appletvsimulator watchos watchsimulator; -
trunk/Source/ThirdParty/ANGLE/src/common/angleutils.cpp
r199738 r203938 37 37 std::string FormatString(const char *fmt, va_list vararg) 38 38 { 39 static std::vector<char> buffer(512);39 static auto& buffer = *new std::vector<char>(512); 40 40 41 41 size_t len = FormatStringIntoVector(fmt, vararg, buffer); -
trunk/Source/ThirdParty/ANGLE/src/common/angleutils.h
r199738 r203938 117 117 inline const char* MakeStaticString(const std::string &str) 118 118 { 119 static std::set<std::string> strings;119 static auto& strings = *new std::set<std::string>; 120 120 std::set<std::string>::iterator it = strings.find(str); 121 121 if (it != strings.end()) -
trunk/Source/ThirdParty/ANGLE/src/common/debug.cpp
r199738 r203938 35 35 if (DebugAnnotationsActive()) 36 36 { 37 static std::vector<char> buffer(512);37 static auto& buffer = *new std::vector<char>(512); 38 38 size_t len = FormatStringIntoVector(format, vararg, buffer); 39 39 std::wstring formattedWideMessage(buffer.begin(), buffer.begin() + len); -
trunk/Source/ThirdParty/ANGLE/src/common/mathutil.cpp
r199738 r203938 32 32 static const int g_sharedexp_maxexponent = 31; 33 33 34 static const float g_sharedexp_max = ((pow(2.0f, g_sharedexp_mantissabits) - 1) / 35 pow(2.0f, g_sharedexp_mantissabits)) * 36 pow(2.0f, g_sharedexp_maxexponent - g_sharedexp_bias); 34 static float g_sharedexp_max() 35 { 36 static float sharedexp_max = ((powf(2.0f, g_sharedexp_mantissabits) - 1) / 37 powf(2.0f, g_sharedexp_mantissabits)) * 38 powf(2.0f, g_sharedexp_maxexponent - g_sharedexp_bias); 39 return sharedexp_max; 40 } 37 41 38 42 unsigned int convertRGBFloatsTo999E5(float red, float green, float blue) 39 43 { 40 const float red_c = std::max<float>(0, std::min(g_sharedexp_max , red));41 const float green_c = std::max<float>(0, std::min(g_sharedexp_max , green));42 const float blue_c = std::max<float>(0, std::min(g_sharedexp_max , blue));44 const float red_c = std::max<float>(0, std::min(g_sharedexp_max(), red)); 45 const float green_c = std::max<float>(0, std::min(g_sharedexp_max(), green)); 46 const float blue_c = std::max<float>(0, std::min(g_sharedexp_max(), blue)); 43 47 44 48 const float max_c = std::max<float>(std::max<float>(red_c, green_c), blue_c); -
trunk/Source/ThirdParty/ANGLE/src/compiler/translator/ShaderLang.cpp
r199738 r203938 372 372 return translator->getUniformRegisterMap(); 373 373 #else 374 static std::map<std::string, unsigned int> map;374 static auto& map = *new std::map<std::string, unsigned int>; 375 375 return ↦ 376 376 #endif // ANGLE_ENABLE_HLSL -
trunk/Source/ThirdParty/ANGLE/src/libANGLE/Caps.cpp
r199738 r203938 73 73 const TextureCaps &TextureCapsMap::get(GLenum internalFormat) const 74 74 { 75 static TextureCaps defaultUnsupportedTexture;75 static auto& defaultUnsupportedTexture = *new TextureCaps; 76 76 InternalFormatToCapsMap::const_iterator iter = mCapsMap.find(internalFormat); 77 77 return (iter != mCapsMap.end()) ? iter->second : defaultUnsupportedTexture; -
trunk/Source/ThirdParty/ANGLE/src/libANGLE/Device.cpp
r199738 r203938 39 39 static DeviceSet *GetDeviceSet() 40 40 { 41 static DeviceSet devices;41 static auto& devices = *new DeviceSet; 42 42 return &devices; 43 43 } -
trunk/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp
r200107 r203938 83 83 static WindowSurfaceMap *GetWindowSurfaces() 84 84 { 85 static WindowSurfaceMap windowSurfaces;85 static auto& windowSurfaces = *new WindowSurfaceMap; 86 86 return &windowSurfaces; 87 87 } … … 90 90 static ANGLEPlatformDisplayMap *GetANGLEPlatformDisplayMap() 91 91 { 92 static ANGLEPlatformDisplayMap displays;92 static auto& displays = *new ANGLEPlatformDisplayMap; 93 93 return &displays; 94 94 } … … 97 97 static DevicePlatformDisplayMap *GetDevicePlatformDisplayMap() 98 98 { 99 static DevicePlatformDisplayMap displays;99 static auto& displays = *new DevicePlatformDisplayMap; 100 100 return &displays; 101 101 } … … 950 950 const std::string &Display::getClientExtensionString() 951 951 { 952 static const std::string clientExtensionsString = GenerateExtensionsString(getClientExtensions());952 static const auto& clientExtensionsString = *new std::string(GenerateExtensionsString(getClientExtensions())); 953 953 return clientExtensionsString; 954 954 } -
trunk/Source/ThirdParty/ANGLE/src/libANGLE/formatutils.cpp
r199738 r203938 30 30 } 31 31 32 FormatMap BuildFormatMap()33 { 34 FormatMap map;32 FormatMap& BuildFormatMap() 33 { 34 auto& map = *new FormatMap; 35 35 36 36 // | Format | Type | Internal format | … … 393 393 typedef std::map<GLenum, InternalFormat> InternalFormatInfoMap; 394 394 395 static InternalFormatInfoMap BuildInternalFormatInfoMap()396 { 397 InternalFormatInfoMap map;395 static InternalFormatInfoMap& BuildInternalFormatInfoMap() 396 { 397 auto& map = *new InternalFormatInfoMap; 398 398 399 399 // clang-format off … … 577 577 static const InternalFormatInfoMap &GetInternalFormatMap() 578 578 { 579 static const InternalFormatInfoMap formatMap = BuildInternalFormatInfoMap();579 static const InternalFormatInfoMap& formatMap = BuildInternalFormatInfoMap(); 580 580 return formatMap; 581 581 } 582 582 583 static FormatSet BuildAllSizedInternalFormatSet()584 { 585 FormatSet result;583 static FormatSet& BuildAllSizedInternalFormatSet() 584 { 585 auto& result = *new FormatSet; 586 586 587 587 const InternalFormatInfoMap &formats = GetInternalFormatMap(); … … 743 743 else 744 744 { 745 static const FormatMap formatMap = BuildFormatMap();745 static const FormatMap& formatMap = BuildFormatMap(); 746 746 FormatMap::const_iterator iter = formatMap.find(FormatTypePair(internalFormat, type)); 747 747 if (iter != formatMap.end()) … … 758 758 const FormatSet &GetAllSizedInternalFormats() 759 759 { 760 static FormatSet formatSet = BuildAllSizedInternalFormatSet();760 static FormatSet& formatSet = BuildAllSizedInternalFormatSet(); 761 761 return formatSet; 762 762 } -
trunk/Source/ThirdParty/ANGLE/src/libANGLE/validationES3.cpp
r199738 r203938 45 45 } 46 46 47 ES3FormatCombinationSet BuildES3FormatSet()48 { 49 ES3FormatCombinationSet set;47 ES3FormatCombinationSet& BuildES3FormatSet() 48 { 49 auto& set = *new ES3FormatCombinationSet; 50 50 51 51 // Format combinations from ES 3.0.1 spec, table 3.2 … … 218 218 bool typeSupported = false; 219 219 220 static const ES3FormatCombinationSet es3FormatSet = BuildES3FormatSet();220 static const ES3FormatCombinationSet& es3FormatSet = BuildES3FormatSet(); 221 221 for (ES3FormatCombinationSet::const_iterator i = es3FormatSet.begin(); i != es3FormatSet.end(); i++) 222 222 { … … 592 592 typedef std::vector<EffectiveInternalFormatInfo> EffectiveInternalFormatList; 593 593 594 static EffectiveInternalFormatList BuildSizedEffectiveInternalFormatList()595 { 596 EffectiveInternalFormatList list;594 static EffectiveInternalFormatList& BuildSizedEffectiveInternalFormatList() 595 { 596 auto& list = *new EffectiveInternalFormatList; 597 597 598 598 // OpenGL ES 3.0.3 Specification, Table 3.17, pg 141: Effective internal format coresponding to destination internal format and … … 613 613 } 614 614 615 static EffectiveInternalFormatList BuildUnsizedEffectiveInternalFormatList()616 { 617 EffectiveInternalFormatList list;615 static EffectiveInternalFormatList& BuildUnsizedEffectiveInternalFormatList() 616 { 617 auto& list = *new EffectiveInternalFormatList; 618 618 619 619 // OpenGL ES 3.0.3 Specification, Table 3.17, pg 141: Effective internal format coresponding to destination internal format and … … 641 641 if (destFormat.pixelBytes > 0) 642 642 { 643 static const EffectiveInternalFormatList sizedList = BuildSizedEffectiveInternalFormatList();643 static const EffectiveInternalFormatList& sizedList = BuildSizedEffectiveInternalFormatList(); 644 644 list = &sizedList; 645 645 } 646 646 else 647 647 { 648 static const EffectiveInternalFormatList unsizedList = BuildUnsizedEffectiveInternalFormatList();648 static const EffectiveInternalFormatList& unsizedList = BuildUnsizedEffectiveInternalFormatList(); 649 649 list = &unsizedList; 650 650 targetFormat = destFormat.format; … … 684 684 typedef std::set<CopyConversion> CopyConversionSet; 685 685 686 static CopyConversionSet BuildValidES3CopyTexImageCombinations()687 { 688 CopyConversionSet set;686 static CopyConversionSet& BuildValidES3CopyTexImageCombinations() 687 { 688 auto& set = *new CopyConversionSet; 689 689 690 690 // From ES 3.0.1 spec, table 3.15 … … 734 734 const InternalFormat &framebufferInternalFormatInfo = GetInternalFormatInfo(frameBufferInternalFormat); 735 735 736 static const CopyConversionSet conversionSet = BuildValidES3CopyTexImageCombinations();736 static const CopyConversionSet& conversionSet = BuildValidES3CopyTexImageCombinations(); 737 737 if (conversionSet.find(CopyConversion(textureInternalFormatInfo.format, framebufferInternalFormatInfo.format)) != conversionSet.end()) 738 738 {
Note: See TracChangeset
for help on using the changeset viewer.