Changeset 126675 in webkit


Ignore:
Timestamp:
Aug 24, 2012 7:26:06 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Texmap] Move TextureMapperGL to use GraphicsContext3D
https://bugs.webkit.org/show_bug.cgi?id=78672

Patch by Helder Correia <Helder Correia> on 2012-08-24
Reviewed by Noam Rosenthal.

Introducing a new GraphicsContext3D::texImage2DDirect() to allow
initialization of textures without allocation. The existing
textImage2D() refuses a null pixel buffer, and
texImage2DResourceSafe() allows it but performs memory
allocation and zeroes the bits. This was not fast enough for
BitmapTextureGL frequent setting up.

No new tests, refactoring.

  • platform/graphics/GraphicsContext3D.h:

(GraphicsContext3D):

  • platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:

(WebCore::GraphicsContext3D::texImage2D):

  • platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:

(WebCore::GraphicsContext3D::texImage2DDirect):
(WebCore):

  • platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:

(WebCore::GraphicsContext3D::texImage2D):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r126666 r126675  
     12012-08-24  Helder Correia  <helder.correia@nokia.com>
     2
     3        [Texmap] Move TextureMapperGL to use GraphicsContext3D
     4        https://bugs.webkit.org/show_bug.cgi?id=78672
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        Introducing a new GraphicsContext3D::texImage2DDirect() to allow
     9        initialization of textures without allocation. The existing
     10        textImage2D() refuses a null pixel buffer, and
     11        texImage2DResourceSafe() allows it but performs memory
     12        allocation and zeroes the bits. This was not fast enough for
     13        BitmapTextureGL frequent setting up.
     14
     15        No new tests, refactoring.
     16
     17        * platform/graphics/GraphicsContext3D.h:
     18        (GraphicsContext3D):
     19        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
     20        (WebCore::GraphicsContext3D::texImage2D):
     21        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
     22        (WebCore::GraphicsContext3D::texImage2DDirect):
     23        (WebCore):
     24        * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
     25        (WebCore::GraphicsContext3D::texImage2D):
     26
    1272012-08-24  Roger Fong  <roger_fong@apple.com>
    228
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h

    r126635 r126675  
    527527#endif
    528528
     529    // Equivalent to ::glTexImage2D(). Allows pixels==0 with no allocation.
     530    void texImage2DDirect(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels);
     531
    529532    // Helper to texImage2D with pixel==0 case: pixels are initialized to 0.
    530533    // Return true if no GL error is synthesized.
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp

    r122670 r126675  
    257257        return false;
    258258    }
    259     makeContextCurrent();
     259
    260260    GC3Denum openGLInternalFormat = internalformat;
    261261    if (type == GL_FLOAT) {
     
    266266    }
    267267
    268     ::glTexImage2D(target, level, openGLInternalFormat, width, height, border, format, type, pixels);
     268    texImage2DDirect(target, level, openGLInternalFormat, width, height, border, format, type, pixels);
    269269    return true;
    270270}
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp

    r126635 r126675  
    13811381}
    13821382
     1383void GraphicsContext3D::texImage2DDirect(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels)
     1384{
     1385    makeContextCurrent();
     1386    ::glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
     1387}
     1388
    13831389}
    13841390
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp

    r123759 r126675  
    3232
    3333#include "GraphicsContext3D.h"
     34
    3435#include "Extensions3DOpenGLES.h"
    3536#include "IntRect.h"
     
    202203        return false;
    203204    }
    204     makeContextCurrent();
    205     ::glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
     205
     206    texImage2DDirect(target, level, internalformat, width, height, border, format, type, pixels);
    206207    return true;
    207208}
Note: See TracChangeset for help on using the changeset viewer.