Bug 97275 - Duplicate code in GraphicsContext3D::validateAttributes() and GraphicsContext3D::validateDepthStencil()
Summary: Duplicate code in GraphicsContext3D::validateAttributes() and GraphicsContext...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pratik Solanki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-20 17:35 PDT by Pratik Solanki
Modified: 2012-12-13 10:18 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.87 KB, patch)
2012-12-12 13:33 PST, Pratik Solanki
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
Patch (1.95 KB, patch)
2012-12-12 14:20 PST, Pratik Solanki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Solanki 2012-09-20 17:35:36 PDT
Both GraphicsContext3D::validateAttributes() and GraphicsContext3D::validateDepthStencil() have this code

    if (m_attrs.antialias) {
        bool isValidVendor = true;
        // Currently in Mac we only turn on antialias if vendor is NVIDIA,
        // or if ATI and on 10.7.2 and above.
        const char* vendor = reinterpret_cast<const char*>(::glGetString(GL_VENDOR));
        if (!vendor || (!std::strstr(vendor, "NVIDIA") && !(std::strstr(vendor, "ATI") && systemAllowsMultisamplingOnATICards())))
            isValidVendor = false;
        if (!isValidVendor || !extensions->supports("GL_ANGLE_framebuffer_multisample") || isGLES2Compliant())
            m_attrs.antialias = false;
        else
            extensions->ensureEnabled("GL_ANGLE_framebuffer_multisample");
    }

And validateAttributes() calls validateDepthStencil() so we are calling this twice? Can the code be shared? Or does on copy need to be deleted?
Comment 1 Pratik Solanki 2012-12-12 13:33:44 PST
Created attachment 179118 [details]
Patch
Comment 2 Early Warning System Bot 2012-12-12 13:44:47 PST
Comment on attachment 179118 [details]
Patch

Attachment 179118 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/15284606
Comment 3 Early Warning System Bot 2012-12-12 13:53:54 PST
Comment on attachment 179118 [details]
Patch

Attachment 179118 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/15285461
Comment 4 Pratik Solanki 2012-12-12 14:20:26 PST
Created attachment 179124 [details]
Patch
Comment 5 Pratik Solanki 2012-12-13 10:18:07 PST
Comment on attachment 179124 [details]
Patch

Clearing flags on attachment: 179124

Committed r137606: <http://trac.webkit.org/changeset/137606>
Comment 6 Pratik Solanki 2012-12-13 10:18:09 PST
All reviewed patches have been landed.  Closing bug.