Skip to content
  • senorblanco@chromium.org's avatar
    2010-08-12 Stephen White <senorblanco@chromium.org> · d7e5fff3
    senorblanco@chromium.org authored
            Reviewed by David Levin.
    
            [CHROMIUM] Use the BGRA format for canvas 2D accel upload and readbacks.
            https://bugs.webkit.org/show_bug.cgi?id=43804
    
            Use the BGRA format from GraphicsContext3D, if supported.  Also keep a
            texture around for uploads, rather than re-creating it each time.
    
            Covered by many layout tests (once we're running them).
    
            * platform/graphics/chromium/GLES2Texture.cpp:
            (WebCore::convertFormat):
            Move convertFormat() ahead of texture creation, so we can check for
            BGRA support.
            (WebCore::GLES2Texture::create):
            Use convertFormat() to determine the correct format and types to use;
            use the returned format also for internalFormat, since GLES2 insists
            they match.
            * platform/graphics/skia/PlatformContextSkia.cpp:
            (WebCore::PlatformContextSkia::setGraphicsContext3D):
            Clear the upload texture when a new context is set.
            (WebCore::PlatformContextSkia::uploadSoftwareToHardware):
            Use m_uploadTexture instead of creating a new one each time.
            (WebCore::PlatformContextSkia::readbackHardwareToSoftware):
            When the context supports it, use the BGRA format for readbacks
            instead of swizzling.
            * platform/graphics/skia/PlatformContextSkia.h:
            Add m_uploadTexture for consecutive uploads.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d7e5fff3