Changeset 86275 in webkit


Ignore:
Timestamp:
May 11, 2011 2:58:50 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-11 John Bauman <jbauman@chromium.org>

Reviewed by Kenneth Russell.

Don't send zeros in TexImage if GL implementation handles that
https://bugs.webkit.org/show_bug.cgi?id=60581

Chromium already handles zeroing textures upon creation, so don't
bother zeroing them in WebKit, as that causes some unnecessary memcpys
of zeros.

No new tests as functionality is the same.

  • html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::texImage2DBase):
  • platform/graphics/GraphicsContext3D.cpp: (WebCore::GraphicsContext3D::texImage2DResourceSafe):
  • platform/graphics/GraphicsContext3D.h:
  • platform/graphics/gtk/GraphicsContext3DGtk.cpp: (WebCore::GraphicsContext3D::GraphicsContext3D):
  • platform/graphics/mac/GraphicsContext3DMac.mm: (WebCore::GraphicsContext3D::GraphicsContext3D):
  • platform/graphics/qt/GraphicsContext3DQt.cpp: (WebCore::GraphicsContext3D::GraphicsContext3D):

2011-05-11 John Bauman <jbauman@chromium.org>

Reviewed by Kenneth Russell.

Don't send zeros in TexImage if GL implementation handles that
https://bugs.webkit.org/show_bug.cgi?id=60581

Chromium already handles zeroing textures upon creation, so don't
bother zeroing them in WebKit, as that causes some unnecessary memcpys
of zeros.

  • src/GraphicsContext3DChromium.cpp: (WebCore::GraphicsContext3D::create):
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86274 r86275  
     12011-05-11  John Bauman  <jbauman@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Don't send zeros in TexImage if GL implementation handles that
     6        https://bugs.webkit.org/show_bug.cgi?id=60581
     7
     8        Chromium already handles zeroing textures upon creation, so don't
     9        bother zeroing them in WebKit, as that causes some unnecessary memcpys
     10        of zeros.
     11
     12        No new tests as functionality is the same.
     13
     14        * html/canvas/WebGLRenderingContext.cpp:
     15        (WebCore::WebGLRenderingContext::texImage2DBase):
     16        * platform/graphics/GraphicsContext3D.cpp:
     17        (WebCore::GraphicsContext3D::texImage2DResourceSafe):
     18        * platform/graphics/GraphicsContext3D.h:
     19        * platform/graphics/gtk/GraphicsContext3DGtk.cpp:
     20        (WebCore::GraphicsContext3D::GraphicsContext3D):
     21        * platform/graphics/mac/GraphicsContext3DMac.mm:
     22        (WebCore::GraphicsContext3D::GraphicsContext3D):
     23        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     24        (WebCore::GraphicsContext3D::GraphicsContext3D):
     25
    1262011-05-11  Simon Fraser  <simon.fraser@apple.com>
    227
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r85603 r86275  
    30703070        }
    30713071    }
    3072     if (!pixels && !isResourceSafe()) {
     3072    if (!pixels) {
    30733073        bool succeed = m_context->texImage2DResourceSafe(target, level, internalformat, width, height,
    30743074                                                         border, format, type, m_unpackAlignment);
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.cpp

    r84474 r86275  
    6767    ASSERT(unpackAlignment == 1 || unpackAlignment == 2 || unpackAlignment == 4 || unpackAlignment == 8);
    6868    OwnArrayPtr<unsigned char> zero;
    69     if (width > 0 && height > 0) {
     69    if (!m_isResourceSafe && width > 0 && height > 0) {
    7070        unsigned int size;
    7171        GC3Denum error = computeImageSizeInBytes(format, type, width, height, unpackAlignment, &size, 0);
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h

    r84101 r86275  
    887887
    888888    int m_currentWidth, m_currentHeight;
     889    bool m_isResourceSafe;
    889890
    890891#if PLATFORM(MAC)
  • trunk/Source/WebCore/platform/graphics/gtk/GraphicsContext3DGtk.cpp

    r82878 r86275  
    5656    : m_currentWidth(0)
    5757    , m_currentHeight(0)
     58    , m_isResourceSafe(false)
    5859    , m_attrs(attributes)
    5960    , m_texture(0)
  • trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm

    r82878 r86275  
    9191    : m_currentWidth(0)
    9292    , m_currentHeight(0)
     93    , m_isResourceSafe(false)
    9394    , m_contextObj(0)
    9495    , m_attrs(attrs)
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r86026 r86275  
    616616
    617617GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool)
    618     : m_internal(adoptPtr(new GraphicsContext3DInternal(attrs, hostWindow)))
     618    : m_internal(adoptPtr(new GraphicsContext3DInternal(attrs, hostWindow))), m_isResourceSafe(false)
    619619{
    620620    if (!m_internal->isValid())
  • trunk/Source/WebKit/chromium/ChangeLog

    r86219 r86275  
     12011-05-11  John Bauman  <jbauman@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Don't send zeros in TexImage if GL implementation handles that
     6        https://bugs.webkit.org/show_bug.cgi?id=60581
     7
     8        Chromium already handles zeroing textures upon creation, so don't
     9        bother zeroing them in WebKit, as that causes some unnecessary memcpys
     10        of zeros.
     11
     12        * src/GraphicsContext3DChromium.cpp:
     13        (WebCore::GraphicsContext3D::create):
     14
    1152011-05-10  Kent Tamura  <tkent@chromium.org>
    216
  • trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp

    r85823 r86275  
    946946    RefPtr<GraphicsContext3D> result = adoptRef(new GraphicsContext3D(attrs, hostWindow, renderStyle == RenderDirectlyToHostWindow));
    947947    result->m_internal = internal.release();
     948    result->m_isResourceSafe = result->getExtensions()->isEnabled("GL_CHROMIUM_resource_safe");
    948949    return result.release();
    949950}
Note: See TracChangeset for help on using the changeset viewer.