RESOLVED FIXED Bug 82049
[Qt][WK2] Make TextureMapperShaderManager::getShaderProgram() not be a template.
https://bugs.webkit.org/show_bug.cgi?id=82049
Summary [Qt][WK2] Make TextureMapperShaderManager::getShaderProgram() not be a template.
Zeno Albisser
Reported 2012-03-23 06:25:46 PDT
When building debug with clang on mac, this template function leads to an assert in HashTable. When building with gcc instead, the problem could not be reproduced. This even was the case if the function was not using the template parameter at all. So just having this function being a template triggered what seems to be a compiler bug.
Attachments
backtrace of the assert. (12.24 KB, text/plain)
2012-03-23 06:27 PDT, Zeno Albisser
no flags
patch for review. (5.24 KB, patch)
2012-03-23 06:43 PDT, Zeno Albisser
no flags
patch for review. - fixed issues as requested. (5.29 KB, patch)
2012-03-23 09:07 PDT, Zeno Albisser
no flags
Zeno Albisser
Comment 1 2012-03-23 06:27:06 PDT
Created attachment 133471 [details] backtrace of the assert. For the sake of completeness I am adding a backtrace to the bugreport.
Zeno Albisser
Comment 2 2012-03-23 06:43:03 PDT
Created attachment 133474 [details] patch for review.
Noam Rosenthal
Comment 3 2012-03-23 07:11:12 PDT
Comment on attachment 133474 [details] patch for review. View in context: https://bugs.webkit.org/attachment.cgi?id=133474&action=review > Source/WebCore/platform/graphics/texmap/TextureMapperShaderManager.h:123 > + if (shaderType == Simple) { > + RefPtr<TextureMapperShaderProgram> t = TextureMapperShaderProgramSimple::create(); > + m_textureMapperShaderProgramMap.add(shaderType, t); > + return t; > + } > + > + if (shaderType == OpacityAndMask) { > + RefPtr<TextureMapperShaderProgram> t = TextureMapperShaderProgramOpacityAndMask::create(); > + m_textureMapperShaderProgramMap.add(shaderType, t); > + return t; > + } This should be a switch, with only the different lines in it. The add and return can go outside the switch. > Source/WebCore/platform/graphics/texmap/TextureMapperShaderManager.h:129 > + typedef HashMap<int, RefPtr<TextureMapperShaderProgram> > TextureMapperShaderProgramMap; Why not keep the key as ShaderType?
Zeno Albisser
Comment 4 2012-03-23 09:07:12 PDT
Created attachment 133497 [details] patch for review. - fixed issues as requested.
Zeno Albisser
Comment 5 2012-03-24 01:38:25 PDT
Comment on attachment 133497 [details] patch for review. - fixed issues as requested. Clearing flags on attachment: 133497 Committed r111986: <http://trac.webkit.org/changeset/111986>
Zeno Albisser
Comment 6 2012-03-24 01:38:32 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.