Bug 89293

Summary: [TextureMapper] Reduce boilerplate code in the TextureMapperShaderManager
Product: WebKit Reporter: Martin Robinson <mrobinson>
Component: PlatformAssignee: Martin Robinson <mrobinson>
Status: RESOLVED FIXED    
Severity: Normal CC: alex, noam, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 89317    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Martin Robinson
Reported 2012-06-16 17:24:28 PDT
The amount of boilerplate code in TextureMapperShaderManager could be reduced quite a bit to make the code more readable.
Attachments
Patch (25.41 KB, patch)
2012-06-17 20:43 PDT, Martin Robinson
no flags
Patch (25.41 KB, patch)
2012-06-17 21:06 PDT, Martin Robinson
no flags
Patch (25.68 KB, patch)
2012-06-17 22:09 PDT, Martin Robinson
no flags
Martin Robinson
Comment 1 2012-06-17 20:43:25 PDT
Martin Robinson
Comment 2 2012-06-17 21:06:00 PDT
Noam Rosenthal
Comment 3 2012-06-17 21:36:51 PDT
Comment on attachment 148044 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148044&action=review Awesome! Though let's use >= 0 or an enum { InvalidLocation = -1 } instead of using -1 as a magic number. > Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp:397 > + if (program->opacityLocation() != -1) How about >= 0 > Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp:434 > + if (program->opacityLocation() != -1) >= 0
Martin Robinson
Comment 4 2012-06-17 22:09:40 PDT
Martin Robinson
Comment 5 2012-06-17 22:10:35 PDT
Makes sense! I've replaced the test for != -1 with a call to the new static method, TextureMapperShaderProgram::isValidUniformLocation.
WebKit Review Bot
Comment 6 2012-06-17 23:36:24 PDT
Comment on attachment 148052 [details] Patch Clearing flags on attachment: 148052 Committed r120572: <http://trac.webkit.org/changeset/120572>
WebKit Review Bot
Comment 7 2012-06-17 23:36:29 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.