+2012-04-26 James Robinson <jamesr@chromium.org>
+
+ [chromium] Separate IOSurface layer type from texture layers
+ https://bugs.webkit.org/show_bug.cgi?id=85030
+
+ Reviewed by Adrienne Walker.
+
+ Adds a new layer type for IOSurface backed layers, instead of sharing that functionality in
+ WebExternalTextureLayer. IOSurface backed layers do not share any other properties with external texture layers.
+
+ * Platform.gypi:
+ * chromium/public/WebExternalTextureLayer.h:
+ (WebExternalTextureLayer):
+ * chromium/public/WebIOSurfaceLayer.h:
+ (WebCore):
+ (WebKit):
+ (WebIOSurfaceLayer):
+ (WebKit::WebIOSurfaceLayer::WebIOSurfaceLayer):
+ (WebKit::WebIOSurfaceLayer::~WebIOSurfaceLayer):
+
2012-04-25 Dana Jansens <danakj@chromium.org>
[chromium] Remove guarded virtual methods from WebFilterOperation API
'chromium/public/WebHTTPLoadInfo.h',
'chromium/public/WebICECandidateDescriptor.h',
'chromium/public/WebICEOptions.h',
+ 'chromium/public/WebIOSurfaceLayer.h',
'chromium/public/WebLayer.h',
'chromium/public/WebLayerTreeView.h',
'chromium/public/WebLayerTreeViewClient.h',
// compositor context.
WEBKIT_EXPORT void setTextureId(unsigned);
- // Sets the IO surface id that represents this layer. setTextureId() and setIOSurfaceProperties() are mutually
- // exclusive - a layer can be either backed by a texture or an IO surface, but not both.
- WEBKIT_EXPORT void setIOSurfaceProperties(const WebSize&, unsigned ioSurfaceId);
-
// Sets whether or not the texture should be flipped in the Y direction when
// rendered.
WEBKIT_EXPORT void setFlipped(bool);
--- /dev/null
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebIOSurfaceLayer_h
+#define WebIOSurfaceLayer_h
+
+#include "WebCommon.h"
+#include "WebLayer.h"
+#include "WebSize.h"
+
+namespace WebCore {
+class IOSurfaceLayerChromium;
+}
+
+namespace WebKit {
+
+// This class represents a layer that renders an externally managed IOSurface.
+class WebIOSurfaceLayer : public WebLayer {
+public:
+ WEBKIT_EXPORT static WebIOSurfaceLayer create();
+
+ WebIOSurfaceLayer() { }
+ virtual ~WebIOSurfaceLayer() { }
+
+ // Sets the IO surface id that represents this layer's contents.
+ WEBKIT_EXPORT void setIOSurfaceProperties(unsigned ioSurfaceId, WebSize);
+
+private:
+#if WEBKIT_IMPLEMENTATION
+ explicit WebIOSurfaceLayer(PassRefPtr<WebCore::IOSurfaceLayerChromium>);
+#endif
+};
+
+} // namespace WebKit
+
+#endif // WebIOSurfaceLayer_h
+2012-04-26 James Robinson <jamesr@chromium.org>
+
+ [chromium] Separate IOSurface layer type from texture layers
+ https://bugs.webkit.org/show_bug.cgi?id=85030
+
+ Reviewed by Adrienne Walker.
+
+ Adds a new layer type for IOSurface layers and pipes through a separate path through to rendering. IOSurface
+ layers are very simple - they have an IOSurface id and size, nothing else. All IOSurface layers are "flipped" in
+ our terminology.
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/IOSurfaceLayerChromium.cpp:
+ (WebCore):
+ (WebCore::IOSurfaceLayerChromium::create):
+ (WebCore::IOSurfaceLayerChromium::IOSurfaceLayerChromium):
+ (WebCore::IOSurfaceLayerChromium::~IOSurfaceLayerChromium):
+ (WebCore::IOSurfaceLayerChromium::setIOSurfaceProperties):
+ (WebCore::IOSurfaceLayerChromium::createCCLayerImpl):
+ (WebCore::IOSurfaceLayerChromium::drawsContent):
+ (WebCore::IOSurfaceLayerChromium::pushPropertiesTo):
+ * platform/graphics/chromium/IOSurfaceLayerChromium.h:
+ (WebCore):
+ (IOSurfaceLayerChromium):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::drawIOSurfaceQuad):
+ (WebCore::LayerRendererChromium::cleanupSharedObjects):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (LayerRendererChromium):
+ * platform/graphics/chromium/TextureLayerChromium.cpp:
+ (WebCore::TextureLayerChromium::TextureLayerChromium):
+ (WebCore::TextureLayerChromium::drawsContent):
+ (WebCore::TextureLayerChromium::pushPropertiesTo):
+ * platform/graphics/chromium/TextureLayerChromium.h:
+ (TextureLayerChromium):
+ * platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.cpp:
+ (WebCore::CCIOSurfaceDrawQuad::create):
+ (WebCore::CCIOSurfaceDrawQuad::CCIOSurfaceDrawQuad):
+ * platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.h:
+ (CCIOSurfaceDrawQuad):
+ * platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
+ (WebCore):
+ (WebCore::CCIOSurfaceLayerImpl::CCIOSurfaceLayerImpl):
+ (WebCore::CCIOSurfaceLayerImpl::~CCIOSurfaceLayerImpl):
+ (WebCore::CCIOSurfaceLayerImpl::willDraw):
+ (WebCore::CCIOSurfaceLayerImpl::appendQuads):
+ (WebCore::CCIOSurfaceLayerImpl::dumpLayerProperties):
+ (WebCore::CCIOSurfaceLayerImpl::didLoseContext):
+ (WebCore::CCIOSurfaceLayerImpl::setIOSurfaceProperties):
+ * platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.h:
+ (WebCore):
+ (CCIOSurfaceLayerImpl):
+ (WebCore::CCIOSurfaceLayerImpl::create):
+ * platform/graphics/chromium/cc/CCTextureLayerImpl.cpp:
+ (WebCore::CCTextureLayerImpl::CCTextureLayerImpl):
+ (WebCore::CCTextureLayerImpl::~CCTextureLayerImpl):
+ (WebCore::CCTextureLayerImpl::appendQuads):
+ (WebCore::CCTextureLayerImpl::didLoseContext):
+ * platform/graphics/chromium/cc/CCTextureLayerImpl.h:
+ (CCTextureLayerImpl):
+
2012-04-27 Arvid Nilsson <anilsson@rim.com>
[BlackBerry] OpenGL related bug fixes
'platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp',
'platform/graphics/chromium/GraphicsLayerChromium.cpp',
'platform/graphics/chromium/GraphicsLayerChromium.h',
+ 'platform/graphics/chromium/IOSurfaceLayerChromium.cpp',
+ 'platform/graphics/chromium/IOSurfaceLayerChromium.h',
'platform/graphics/chromium/IconChromium.cpp',
'platform/graphics/chromium/IconChromiumAndroid.cpp',
'platform/graphics/chromium/ImageBufferDataSkia.h',
'platform/graphics/chromium/LayerPainterChromium.h',
'platform/graphics/chromium/LayerRendererChromium.cpp',
'platform/graphics/chromium/LayerRendererChromium.h',
- 'platform/graphics/chromium/ManagedTexture.cpp',
- 'platform/graphics/chromium/ManagedTexture.h',
'platform/graphics/chromium/LayerTextureSubImage.cpp',
'platform/graphics/chromium/LayerTextureSubImage.h',
'platform/graphics/chromium/LayerTextureUpdater.h',
+ 'platform/graphics/chromium/ManagedTexture.cpp',
+ 'platform/graphics/chromium/ManagedTexture.h',
'platform/graphics/chromium/MediaPlayerPrivateChromium.h',
- 'platform/graphics/chromium/ScrollbarLayerChromium.cpp',
- 'platform/graphics/chromium/ScrollbarLayerChromium.h',
- 'platform/graphics/chromium/SolidColorLayerChromium.cpp',
- 'platform/graphics/chromium/SolidColorLayerChromium.h',
'platform/graphics/chromium/PlatformCanvas.cpp',
'platform/graphics/chromium/PlatformCanvas.h',
'platform/graphics/chromium/PlatformColor.h',
'platform/graphics/chromium/PlatformIcon.h',
'platform/graphics/chromium/PlatformImage.cpp',
'platform/graphics/chromium/PlatformImage.h',
- 'platform/graphics/chromium/TextureLayerChromium.cpp',
- 'platform/graphics/chromium/TextureLayerChromium.h',
'platform/graphics/chromium/ProgramBinding.cpp',
'platform/graphics/chromium/ProgramBinding.h',
'platform/graphics/chromium/RateLimiter.cpp',
'platform/graphics/chromium/RateLimiter.h',
'platform/graphics/chromium/RenderSurfaceChromium.cpp',
'platform/graphics/chromium/RenderSurfaceChromium.h',
+ 'platform/graphics/chromium/ScrollbarLayerChromium.cpp',
+ 'platform/graphics/chromium/ScrollbarLayerChromium.h',
'platform/graphics/chromium/ShaderChromium.cpp',
'platform/graphics/chromium/ShaderChromium.h',
'platform/graphics/chromium/SimpleFontDataChromiumWin.cpp',
'platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.cpp',
'platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h',
- 'platform/graphics/chromium/TrackingTextureAllocator.cpp',
- 'platform/graphics/chromium/TrackingTextureAllocator.h',
+ 'platform/graphics/chromium/SolidColorLayerChromium.cpp',
+ 'platform/graphics/chromium/SolidColorLayerChromium.h',
'platform/graphics/chromium/TextureCopier.cpp',
'platform/graphics/chromium/TextureCopier.h',
+ 'platform/graphics/chromium/TextureLayerChromium.cpp',
+ 'platform/graphics/chromium/TextureLayerChromium.h',
'platform/graphics/chromium/TextureManager.cpp',
'platform/graphics/chromium/TextureManager.h',
'platform/graphics/chromium/TextureUploader.cpp',
'platform/graphics/chromium/TextureUploader.h',
'platform/graphics/chromium/TiledLayerChromium.cpp',
'platform/graphics/chromium/TiledLayerChromium.h',
+ 'platform/graphics/chromium/TrackingTextureAllocator.cpp',
+ 'platform/graphics/chromium/TrackingTextureAllocator.h',
'platform/graphics/chromium/TransparencyWin.cpp',
'platform/graphics/chromium/TransparencyWin.h',
'platform/graphics/chromium/TreeSynchronizer.cpp',
'platform/graphics/chromium/cc/CCHeadsUpDisplay.h',
'platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.cpp',
'platform/graphics/chromium/cc/CCIOSurfaceDrawQuad.h',
+ 'platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp',
+ 'platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.h',
'platform/graphics/chromium/cc/CCInputHandler.h',
'platform/graphics/chromium/cc/CCKeyframedAnimationCurve.cpp',
'platform/graphics/chromium/cc/CCKeyframedAnimationCurve.h',
--- /dev/null
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "IOSurfaceLayerChromium.h"
+
+#include "cc/CCIOSurfaceLayerImpl.h"
+
+namespace WebCore {
+
+PassRefPtr<IOSurfaceLayerChromium> IOSurfaceLayerChromium::create()
+{
+ return adoptRef(new IOSurfaceLayerChromium());
+}
+
+IOSurfaceLayerChromium::IOSurfaceLayerChromium()
+ : LayerChromium()
+ , m_ioSurfaceId(0)
+{
+}
+
+IOSurfaceLayerChromium::~IOSurfaceLayerChromium()
+{
+}
+
+void IOSurfaceLayerChromium::setIOSurfaceProperties(uint32_t ioSurfaceId, const IntSize& size)
+{
+ m_ioSurfaceId = ioSurfaceId;
+ m_ioSurfaceSize = size;
+ setNeedsCommit();
+}
+
+PassOwnPtr<CCLayerImpl> IOSurfaceLayerChromium::createCCLayerImpl()
+{
+ return CCIOSurfaceLayerImpl::create(m_layerId);
+}
+
+bool IOSurfaceLayerChromium::drawsContent() const
+{
+ return m_ioSurfaceId && LayerChromium::drawsContent();
+}
+
+void IOSurfaceLayerChromium::pushPropertiesTo(CCLayerImpl* layer)
+{
+ LayerChromium::pushPropertiesTo(layer);
+
+ CCIOSurfaceLayerImpl* textureLayer = static_cast<CCIOSurfaceLayerImpl*>(layer);
+ textureLayer->setIOSurfaceProperties(m_ioSurfaceId, m_ioSurfaceSize);
+}
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
--- /dev/null
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef IOSurfaceLayerChromium_h
+#define IOSurfaceLayerChromium_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "LayerChromium.h"
+
+namespace WebCore {
+
+class IOSurfaceLayerChromium : public LayerChromium {
+public:
+ static PassRefPtr<IOSurfaceLayerChromium> create();
+ virtual ~IOSurfaceLayerChromium();
+
+ void setIOSurfaceProperties(uint32_t ioSurfaceId, const IntSize&);
+
+ virtual PassOwnPtr<CCLayerImpl> createCCLayerImpl() OVERRIDE;
+ virtual bool drawsContent() const OVERRIDE;
+ virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE;
+
+protected:
+ IOSurfaceLayerChromium();
+
+private:
+
+ uint32_t m_ioSurfaceId;
+ IntSize m_ioSurfaceSize;
+};
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif
{
ASSERT(CCProxy::isImplThread());
TexTransformTextureProgramBinding binding;
- if (quad->flipped())
- binding.set(textureIOSurfaceProgramFlip());
- else
- binding.set(textureIOSurfaceProgram());
+ binding.set(textureIOSurfaceProgram());
GLC(context(), context()->useProgram(binding.programId));
GLC(context(), context()->uniform1i(binding.samplerLocation, 0));
return m_textureIOSurfaceProgram.get();
}
-const LayerRendererChromium::TextureIOSurfaceProgramFlip* LayerRendererChromium::textureIOSurfaceProgramFlip()
-{
- if (!m_textureIOSurfaceProgramFlip)
- m_textureIOSurfaceProgramFlip = adoptPtr(new TextureIOSurfaceProgramFlip(m_context.get()));
- if (!m_textureIOSurfaceProgramFlip->initialized()) {
- TRACE_EVENT("LayerRendererChromium::textureIOSurfaceProgramFlip::initialize", this, 0);
- m_textureIOSurfaceProgramFlip->initialize(m_context.get());
- }
- return m_textureIOSurfaceProgramFlip.get();
-}
-
const LayerRendererChromium::VideoYUVProgram* LayerRendererChromium::videoYUVProgram()
{
if (!m_videoYUVProgram)
m_textureProgramFlip->cleanup(m_context.get());
if (m_textureIOSurfaceProgram)
m_textureIOSurfaceProgram->cleanup(m_context.get());
- if (m_textureIOSurfaceProgramFlip)
- m_textureIOSurfaceProgramFlip->cleanup(m_context.get());
if (m_videoYUVProgram)
m_videoYUVProgram->cleanup(m_context.get());
// Texture shaders.
typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexAlpha> TextureProgram;
typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexFlipAlpha> TextureProgramFlip;
- typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRectAlpha> TextureIOSurfaceProgram;
- typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRectFlipAlpha> TextureIOSurfaceProgramFlip;
+ typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRectFlipAlpha> TextureIOSurfaceProgram;
// Video shaders.
typedef ProgramBinding<VertexShaderVideoTransform, FragmentShaderOESImageExternal> VideoStreamTextureProgram;
const TextureProgram* textureProgram();
const TextureProgramFlip* textureProgramFlip();
const TextureIOSurfaceProgram* textureIOSurfaceProgram();
- const TextureIOSurfaceProgramFlip* textureIOSurfaceProgramFlip();
const VideoYUVProgram* videoYUVProgram();
const VideoStreamTextureProgram* videoStreamTextureProgram();
OwnPtr<TextureProgram> m_textureProgram;
OwnPtr<TextureProgramFlip> m_textureProgramFlip;
OwnPtr<TextureIOSurfaceProgram> m_textureIOSurfaceProgram;
- OwnPtr<TextureIOSurfaceProgramFlip> m_textureIOSurfaceProgramFlip;
OwnPtr<VideoYUVProgram> m_videoYUVProgram;
OwnPtr<VideoStreamTextureProgram> m_videoStreamTextureProgram;
, m_rateLimitContext(false)
, m_contextLost(false)
, m_textureId(0)
- , m_ioSurfaceId(0)
{
}
setNeedsCommit();
}
-void TextureLayerChromium::setIOSurfaceProperties(int width, int height, uint32_t ioSurfaceId)
-{
- m_ioSurfaceSize = IntSize(width, height);
- m_ioSurfaceId = ioSurfaceId;
- setNeedsCommit();
-}
-
void TextureLayerChromium::setNeedsDisplayRect(const FloatRect& dirtyRect)
{
LayerChromium::setNeedsDisplayRect(dirtyRect);
bool TextureLayerChromium::drawsContent() const
{
- return (m_client || m_textureId || m_ioSurfaceId) && !m_contextLost && LayerChromium::drawsContent();
+ return (m_client || m_textureId) && !m_contextLost && LayerChromium::drawsContent();
}
void TextureLayerChromium::update(CCTextureUpdater& updater, const CCOcclusionTracker*)
textureLayer->setUVRect(m_uvRect);
textureLayer->setPremultipliedAlpha(m_premultipliedAlpha);
textureLayer->setTextureId(m_textureId);
- textureLayer->setIOSurfaceProperties(m_ioSurfaceSize, m_ioSurfaceId);
}
}
// Code path for plugins which supply their own texture ID.
void setTextureId(unsigned);
- // Code path for plugins which render via an IOSurface.
- void setIOSurfaceProperties(int width, int height, uint32_t ioSurfaceId);
-
virtual void setNeedsDisplayRect(const FloatRect&) OVERRIDE;
virtual bool drawsContent() const OVERRIDE;
bool m_contextLost;
unsigned m_textureId;
-
- IntSize m_ioSurfaceSize;
- uint32_t m_ioSurfaceId;
};
}
namespace WebCore {
-PassOwnPtr<CCIOSurfaceDrawQuad> CCIOSurfaceDrawQuad::create(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, bool flipped, const IntSize& ioSurfaceSize, unsigned ioSurfaceTextureId)
+PassOwnPtr<CCIOSurfaceDrawQuad> CCIOSurfaceDrawQuad::create(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, const IntSize& ioSurfaceSize, unsigned ioSurfaceTextureId)
{
- return adoptPtr(new CCIOSurfaceDrawQuad(sharedQuadState, quadRect, flipped, ioSurfaceSize, ioSurfaceTextureId));
+ return adoptPtr(new CCIOSurfaceDrawQuad(sharedQuadState, quadRect, ioSurfaceSize, ioSurfaceTextureId));
}
-CCIOSurfaceDrawQuad::CCIOSurfaceDrawQuad(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, bool flipped, const IntSize& ioSurfaceSize, unsigned ioSurfaceTextureId)
+CCIOSurfaceDrawQuad::CCIOSurfaceDrawQuad(const CCSharedQuadState* sharedQuadState, const IntRect& quadRect, const IntSize& ioSurfaceSize, unsigned ioSurfaceTextureId)
: CCDrawQuad(sharedQuadState, CCDrawQuad::IOSurfaceContent, quadRect)
- , m_flipped(flipped)
, m_ioSurfaceSize(ioSurfaceSize)
, m_ioSurfaceTextureId(ioSurfaceTextureId)
{
class CCIOSurfaceDrawQuad : public CCDrawQuad {
WTF_MAKE_NONCOPYABLE(CCIOSurfaceDrawQuad);
public:
- static PassOwnPtr<CCIOSurfaceDrawQuad> create(const CCSharedQuadState*, const IntRect&, bool flipped, const IntSize& ioSurfaceSize, unsigned ioSurfaceTextureId);
+ static PassOwnPtr<CCIOSurfaceDrawQuad> create(const CCSharedQuadState*, const IntRect&, const IntSize& ioSurfaceSize, unsigned ioSurfaceTextureId);
- bool flipped() const { return m_flipped; }
const IntSize& ioSurfaceSize() const { return m_ioSurfaceSize; }
unsigned ioSurfaceTextureId() const { return m_ioSurfaceTextureId; }
private:
- CCIOSurfaceDrawQuad(const CCSharedQuadState*, const IntRect&, bool flipped, const IntSize& ioSurfaceSize, unsigned ioSurfaceTextureId);
+ CCIOSurfaceDrawQuad(const CCSharedQuadState*, const IntRect&, const IntSize& ioSurfaceSize, unsigned ioSurfaceTextureId);
- bool m_flipped;
IntSize m_ioSurfaceSize;
unsigned m_ioSurfaceTextureId;
};
--- /dev/null
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "cc/CCIOSurfaceLayerImpl.h"
+
+#include "Extensions3DChromium.h"
+#include "GraphicsContext3D.h"
+#include "LayerRendererChromium.h"
+#include "cc/CCIOSurfaceDrawQuad.h"
+#include "cc/CCProxy.h"
+#include "cc/CCQuadCuller.h"
+
+namespace WebCore {
+
+CCIOSurfaceLayerImpl::CCIOSurfaceLayerImpl(int id)
+ : CCLayerImpl(id)
+ , m_ioSurfaceId(0)
+ , m_ioSurfaceChanged(false)
+ , m_ioSurfaceTextureId(0)
+{
+}
+
+CCIOSurfaceLayerImpl::~CCIOSurfaceLayerImpl()
+{
+ // FIXME: it seems there is no layer renderer / GraphicsContext3D available here. Ideally we
+ // would like to delete m_ioSurfaceTextureId.
+ m_ioSurfaceTextureId = 0;
+}
+
+void CCIOSurfaceLayerImpl::willDraw(LayerRendererChromium* layerRenderer)
+{
+ CCLayerImpl::willDraw(layerRenderer);
+
+ if (m_ioSurfaceChanged) {
+ GraphicsContext3D* context = layerRenderer->context();
+ Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context->getExtensions());
+ ASSERT(extensions->supports("GL_CHROMIUM_iosurface"));
+ ASSERT(extensions->supports("GL_ARB_texture_rectangle"));
+
+ if (!m_ioSurfaceTextureId)
+ m_ioSurfaceTextureId = context->createTexture();
+
+ GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE0));
+ GLC(context, context->bindTexture(Extensions3D::TEXTURE_RECTANGLE_ARB, m_ioSurfaceTextureId));
+ GLC(context, context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR));
+ GLC(context, context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR));
+ GLC(context, context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));
+ GLC(context, context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
+ extensions->texImageIOSurface2DCHROMIUM(Extensions3D::TEXTURE_RECTANGLE_ARB,
+ m_ioSurfaceSize.width(),
+ m_ioSurfaceSize.height(),
+ m_ioSurfaceId,
+ 0);
+ // Do not check for error conditions. texImageIOSurface2DCHROMIUM is supposed to hold on to
+ // the last good IOSurface if the new one is already closed. This is only a possibility
+ // during live resizing of plugins. However, it seems that this is not sufficient to
+ // completely guard against garbage being drawn. If this is found to be a significant issue,
+ // it may be necessary to explicitly tell the embedder when to free the surfaces it has
+ // allocated.
+ m_ioSurfaceChanged = false;
+ }
+}
+
+void CCIOSurfaceLayerImpl::appendQuads(CCQuadCuller& quadList, const CCSharedQuadState* sharedQuadState, bool&)
+{
+ IntRect quadRect(IntPoint(), bounds());
+ quadList.append(CCIOSurfaceDrawQuad::create(sharedQuadState, quadRect, m_ioSurfaceSize, m_ioSurfaceTextureId));
+}
+
+void CCIOSurfaceLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const
+{
+ writeIndent(ts, indent);
+ ts << "iosurface id: " << m_ioSurfaceId << " texture id: " << m_ioSurfaceTextureId;
+ CCLayerImpl::dumpLayerProperties(ts, indent);
+}
+
+void CCIOSurfaceLayerImpl::didLoseContext()
+{
+ // We don't have a valid texture ID in the new context; however,
+ // the IOSurface is still valid.
+ m_ioSurfaceTextureId = 0;
+ m_ioSurfaceChanged = true;
+}
+
+void CCIOSurfaceLayerImpl::setIOSurfaceProperties(unsigned ioSurfaceId, const IntSize& size)
+{
+ if (m_ioSurfaceId != ioSurfaceId)
+ m_ioSurfaceChanged = true;
+
+ m_ioSurfaceId = ioSurfaceId;
+ m_ioSurfaceSize = size;
+}
+}
+
+#endif // USE(ACCELERATED_COMPOSITING)
--- /dev/null
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CCIOSurfaceLayerImpl_h
+#define CCIOSurfaceLayerImpl_h
+
+#include "IntSize.h"
+#include "cc/CCLayerImpl.h"
+
+namespace WebCore {
+
+class CCIOSurfaceLayerImpl : public CCLayerImpl {
+public:
+ static PassOwnPtr<CCIOSurfaceLayerImpl> create(int id)
+ {
+ return adoptPtr(new CCIOSurfaceLayerImpl(id));
+ }
+ virtual ~CCIOSurfaceLayerImpl();
+
+ void setIOSurfaceProperties(unsigned ioSurfaceId, const IntSize&);
+
+ virtual void appendQuads(CCQuadCuller&, const CCSharedQuadState*, bool& hadMissingTiles) OVERRIDE;
+
+ virtual void willDraw(LayerRendererChromium*) OVERRIDE;
+ virtual void didLoseContext() OVERRIDE;
+
+ virtual void dumpLayerProperties(TextStream&, int indent) const OVERRIDE;
+
+private:
+ explicit CCIOSurfaceLayerImpl(int);
+
+ virtual const char* layerTypeAsString() const OVERRIDE { return "IOSurfaceLayer"; }
+
+ unsigned m_ioSurfaceId;
+ IntSize m_ioSurfaceSize;
+ bool m_ioSurfaceChanged;
+ unsigned m_ioSurfaceTextureId;
+};
+
+}
+
+#endif // CCIOSurfaceLayerImpl_h
, m_premultipliedAlpha(true)
, m_flipped(true)
, m_uvRect(0, 0, 1, 1)
- , m_ioSurfaceId(0)
- , m_ioSurfaceChanged(false)
- , m_ioSurfaceTextureId(0)
{
}
CCTextureLayerImpl::~CCTextureLayerImpl()
{
- // FIXME: it seems there is no layer renderer / GraphicsContext3D available here. Ideally we
- // would like to delete m_ioSurfaceTextureId.
- m_ioSurfaceTextureId = 0;
-}
-
-void CCTextureLayerImpl::willDraw(LayerRendererChromium* layerRenderer)
-{
- CCLayerImpl::willDraw(layerRenderer);
-
- if (m_ioSurfaceChanged) {
- GraphicsContext3D* context = layerRenderer->context();
- Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context->getExtensions());
- ASSERT(extensions->supports("GL_CHROMIUM_iosurface"));
- ASSERT(extensions->supports("GL_ARB_texture_rectangle"));
-
- if (!m_ioSurfaceTextureId)
- m_ioSurfaceTextureId = context->createTexture();
-
- GLC(context, context->activeTexture(GraphicsContext3D::TEXTURE0));
- GLC(context, context->bindTexture(Extensions3D::TEXTURE_RECTANGLE_ARB, m_ioSurfaceTextureId));
- GLC(context, context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR));
- GLC(context, context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR));
- GLC(context, context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE));
- GLC(context, context->texParameteri(Extensions3D::TEXTURE_RECTANGLE_ARB, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE));
- extensions->texImageIOSurface2DCHROMIUM(Extensions3D::TEXTURE_RECTANGLE_ARB,
- m_ioSurfaceSize.width(),
- m_ioSurfaceSize.height(),
- m_ioSurfaceId,
- 0);
- // Do not check for error conditions. texImageIOSurface2DCHROMIUM is supposed to hold on to
- // the last good IOSurface if the new one is already closed. This is only a possibility
- // during live resizing of plugins. However, it seems that this is not sufficient to
- // completely guard against garbage being drawn. If this is found to be a significant issue,
- // it may be necessary to explicitly tell the embedder when to free the surfaces it has
- // allocated.
- m_ioSurfaceChanged = false;
- }
}
void CCTextureLayerImpl::appendQuads(CCQuadCuller& quadList, const CCSharedQuadState* sharedQuadState, bool&)
{
IntRect quadRect(IntPoint(), bounds());
- if (m_textureId)
- quadList.append(CCTextureDrawQuad::create(sharedQuadState, quadRect, m_textureId, m_premultipliedAlpha, m_uvRect, m_flipped));
- else if (m_ioSurfaceTextureId)
- quadList.append(CCIOSurfaceDrawQuad::create(sharedQuadState, quadRect, m_flipped, m_ioSurfaceSize, m_ioSurfaceTextureId));
+ quadList.append(CCTextureDrawQuad::create(sharedQuadState, quadRect, m_textureId, m_premultipliedAlpha, m_uvRect, m_flipped));
}
void CCTextureLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const
void CCTextureLayerImpl::didLoseContext()
{
m_textureId = 0;
- if (m_ioSurfaceId) {
- // We don't have a valid texture ID in the new context; however,
- // the IOSurface is still valid.
- m_ioSurfaceTextureId = 0;
- m_ioSurfaceChanged = true;
- }
}
-void CCTextureLayerImpl::setIOSurfaceProperties(const IntSize& size, unsigned ioSurfaceId)
-{
- if (m_ioSurfaceId != ioSurfaceId)
- m_ioSurfaceChanged = true;
-
- m_ioSurfaceSize = size;
- m_ioSurfaceId = ioSurfaceId;
-}
}
#endif // USE(ACCELERATED_COMPOSITING)
virtual void appendQuads(CCQuadCuller&, const CCSharedQuadState*, bool& hadMissingTiles) OVERRIDE;
- virtual void willDraw(LayerRendererChromium*) OVERRIDE;
virtual void didLoseContext() OVERRIDE;
virtual void dumpLayerProperties(TextStream&, int indent) const OVERRIDE;
void setPremultipliedAlpha(bool premultipliedAlpha) { m_premultipliedAlpha = premultipliedAlpha; }
void setFlipped(bool flipped) { m_flipped = flipped; }
void setUVRect(const FloatRect& rect) { m_uvRect = rect; }
- void setIOSurfaceProperties(const IntSize&, unsigned ioSurfaceId);
-
private:
explicit CCTextureLayerImpl(int);
bool m_premultipliedAlpha;
bool m_flipped;
FloatRect m_uvRect;
-
- // Internals for IOSurface-backed textures.
- unsigned m_ioSurfaceId;
- IntSize m_ioSurfaceSize;
- bool m_ioSurfaceChanged;
- unsigned m_ioSurfaceTextureId;
};
}
+2012-04-26 James Robinson <jamesr@chromium.org>
+
+ [chromium] Separate IOSurface layer type from texture layers
+ https://bugs.webkit.org/show_bug.cgi?id=85030
+
+ Reviewed by Adrienne Walker.
+
+ Update WebPluginContainerImpl to support having either a texture or IOSurface layer (but never both) depending
+ on the plugin's contents.
+
+ * WebKit.gyp:
+ * src/WebExternalTextureLayer.cpp:
+ * src/WebIOSurfaceLayer.cpp:
+ (WebKit):
+ (WebKit::WebIOSurfaceLayer::create):
+ (WebKit::WebIOSurfaceLayer::setIOSurfaceProperties):
+ (WebKit::WebIOSurfaceLayer::WebIOSurfaceLayer):
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::setBackingTextureId):
+ (WebKit::WebPluginContainerImpl::setBackingIOSurfaceId):
+ (WebKit::WebPluginContainerImpl::commitBackingTexture):
+ (WebKit::WebPluginContainerImpl::setOpaque):
+ (WebKit::WebPluginContainerImpl::platformLayer):
+ (WebKit::WebPluginContainerImpl::WebPluginContainerImpl):
+ * src/WebPluginContainerImpl.h:
+ (WebPluginContainerImpl):
+
2012-04-27 Hans Wennborg <hans@chromium.org>
Speech JavaScript API: Fix Vector use failure
'src/WebIDBTransactionImpl.h',
'src/WebIDBTransactionCallbacksImpl.cpp',
'src/WebIDBTransactionCallbacksImpl.h',
+ 'src/WebIOSurfaceLayer.cpp',
'src/WebImageCG.cpp',
'src/WebImageDecoder.cpp',
'src/WebImageSkia.cpp',
unwrap<TextureLayerChromium>()->setTextureId(id);
}
-void WebExternalTextureLayer::setIOSurfaceProperties(const WebSize& size, unsigned ioSurfaceId)
-{
- unwrap<TextureLayerChromium>()->setIOSurfaceProperties(size.width, size.height, ioSurfaceId);
-}
-
void WebExternalTextureLayer::setFlipped(bool flipped)
{
unwrap<TextureLayerChromium>()->setFlipped(flipped);
--- /dev/null
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include <public/WebIOSurfaceLayer.h>
+
+#include "IOSurfaceLayerChromium.h"
+#include <public/WebSize.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebIOSurfaceLayer WebIOSurfaceLayer::create()
+{
+ RefPtr<IOSurfaceLayerChromium> layer = IOSurfaceLayerChromium::create();
+ layer->setIsDrawable(true);
+ return WebIOSurfaceLayer(layer.release());
+}
+
+void WebIOSurfaceLayer::setIOSurfaceProperties(unsigned ioSurfaceId, WebSize size)
+{
+ unwrap<IOSurfaceLayerChromium>()->setIOSurfaceProperties(ioSurfaceId, size);
+}
+
+WebIOSurfaceLayer::WebIOSurfaceLayer(PassRefPtr<IOSurfaceLayerChromium> layer)
+ : WebLayer(layer)
+{
+}
+
+} // namespace WebKit
if (m_textureId == textureId)
return;
- m_layer.setTextureId(textureId);
+ ASSERT(m_ioSurfaceLayer.isNull());
+
+ if (m_textureLayer.isNull())
+ m_textureLayer = WebExternalTextureLayer::create();
+ m_textureLayer.setTextureId(textureId);
// If anyone of the IDs is zero we need to switch between hardware
// and software compositing. This is done by triggering a style recalc
int height,
uint32_t ioSurfaceId)
{
-#if OS(DARWIN) && USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING)
if (ioSurfaceId == m_ioSurfaceId)
return;
- m_layer.setIOSurfaceProperties(WebSize(width, height), ioSurfaceId);
+ ASSERT(m_textureLayer.isNull());
+
+ if (m_ioSurfaceLayer.isNull())
+ m_ioSurfaceLayer = WebIOSurfaceLayer::create();
+ m_ioSurfaceLayer.setIOSurfaceProperties(ioSurfaceId, WebSize(width, height));
// If anyone of the IDs is zero we need to switch between hardware
// and software compositing. This is done by triggering a style recalc
void WebPluginContainerImpl::commitBackingTexture()
{
#if USE(ACCELERATED_COMPOSITING)
- if (!m_layer.isNull())
- m_layer.invalidate();
+ if (!m_textureLayer.isNull())
+ m_textureLayer.invalidate();
+
+ if (!m_ioSurfaceLayer.isNull())
+ m_ioSurfaceLayer.invalidate();
#endif
}
void WebPluginContainerImpl::setOpaque(bool opaque)
{
#if USE(ACCELERATED_COMPOSITING)
- if (!m_layer.isNull())
- m_layer.setOpaque(opaque);
+ if (!m_textureLayer.isNull())
+ m_textureLayer.setOpaque(opaque);
+
+ if (!m_ioSurfaceLayer.isNull())
+ m_ioSurfaceLayer.setOpaque(opaque);
#endif
}
#if USE(ACCELERATED_COMPOSITING)
WebCore::LayerChromium* WebPluginContainerImpl::platformLayer() const
{
- return (m_textureId || m_ioSurfaceId) ? m_layer.unwrap<LayerChromium>() : 0;
+ if (m_textureId)
+ return m_textureLayer.unwrap<LayerChromium>();
+ if (m_ioSurfaceId)
+ return m_ioSurfaceLayer.unwrap<LayerChromium>();
+ return 0;
}
#endif
, m_element(element)
, m_webPlugin(webPlugin)
#if USE(ACCELERATED_COMPOSITING)
- , m_layer(WebExternalTextureLayer::create())
, m_textureId(0)
, m_ioSurfaceId(0)
#endif
#include "Widget.h"
#include <public/WebExternalTextureLayer.h>
+#include <public/WebIOSurfaceLayer.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/Vector.h>
Vector<WebPluginLoadObserver*> m_pluginLoadObservers;
#if USE(ACCELERATED_COMPOSITING)
- WebExternalTextureLayer m_layer;
+ // A composited plugin will either have no composited layer, a texture layer, or an IOSurface layer.
+ // It will never have both a texture and IOSurface output.
unsigned m_textureId;
+ WebExternalTextureLayer m_textureLayer;
+
unsigned m_ioSurfaceId;
+ WebIOSurfaceLayer m_ioSurfaceLayer;
#endif
// The associated scrollbar group object, created lazily. Used for Pepper