Commit fb89741f authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

[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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146968 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 20d93810
2013-03-27 Kondapally Kalyan <kalyan.kondapally@intel.com>
[CoordGfx] Support to share GraphicsSurface flags with client.
https://bugs.webkit.org/show_bug.cgi?id=112982
Reviewed by Noam Rosenthal.
Covered by existing WebGL tests.
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):
2013-03-26 Takashi Sakamoto <tasak@google.com>
 
[shadow] styleForText should consider the case where parent node has no style
......@@ -264,6 +264,14 @@ IntSize GraphicsContext3DPrivate::platformLayerSize() const
{
return m_size;
}
GraphicsSurface::Flags GraphicsContext3DPrivate::graphicsSurfaceFlags() const
{
if (m_graphicsSurface)
return m_graphicsSurface->flags();
return TextureMapperPlatformLayer::graphicsSurfaceFlags();
}
#endif
} // namespace WebCore
......
......@@ -54,6 +54,7 @@ public:
virtual IntSize platformLayerSize() const OVERRIDE;
virtual uint32_t copyToGraphicsSurface() OVERRIDE;
virtual GraphicsSurfaceToken graphicsSurfaceToken() const OVERRIDE;
virtual GraphicsSurface::Flags graphicsSurfaceFlags() const OVERRIDE;
void didResizeCanvas(const IntSize&);
#endif
bool makeContextCurrent() const;
......
......@@ -41,11 +41,14 @@ struct GraphicsSurfacePrivate {
{
}
GraphicsSurfacePrivate(PlatformBufferHandle winId, const IntSize& size, GraphicsSurface::Flags)
: m_rect(FloatPoint::zero(), size)
GraphicsSurfacePrivate(PlatformBufferHandle winId, const IntSize& size, GraphicsSurface::Flags flags)
: m_flags(0)
, m_rect(FloatPoint::zero(), size)
, m_size(size)
, m_sharedHandle(winId)
{
if (flags & GraphicsSurface::SupportsAlpha)
m_flags |= TextureMapperGL::ShouldBlend;
}
~GraphicsSurfacePrivate()
......@@ -141,10 +144,6 @@ private:
if (!m_client)
return;
// FIXME: This information should be passed from GraphicsSurface.
if (m_client->hasAlpha())
m_flags |= TextureMapperGL::ShouldBlend;
}
TextureMapperGL::Flags m_flags;
......
......@@ -42,6 +42,7 @@ public:
virtual IntSize platformLayerSize() const { return IntSize(); }
virtual uint32_t copyToGraphicsSurface() { return 0; }
virtual GraphicsSurfaceToken graphicsSurfaceToken() const { return GraphicsSurfaceToken(); }
virtual GraphicsSurface::Flags graphicsSurfaceFlags() const { return GraphicsSurface::SupportsTextureTarget | GraphicsSurface::SupportsSharing; }
#endif
};
......
......@@ -727,6 +727,7 @@ void CoordinatedGraphicsLayer::createCanvasIfNeeded()
if (!m_isValidCanvas) {
m_layerState.canvasSize = m_canvasPlatformLayer->platformLayerSize();
m_layerState.canvasToken = m_canvasPlatformLayer->graphicsSurfaceToken();
m_layerState.canvasSurfaceFlags = m_canvasPlatformLayer->graphicsSurfaceFlags();
m_layerState.canvasChanged = true;
m_isValidCanvas = true;
}
......
......@@ -203,9 +203,7 @@ void CoordinatedGraphicsScene::createCanvasIfNeeded(GraphicsLayer* layer, const
RefPtr<TextureMapperSurfaceBackingStore> canvasBackingStore(TextureMapperSurfaceBackingStore::create());
m_surfaceBackingStores.set(layer, canvasBackingStore);
GraphicsSurface::Flags surfaceFlags = GraphicsSurface::SupportsTextureTarget | GraphicsSurface::SupportsSharing;
canvasBackingStore->setGraphicsSurface(GraphicsSurface::create(state.canvasSize, surfaceFlags, state.canvasToken));
canvasBackingStore->setGraphicsSurface(GraphicsSurface::create(state.canvasSize, state.canvasSurfaceFlags, state.canvasToken));
layer->setContentsToMedia(canvasBackingStore.get());
}
......
......@@ -43,6 +43,7 @@
#endif
#if USE(GRAPHICS_SURFACE)
#include "GraphicsSurface.h"
#include "GraphicsSurfaceToken.h"
#endif
......@@ -162,6 +163,7 @@ struct CoordinatedGraphicsLayerState {
IntSize canvasSize;
GraphicsSurfaceToken canvasToken;
uint32_t canvasFrontBuffer;
GraphicsSurface::Flags canvasSurfaceFlags;
#endif
IntSize committedScrollOffset;
......
2013-03-27 Kondapally Kalyan <kalyan.kondapally@intel.com>
[CoordGfx] Support to share GraphicsSurface flags with client.
https://bugs.webkit.org/show_bug.cgi?id=112982
Reviewed by Noam Rosenthal.
Covered by existing WebGL tests.
This patch adds support to pass GraphicsSurface flags
during it's client creation.
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(CoreIPC::::encode):
(CoreIPC::::decode):
2013-03-26 Hayato Ito <hayato@chromium.org>
 
Allow ShadowContents in HitTests by default.
......@@ -894,6 +894,7 @@ void ArgumentCoder<CoordinatedGraphicsLayerState>::encode(ArgumentEncoder& encod
encoder << state.canvasSize;
encoder << state.canvasToken;
encoder << state.canvasFrontBuffer;
encoder << state.canvasSurfaceFlags;
}
#endif
......@@ -981,6 +982,9 @@ bool ArgumentCoder<CoordinatedGraphicsLayerState>::decode(ArgumentDecoder& decod
if (!decoder.decode(state.canvasFrontBuffer))
return false;
if (!decoder.decode(state.canvasSurfaceFlags))
return false;
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment