+2012-08-27 James Robinson <jamesr@chromium.org>
+
+ [chromium] Add CompositorSupport interface for constructing compositor classes
+ https://bugs.webkit.org/show_bug.cgi?id=95040
+
+ Reviewed by Darin Fisher.
+
+ Adds a WebCompositorSupport interface as a tear-off of PlatformSupport so the embedder can handle provide
+ implementations of compositor interfaces.
+
+ Adds a new WebPassOwnPtr<> type for use when the caller of an API must take ownership of the provided parameter.
+
+ * Platform.gypi:
+ * chromium/public/Platform.h:
+ (WebKit):
+ (WebKit::Platform::compositorSupport):
+ (Platform):
+ * chromium/public/WebCompositorSupport.h: Added.
+ (WebKit):
+ (WebCompositorSupport):
+ (WebKit::WebCompositorSupport::~WebCompositorSupport):
+
2012-08-30 Tommy Widenflycht <tommyw@google.com>
MediaStream API: Introduce MediaConstraints
'chromium/public/WebClipboard.h',
'chromium/public/WebColor.h',
'chromium/public/WebCommon.h',
+ 'chromium/public/WebCompositor.h',
+ 'chromium/public/WebCompositorSurface.h',
'chromium/public/WebCompositorOutputSurface.h',
'chromium/public/WebCompositorOutputSurfaceClient.h',
'chromium/public/WebContentLayer.h',
'chromium/public/WebMessagePortChannelClient.h',
'chromium/public/WebMimeRegistry.h',
'chromium/public/WebNonCopyable.h',
+ 'chromium/public/WebPassOwnPtr.h',
'chromium/public/WebPeerConnection00Handler.h',
'chromium/public/WebPeerConnection00HandlerClient.h',
'chromium/public/WebPeerConnectionHandler.h',
class WebAudioBus;
class WebBlobRegistry;
class WebClipboard;
+class WebCompositorSupport;
class WebCookieJar;
class WebFileSystem;
class WebFileUtilities;
// This value must be checked again after a context loss event as the platform's capabilities may have changed.
virtual bool canAccelerate2dCanvas() { return false; }
+ virtual WebCompositorSupport* compositorSupport() { return 0; }
+
virtual WebFlingAnimator* createFlingAnimator() { return 0; }
// WebRTC ----------------------------------------------------------
--- /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 WebCompositorSupport_h
+#define WebCompositorSupport_h
+
+#include "WebAnimation.h"
+#include "WebCommon.h"
+#include "WebContentLayer.h"
+#include "WebExternalTextureLayer.h"
+#include "WebFloatAnimationCurve.h"
+#include "WebIOSurfaceLayer.h"
+#include "WebImageLayer.h"
+#include "WebLayer.h"
+#include "WebLayerTreeView.h"
+#include "WebPassOwnPtr.h"
+#include "WebScrollbar.h"
+#include "WebScrollbarLayer.h"
+#include "WebScrollbarThemeGeometry.h"
+#include "WebScrollbarThemePainter.h"
+#include "WebSolidColorLayer.h"
+#include "WebTransformAnimationCurve.h"
+#include "WebVideoLayer.h"
+
+namespace WebKit {
+
+class WebContentLayerClient;
+class WebExternalTextureLayerClient;
+class WebVideoFrameProvider;
+
+class WebCompositorSupport {
+public:
+ // May return 0 if initialization fails.
+ virtual WebPassOwnPtr<WebLayerTreeView> createLayerTreeView(WebLayerTreeViewClient*, const WebLayer& root, const WebLayerTreeView::Settings&) { return WebPassOwnPtr<WebLayerTreeView>(); }
+
+
+ // Layers -------------------------------------------------------
+
+ virtual WebPassOwnPtr<WebLayer> createLayer() { return WebPassOwnPtr<WebLayer>(); }
+
+ virtual WebPassOwnPtr<WebContentLayer> createContentLayer(WebContentLayerClient*) { return WebPassOwnPtr<WebContentLayer>(); }
+
+ virtual WebPassOwnPtr<WebExternalTextureLayer> createExternalTextureLayer(WebExternalTextureLayerClient* = 0) { return WebPassOwnPtr<WebExternalTextureLayer>(); }
+
+ virtual WebPassOwnPtr<WebIOSurfaceLayer> createIOSurfaceLayer() { return WebPassOwnPtr<WebIOSurfaceLayer>(); }
+
+ virtual WebPassOwnPtr<WebImageLayer> createImageLayer() { return WebPassOwnPtr<WebImageLayer>(); }
+
+ virtual WebPassOwnPtr<WebSolidColorLayer> createSolidColorLayer() { return WebPassOwnPtr<WebSolidColorLayer>(); }
+
+ virtual WebPassOwnPtr<WebVideoLayer> createVideoLayer(WebVideoFrameProvider*) { return WebPassOwnPtr<WebVideoLayer>(); }
+
+ virtual WebPassOwnPtr<WebScrollbarLayer> createScrollbarLayer(WebPassOwnPtr<WebScrollbar>, WebScrollbarThemePainter, WebPassOwnPtr<WebScrollbarThemeGeometry>) { return WebPassOwnPtr<WebScrollbarLayer>(); }
+
+
+ // Animation ----------------------------------------------------
+
+ virtual WebPassOwnPtr<WebAnimation> createAnimation(const WebAnimationCurve&, WebAnimation::TargetProperty, int animationId = 0) { return WebPassOwnPtr<WebAnimation>(); }
+
+ virtual WebPassOwnPtr<WebFloatAnimationCurve> createFloatAnimationCurve() { return WebPassOwnPtr<WebFloatAnimationCurve>(); }
+
+ virtual WebPassOwnPtr<WebTransformAnimationCurve> createTransformAnimationCurve() { return WebPassOwnPtr<WebTransformAnimationCurve>(); }
+
+private:
+ virtual ~WebCompositorSupport() { }
+};
+
+}
+
+#endif // WebCompositorSupport_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.
+ */
+
+#ifndef WebPassOwnPtr_h
+#define WebPassOwnPtr_h
+
+#include "WebCommon.h"
+
+#if WEBKIT_IMPLEMENTATION
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#else
+#include "base/memory/scoped_ptr.h"
+#endif
+
+namespace WebKit {
+
+// Use a return value of type WebPassOwnPtr<T> when the caller takes ownership of the returned value, for instance
+// in a createFoo() factory function. Example:
+//
+// To implement the class WebPassOwnPtr<Foo> createFoo() in chromium code, write:
+//
+// WebPassOwnPtr<Foo> createFoo() {
+// scoped_ptr<Foo> foo = ...;
+// return foo.Pass();
+// }
+//
+// To use on the WebKit side:
+//
+// OwnPtr<Foo> foo = ...->createFoo();
+//
+// To implement WebPassOwnPtr<Foo> createFoo() in WebKit and use it from chromium, write:
+//
+// WebPassOwnPtr<Foo> createFoo()
+// {
+// OwnPtr<Foo> foo = ...;
+// return foo.release();
+// }
+//
+// and
+//
+// scoped_ptr<Foo> = ...->createFoo();
+
+template <typename T>
+class WebPassOwnPtr : public WebNonCopyable {
+public:
+ WebPassOwnPtr()
+ : m_ptr(0)
+ {
+ }
+
+ ~WebPassOwnPtr()
+ {
+ WEBKIT_ASSERT(!m_ptr);
+ }
+
+
+#if WEBKIT_IMPLEMENTATION
+ WebPassOwnPtr(PassOwnPtr<T> ptr)
+ : m_ptr(ptr.leakPtr())
+ {
+ }
+
+ operator PassOwnPtr<T>()
+ {
+ OwnPtr<T> ret = adoptPtr(m_ptr);
+ m_ptr = 0;
+ return ret.release();
+ }
+#else
+ WebPassOwnPtr(scoped_ptr<T> ptr)
+ : m_ptr(ptr.release())
+ {
+ }
+
+ operator scoped_ptr<T>()
+ {
+ scoped_ptr<T> ret(m_ptr);
+ m_ptr = 0;
+ return ret.Pass();
+ }
+#endif
+
+private:
+ T* m_ptr;
+
+ // This constructor has to be declared but not defined to trigger move emulation.
+ WebPassOwnPtr(WebPassOwnPtr&);
+};
+
+}
+
+#endif // WebPassOwnPtr_h
+2012-08-27 James Robinson <jamesr@chromium.org>
+
+ [chromium] Add CompositorSupport interface for constructing compositor classes
+ https://bugs.webkit.org/show_bug.cgi?id=95040
+
+ Reviewed by Darin Fisher.
+
+ Uses WebCompositorSupport interfaces where appropriate to construct compositor types.
+
+ * platform/graphics/chromium/AnimationTranslationUtil.cpp:
+ (WebCore::createWebAnimation):
+ * platform/graphics/chromium/Canvas2DLayerBridge.cpp:
+ (WebCore::Canvas2DLayerBridge::Canvas2DLayerBridge):
+ * platform/graphics/chromium/DrawingBufferChromium.cpp:
+ (WebCore::DrawingBufferPrivate::DrawingBufferPrivate):
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
+ (WebCore::GraphicsLayerChromium::setContentsToImage):
+ (WebCore::GraphicsLayerChromium::setContentsTo):
+ (WebCore::GraphicsLayerChromium::addAnimation):
+ (WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
+
2012-08-30 Dan Bernstein <mitz@apple.com>
[CG] ImageCG.cpp contains a mix of Image and BitmapImage functions
#include "TransformOperations.h"
#include "TranslateTransformOperation.h"
+#include <public/Platform.h>
#include <public/WebAnimation.h>
#include <public/WebAnimationCurve.h>
+#include <public/WebCompositorSupport.h>
#include <public/WebFloatAnimationCurve.h>
#include <public/WebTransformAnimationCurve.h>
#include <public/WebTransformOperations.h>
}
template <class Value, class Keyframe, class Curve>
-PassOwnPtr<WebKit::WebAnimation> createWebAnimation(const KeyframeValueList& valueList, const Animation* animation, int animationId, double timeOffset, WebKit::WebAnimation::TargetProperty targetProperty, const FloatSize& boxSize)
+PassOwnPtr<WebKit::WebAnimation> createWebAnimation(const KeyframeValueList& valueList, const Animation* animation, int animationId, double timeOffset, Curve* curve, WebKit::WebAnimation::TargetProperty targetProperty, const FloatSize& boxSize)
{
bool alternate = false;
bool reverse = false;
reverse = true;
}
- OwnPtr<Curve> curve = adoptPtr(Curve::create());
-
for (size_t i = 0; i < valueList.size(); i++) {
size_t index = reverse ? valueList.size() - i - 1 : i;
const Value* originalValue = static_cast<const Value*>(valueList.at(index));
bool addedKeyframe = false;
if (isUsingCustomBezierTimingFunction)
- addedKeyframe = appendKeyframeWithCustomBezierTimingFunction<Value, Keyframe, Curve>(curve.get(), keyTime, originalValue, lastOriginalValue, x1, y1, x2, y2, boxSize);
+ addedKeyframe = appendKeyframeWithCustomBezierTimingFunction<Value, Keyframe, Curve>(curve, keyTime, originalValue, lastOriginalValue, x1, y1, x2, y2, boxSize);
else
- addedKeyframe = appendKeyframeWithStandardTimingFunction<Value, Keyframe, Curve>(curve.get(), keyTime, originalValue, lastOriginalValue, timingFunctionType, boxSize);
+ addedKeyframe = appendKeyframeWithStandardTimingFunction<Value, Keyframe, Curve>(curve, keyTime, originalValue, lastOriginalValue, timingFunctionType, boxSize);
if (!addedKeyframe)
return nullptr;
}
- OwnPtr<WebKit::WebAnimation> anim(adoptPtr(WebKit::WebAnimation::create(*curve, targetProperty, animationId)));
+ OwnPtr<WebKit::WebAnimation> webAnimation;
+ if (WebCompositorSupport* compositorSupport = WebKit::Platform::current()->compositorSupport())
+ webAnimation = compositorSupport->createAnimation(*curve, targetProperty, animationId);
+ else
+ webAnimation = adoptPtr(WebKit::WebAnimation::create(*curve, targetProperty, animationId));
int iterations = (animation && animation->isIterationCountSet()) ? animation->iterationCount() : 1;
- anim->setIterations(iterations);
- anim->setAlternatesDirection(alternate);
+ webAnimation->setIterations(iterations);
+ webAnimation->setAlternatesDirection(alternate);
// If timeOffset > 0, then the animation has started in the past.
- anim->setTimeOffset(timeOffset);
+ webAnimation->setTimeOffset(timeOffset);
- return anim.release();
+ return webAnimation.release();
}
PassOwnPtr<WebKit::WebAnimation> createWebAnimation(const KeyframeValueList& values, const Animation* animation, int animationId, double timeOffset, const FloatSize& boxSize)
{
- if (values.property() == AnimatedPropertyWebkitTransform)
- return createWebAnimation<TransformAnimationValue, WebTransformKeyframe, WebTransformAnimationCurve>(values, animation, animationId, timeOffset, WebKit::WebAnimation::TargetPropertyTransform, FloatSize(boxSize));
- if (values.property() == AnimatedPropertyOpacity)
- return createWebAnimation<FloatAnimationValue, WebFloatKeyframe, WebFloatAnimationCurve>(values, animation, animationId, timeOffset, WebKit::WebAnimation::TargetPropertyOpacity, FloatSize());
+
+ if (values.property() == AnimatedPropertyWebkitTransform) {
+ OwnPtr<WebTransformAnimationCurve> curve;
+ if (WebCompositorSupport* compositorSupport = WebKit::Platform::current()->compositorSupport())
+ curve = compositorSupport->createTransformAnimationCurve();
+ else
+ curve = adoptPtr(WebTransformAnimationCurve::create());
+ return createWebAnimation<TransformAnimationValue, WebTransformKeyframe, WebTransformAnimationCurve>(values, animation, animationId, timeOffset, curve.get(), WebKit::WebAnimation::TargetPropertyTransform, FloatSize(boxSize));
+ }
+
+ if (values.property() == AnimatedPropertyOpacity) {
+ OwnPtr<WebFloatAnimationCurve> curve;
+ if (WebCompositorSupport* compositorSupport = WebKit::Platform::current()->compositorSupport())
+ curve = compositorSupport->createFloatAnimationCurve();
+ else
+ curve = adoptPtr(WebFloatAnimationCurve::create());
+ return createWebAnimation<FloatAnimationValue, WebFloatKeyframe, WebFloatAnimationCurve>(values, animation, animationId, timeOffset, curve.get(), WebKit::WebAnimation::TargetPropertyOpacity, FloatSize());
+ }
return nullptr;
}
#include "GraphicsContext3DPrivate.h"
#include "GraphicsLayerChromium.h"
#include "TraceEvent.h"
+#include <public/Platform.h>
#include <public/WebCompositor.h>
+#include <public/WebCompositorSupport.h>
#include <public/WebGraphicsContext3D.h>
using WebKit::WebExternalTextureLayer;
grContext->resetContext();
}
- m_layer = adoptPtr(WebExternalTextureLayer::create(this));
+ if (WebKit::WebCompositorSupport* compositorSupport = WebKit::Platform::current()->compositorSupport())
+ m_layer = compositorSupport->createExternalTextureLayer(this);
+ else
+ m_layer = adoptPtr(WebKit::WebExternalTextureLayer::create(this));
+
m_layer->setTextureId(textureId);
m_layer->setRateLimitContext(!WebKit::WebCompositor::threadingEnabled() || m_useDoubleBuffering);
GraphicsLayerChromium::registerContentsLayer(m_layer->layer());
#include "GraphicsContext3DPrivate.h"
#include "GraphicsLayerChromium.h"
#include <algorithm>
+#include <public/Platform.h>
#include <public/WebCompositor.h>
+#include <public/WebCompositorSupport.h>
#include <public/WebExternalTextureLayer.h>
#include <public/WebExternalTextureLayerClient.h>
#include <public/WebGraphicsContext3D.h>
public:
explicit DrawingBufferPrivate(DrawingBuffer* drawingBuffer)
: m_drawingBuffer(drawingBuffer)
- , m_layer(adoptPtr(WebKit::WebExternalTextureLayer::create(this)))
{
+ if (WebKit::WebCompositorSupport* compositorSupport = WebKit::Platform::current()->compositorSupport())
+ m_layer = compositorSupport->createExternalTextureLayer(this);
+ else
+ m_layer = adoptPtr(WebKit::WebExternalTextureLayer::create(this));
+
GraphicsContext3D::Attributes attributes = m_drawingBuffer->graphicsContext3D()->getContextAttributes();
m_layer->setOpaque(!attributes.alpha);
m_layer->setPremultipliedAlpha(attributes.premultipliedAlpha);
#include "PlatformString.h"
#include "SkMatrix44.h"
#include "SystemTime.h"
+#include <public/Platform.h>
#include <public/WebAnimation.h>
+#include <public/WebCompositorSupport.h>
#include <public/WebFilterOperation.h>
#include <public/WebFilterOperations.h>
#include <public/WebFloatPoint.h>
, m_pageScaleChanged(false)
{
m_opaqueRectTrackingContentLayerDelegate = adoptPtr(new OpaqueRectTrackingContentLayerDelegate(this));
- m_layer = adoptPtr(WebContentLayer::create(m_opaqueRectTrackingContentLayerDelegate.get()));
+
+ if (WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport())
+ m_layer = compositorSupport->createContentLayer(m_opaqueRectTrackingContentLayerDelegate.get());
+ else
+ m_layer = adoptPtr(WebContentLayer::create(m_opaqueRectTrackingContentLayerDelegate.get()));
+
m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
if (client)
deviceOrPageScaleFactorChanged();
bool childrenChanged = false;
if (image) {
if (m_contentsLayerPurpose != ContentsLayerForImage) {
- m_imageLayer = adoptPtr(WebImageLayer::create());
+ if (WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport())
+ m_imageLayer = compositorSupport->createImageLayer();
+ else
+ m_imageLayer = adoptPtr(WebImageLayer::create());
registerContentsLayer(m_imageLayer->layer());
+
setupContentsLayer(m_imageLayer->layer());
m_contentsLayerPurpose = ContentsLayerForImage;
childrenChanged = true;
setContentsTo(ContentsLayerForVideo, layer);
}
-void GraphicsLayerChromium::setContentsTo(ContentsLayerPurpose purpose, WebKit::WebLayer* layer)
+void GraphicsLayerChromium::setContentsTo(ContentsLayerPurpose purpose, WebLayer* layer)
{
bool childrenChanged = false;
if (layer) {
if (m_animationIdMap.contains(animationName))
animationId = m_animationIdMap.get(animationName);
- OwnPtr<WebKit::WebAnimation> toAdd(createWebAnimation(values, animation, animationId, timeOffset, boxSize));
+ OwnPtr<WebAnimation> toAdd(createWebAnimation(values, animation, animationId, timeOffset, boxSize));
if (toAdd) {
animationId = toAdd->id();
void GraphicsLayerChromium::updateLayerPreserves3D()
{
if (m_preserves3D && !m_transformLayer) {
- // Create the transform layer.
- m_transformLayer = adoptPtr(WebLayer::create());
+ if (WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport())
+ m_transformLayer = compositorSupport->createLayer();
+ else
+ m_transformLayer = adoptPtr(WebLayer::create());
+
m_transformLayer->setPreserves3D(true);
m_transformLayer->setAnimationDelegate(this);
m_layer->layer()->transferAnimationsTo(m_transformLayer.get());
+2012-08-27 James Robinson <jamesr@chromium.org>
+
+ [chromium] Add CompositorSupport interface for constructing compositor classes
+ https://bugs.webkit.org/show_bug.cgi?id=95040
+
+ Reviewed by Darin Fisher.
+
+ * src/LinkHighlight.cpp:
+ (WebKit::LinkHighlight::LinkHighlight):
+ (WebKit::LinkHighlight::startHighlightAnimation):
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit::WebMediaPlayerClientImpl::readyStateChanged):
+ * src/WebMediaPlayerClientImpl.h:
+ (WebKit):
+ * src/WebPluginContainerImpl.cpp:
+ (WebKit::WebPluginContainerImpl::setBackingTextureId):
+ (WebKit::WebPluginContainerImpl::setBackingIOSurfaceId):
+ * src/WebPluginContainerImpl.h:
+ (WebKit):
+
2012-08-30 Gavin Peters <gavinp@chromium.org>
[chromium] Disable CCLayerTreeHostTestScrollMultipleRedraw.runMultiThread
#include "WebFrameImpl.h"
#include "WebKit.h"
#include "WebViewImpl.h"
+#include <public/Platform.h>
#include <public/WebAnimationCurve.h>
+#include <public/WebCompositorSupport.h>
#include <public/WebFloatAnimationCurve.h>
#include <public/WebFloatPoint.h>
#include <public/WebRect.h>
}
LinkHighlight::LinkHighlight(Node* node, WebViewImpl* owningWebViewImpl)
- : m_contentLayer(adoptPtr(WebContentLayer::create(this)))
- , m_clipLayer(adoptPtr(WebLayer::create()))
- , m_node(node)
+ : m_node(node)
, m_owningWebViewImpl(owningWebViewImpl)
, m_currentGraphicsLayer(0)
, m_geometryNeedsUpdate(false)
{
ASSERT(m_node);
ASSERT(owningWebViewImpl);
-
+ if (WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport()) {
+ m_contentLayer = compositorSupport->createContentLayer(this);
+ m_clipLayer = compositorSupport->createLayer();
+ } else {
+ m_contentLayer = adoptPtr(WebContentLayer::create(this));
+ m_clipLayer = adoptPtr(WebLayer::create());
+ }
m_clipLayer->setAnchorPoint(WebFloatPoint());
m_clipLayer->addChild(m_contentLayer->layer());
m_contentLayer->layer()->setDrawsContent(false);
m_contentLayer->layer()->setOpacity(startOpacity);
- OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create());
+ WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport();
+
+ OwnPtr<WebFloatAnimationCurve> curve;
+ if (compositorSupport)
+ curve = compositorSupport->createFloatAnimationCurve();
+ else
+ curve = adoptPtr(WebFloatAnimationCurve::create());
+
curve->add(WebFloatKeyframe(0, startOpacity));
curve->add(WebFloatKeyframe(duration / 2, startOpacity));
// For layout tests we don't fade out.
curve->add(WebFloatKeyframe(duration, WebKit::layoutTestMode() ? startOpacity : 0));
- m_animation = adoptPtr(WebAnimation::create(*curve, WebAnimation::TargetPropertyOpacity));
+ if (compositorSupport)
+ m_animation = compositorSupport->createAnimation(*curve, WebAnimation::TargetPropertyOpacity);
+ else
+ m_animation = adoptPtr(WebAnimation::create(*curve, WebAnimation::TargetPropertyOpacity));
+
m_contentLayer->layer()->setDrawsContent(true);
m_contentLayer->layer()->addAnimation(m_animation.get());
#include <public/Platform.h>
#include <public/WebCString.h>
#include <public/WebCanvas.h>
+#include <public/WebCompositorSupport.h>
#include <public/WebMimeRegistry.h>
#include <public/WebRect.h>
#include <public/WebSize.h>
#include <public/WebString.h>
#include <public/WebURL.h>
+#include <public/WebVideoLayer.h>
#if USE(ACCELERATED_COMPOSITING)
#include "RenderLayerCompositor.h"
m_mediaPlayer->readyStateChanged();
#if USE(ACCELERATED_COMPOSITING)
if (hasVideo() && supportsAcceleratedRendering() && !m_videoLayer) {
- m_videoLayer = adoptPtr(WebVideoLayer::create(this));
+ if (WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport())
+ m_videoLayer = compositorSupport->createVideoLayer(this);
+ else
+ m_videoLayer = adoptPtr(WebVideoLayer::create(this));
+
m_videoLayer->layer()->setOpaque(m_opaque);
GraphicsLayerChromium::registerContentsLayer(m_videoLayer->layer());
}
#include "WebMediaPlayerClient.h"
#include "WebStreamTextureClient.h"
#include <public/WebVideoFrameProvider.h>
-#include <public/WebVideoLayer.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
class WebHelperPluginImpl;
class WebAudioSourceProvider;
class WebMediaPlayer;
+class WebVideoLayer;
// This class serves as a bridge between WebCore::MediaPlayer and
// WebKit::WebMediaPlayer.
#include "WheelEvent.h"
#include <public/Platform.h>
#include <public/WebClipboard.h>
+#include <public/WebCompositorSupport.h>
+#include <public/WebExternalTextureLayer.h>
#include <public/WebRect.h>
#include <public/WebString.h>
#include <public/WebURL.h>
ASSERT(!m_ioSurfaceLayer);
if (!m_textureLayer) {
- m_textureLayer = adoptPtr(WebExternalTextureLayer::create());
+ if (WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport())
+ m_textureLayer = compositorSupport->createExternalTextureLayer();
+ else
+ m_textureLayer = adoptPtr(WebExternalTextureLayer::create());
GraphicsLayerChromium::registerContentsLayer(m_textureLayer->layer());
}
m_textureLayer->setTextureId(textureId);
ASSERT(!m_textureLayer);
if (!m_ioSurfaceLayer) {
- m_ioSurfaceLayer = adoptPtr(WebIOSurfaceLayer::create());
+ if (WebCompositorSupport* compositorSupport = Platform::current()->compositorSupport())
+ m_ioSurfaceLayer = compositorSupport->createIOSurfaceLayer();
+ else
+ m_ioSurfaceLayer = adoptPtr(WebIOSurfaceLayer::create());
GraphicsLayerChromium::registerContentsLayer(m_ioSurfaceLayer->layer());
}
m_ioSurfaceLayer->setIOSurfaceProperties(ioSurfaceId, WebSize(width, height));
#include "WebPluginContainer.h"
#include "Widget.h"
-#include <public/WebExternalTextureLayer.h>
#include <public/WebIOSurfaceLayer.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
class ScrollbarGroup;
class WebPlugin;
class WebPluginLoadObserver;
+class WebExternalTextureLayer;
class WebPluginContainerImpl : public WebCore::PluginViewBase, public WebPluginContainer {
public: