Changeset 146968 in webkit


Ignore:
Timestamp:
Mar 27, 2013 12:08:30 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[CoordGfx] Support to share GraphicsSurface flags with client.
https://bugs.webkit.org/show_bug.cgi?id=112982

Patch by Kondapally Kalyan <kalyan.kondapally@intel.com> on 2013-03-27
Reviewed by Noam Rosenthal.

Covered by existing WebGL tests.

Source/WebCore:

This patch adds support to pass GraphicsSurface flags during it's client creation.
This would be helpful to determine cases when blending can be disabled on client
side i.e When AlphaSupport is disabled during Graphics Surface creation.
With GLX, we rely on Window to provide us with necessary information on client side.
This might not be the case on other platforms or when not using Window on X.
This patch doesn't change original behaviour of creating GraphicsSurface client
with default flags GraphicsSurface::SupportsTextureTarget and GraphicsSurface::SupportsSharing.

  • platform/graphics/texmap/TextureMapperPlatformLayer.h:

(WebCore::TextureMapperPlatformLayer::graphicsSurfaceFlags):

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:

(WebCore::CoordinatedGraphicsLayer::createCanvasIfNeeded):

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:

(WebCore::CoordinatedGraphicsScene::createCanvasIfNeeded):

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:

(CoordinatedGraphicsLayerState):

  • platform/graphics/efl/GraphicsContext3DPrivate.cpp:

(WebCore):
(WebCore::GraphicsContext3DPrivate::graphicsSurfaceFlags):

  • platform/graphics/efl/GraphicsContext3DPrivate.h:

(GraphicsContext3DPrivate):

  • platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp:

(WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
(WebCore::GraphicsSurfacePrivate::initializeClient):

Source/WebKit2:

This patch adds support to pass GraphicsSurface flags
during it's client creation.

  • Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:

(CoreIPC::::encode):
(CoreIPC::::decode):

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r146967 r146968  
     12013-03-27  Kondapally Kalyan  <kalyan.kondapally@intel.com>
     2
     3        [CoordGfx] Support to share GraphicsSurface flags with client.
     4        https://bugs.webkit.org/show_bug.cgi?id=112982
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        Covered by existing WebGL tests.
     9
     10        This patch adds support to pass GraphicsSurface flags during it's client creation.
     11        This would be helpful to determine cases when blending can be disabled on client
     12        side i.e When AlphaSupport is disabled during Graphics Surface creation.
     13        With GLX, we rely on Window to provide us with necessary information on client side.
     14        This might not be the case on other platforms or when not using Window on X.
     15        This patch doesn't change original behaviour of creating GraphicsSurface client
     16        with default flags GraphicsSurface::SupportsTextureTarget and GraphicsSurface::SupportsSharing.
     17
     18        * platform/graphics/texmap/TextureMapperPlatformLayer.h:
     19        (WebCore::TextureMapperPlatformLayer::graphicsSurfaceFlags):
     20        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
     21        (WebCore::CoordinatedGraphicsLayer::createCanvasIfNeeded):
     22        * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
     23        (WebCore::CoordinatedGraphicsScene::createCanvasIfNeeded):
     24        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
     25        (CoordinatedGraphicsLayerState):
     26        * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
     27        (WebCore):
     28        (WebCore::GraphicsContext3DPrivate::graphicsSurfaceFlags):
     29        * platform/graphics/efl/GraphicsContext3DPrivate.h:
     30        (GraphicsContext3DPrivate):
     31        * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp:
     32        (WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
     33        (WebCore::GraphicsSurfacePrivate::initializeClient):
     34
    1352013-03-26  Takashi Sakamoto  <tasak@google.com>
    236
  • trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp

    r146458 r146968  
    265265    return m_size;
    266266}
     267
     268GraphicsSurface::Flags GraphicsContext3DPrivate::graphicsSurfaceFlags() const
     269{
     270    if (m_graphicsSurface)
     271        return m_graphicsSurface->flags();
     272
     273    return TextureMapperPlatformLayer::graphicsSurfaceFlags();
     274}
    267275#endif
    268276
  • trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h

    r146458 r146968  
    5555    virtual uint32_t copyToGraphicsSurface() OVERRIDE;
    5656    virtual GraphicsSurfaceToken graphicsSurfaceToken() const OVERRIDE;
     57    virtual GraphicsSurface::Flags graphicsSurfaceFlags() const OVERRIDE;
    5758    void didResizeCanvas(const IntSize&);
    5859#endif
  • trunk/Source/WebCore/platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp

    r146458 r146968  
    4242    }
    4343
    44     GraphicsSurfacePrivate(PlatformBufferHandle winId, const IntSize& size, GraphicsSurface::Flags)
    45         : m_rect(FloatPoint::zero(), size)
     44    GraphicsSurfacePrivate(PlatformBufferHandle winId, const IntSize& size, GraphicsSurface::Flags flags)
     45        : m_flags(0)
     46        , m_rect(FloatPoint::zero(), size)
    4647        , m_size(size)
    4748        , m_sharedHandle(winId)
    4849    {
     50        if (flags & GraphicsSurface::SupportsAlpha)
     51            m_flags |= TextureMapperGL::ShouldBlend;
    4952    }
    5053
     
    142145        if (!m_client)
    143146            return;
    144 
    145         // FIXME: This information should be passed from GraphicsSurface.
    146         if (m_client->hasAlpha())
    147             m_flags |= TextureMapperGL::ShouldBlend;
    148147    }
    149148
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h

    r144190 r146968  
    4343    virtual uint32_t copyToGraphicsSurface() { return 0; }
    4444    virtual GraphicsSurfaceToken graphicsSurfaceToken() const { return GraphicsSurfaceToken(); }
     45    virtual GraphicsSurface::Flags graphicsSurfaceFlags() const { return  GraphicsSurface::SupportsTextureTarget | GraphicsSurface::SupportsSharing; }
    4546#endif
    4647};
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

    r145806 r146968  
    728728        m_layerState.canvasSize = m_canvasPlatformLayer->platformLayerSize();
    729729        m_layerState.canvasToken = m_canvasPlatformLayer->graphicsSurfaceToken();
     730        m_layerState.canvasSurfaceFlags = m_canvasPlatformLayer->graphicsSurfaceFlags();
    730731        m_layerState.canvasChanged = true;
    731732        m_isValidCanvas = true;
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp

    r146747 r146968  
    204204    RefPtr<TextureMapperSurfaceBackingStore> canvasBackingStore(TextureMapperSurfaceBackingStore::create());
    205205    m_surfaceBackingStores.set(layer, canvasBackingStore);
    206 
    207     GraphicsSurface::Flags surfaceFlags = GraphicsSurface::SupportsTextureTarget | GraphicsSurface::SupportsSharing;
    208     canvasBackingStore->setGraphicsSurface(GraphicsSurface::create(state.canvasSize, surfaceFlags, state.canvasToken));
     206    canvasBackingStore->setGraphicsSurface(GraphicsSurface::create(state.canvasSize, state.canvasSurfaceFlags, state.canvasToken));
    209207    layer->setContentsToMedia(canvasBackingStore.get());
    210208}
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h

    r145806 r146968  
    4444
    4545#if USE(GRAPHICS_SURFACE)
     46#include "GraphicsSurface.h"
    4647#include "GraphicsSurfaceToken.h"
    4748#endif
     
    163164    GraphicsSurfaceToken canvasToken;
    164165    uint32_t canvasFrontBuffer;
     166    GraphicsSurface::Flags canvasSurfaceFlags;
    165167#endif
    166168
  • trunk/Source/WebKit2/ChangeLog

    r146961 r146968  
     12013-03-27  Kondapally Kalyan  <kalyan.kondapally@intel.com>
     2
     3        [CoordGfx] Support to share GraphicsSurface flags with client.
     4        https://bugs.webkit.org/show_bug.cgi?id=112982
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        Covered by existing WebGL tests.
     9
     10        This patch adds support to pass GraphicsSurface flags
     11        during it's client creation.
     12
     13        * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
     14        (CoreIPC::::encode):
     15        (CoreIPC::::decode):
     16
    1172013-03-26  Hayato Ito  <hayato@chromium.org>
    218
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp

    r144914 r146968  
    895895        encoder << state.canvasToken;
    896896        encoder << state.canvasFrontBuffer;
     897        encoder << state.canvasSurfaceFlags;
    897898    }
    898899#endif
     
    981982
    982983        if (!decoder.decode(state.canvasFrontBuffer))
     984            return false;
     985
     986        if (!decoder.decode(state.canvasSurfaceFlags))
    983987            return false;
    984988    }
Note: See TracChangeset for help on using the changeset viewer.