diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-16 08:12:22 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-16 08:12:22 +0000 |
commit | c4275290c0c077709a02a81b3690e51df92d7954 (patch) | |
tree | d826f6a65beb3fd9a2b62c839f49476410896184 /webkit | |
parent | 06593364bc709899333d0c01d388c8fecd674599 (diff) | |
download | chromium_src-c4275290c0c077709a02a81b3690e51df92d7954.zip chromium_src-c4275290c0c077709a02a81b3690e51df92d7954.tar.gz chromium_src-c4275290c0c077709a02a81b3690e51df92d7954.tar.bz2 |
Remove WTF dependencies from webkit_compositor_bindings
This removes almost all the WTF uses from webkit_compositor_bindings and updates the includes of chromium-style headers to be chromium-style (full path, etc). Things that are still using wtf are:
- CCThreadTaskImpl uses OwnPtr/PassOwnPtr - fix will be a bit more involved
- WebTransformationMatrixTest uses wtf/MathExtras.h - will fix on its own
- WebTransformOperationsTest uses a Vector<OwnPtr<...> > - will rewrite this test on its own
Also removed WebCompositorInputHandlerImpl.h/cpp which don't compile and aren't listed in the gyp.
BUG=154451,144577
Review URL: https://chromiumcodereview.appspot.com/11142031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
40 files changed, 197 insertions, 663 deletions
diff --git a/webkit/compositor_bindings/CCThreadImpl.cpp b/webkit/compositor_bindings/CCThreadImpl.cpp index 4e09658..7830600 100644 --- a/webkit/compositor_bindings/CCThreadImpl.cpp +++ b/webkit/compositor_bindings/CCThreadImpl.cpp @@ -5,9 +5,9 @@ #include "config.h" #include "CCThreadImpl.h" -#include "CCCompletionEvent.h" -#include <public/Platform.h> -#include <public/WebThread.h> +#include "cc/completion_event.h" +#include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebThread.h" using cc::CCThread; using cc::CCCompletionEvent; @@ -42,7 +42,7 @@ private: // General adapter from a CCThread::Task to a WebThread::Task. class CCThreadTaskAdapter : public WebThread::Task { public: - CCThreadTaskAdapter(PassOwnPtr<CCThread::Task> task) : m_task(task) { } + explicit CCThreadTaskAdapter(PassOwnPtr<CCThread::Task> task) : m_task(task) { } virtual ~CCThreadTaskAdapter() { } @@ -55,14 +55,14 @@ private: OwnPtr<CCThread::Task> m_task; }; -PassOwnPtr<CCThread> CCThreadImpl::createForCurrentThread() +scoped_ptr<CCThread> CCThreadImpl::createForCurrentThread() { - return adoptPtr(new CCThreadImpl(Platform::current()->currentThread(), true)); + return scoped_ptr<CCThread>(new CCThreadImpl(Platform::current()->currentThread(), true)).Pass(); } -PassOwnPtr<CCThread> CCThreadImpl::createForDifferentThread(WebThread* thread) +scoped_ptr<CCThread> CCThreadImpl::createForDifferentThread(WebThread* thread) { - return adoptPtr(new CCThreadImpl(thread, false)); + return scoped_ptr<CCThread>(new CCThreadImpl(thread, false)).Pass(); } CCThreadImpl::~CCThreadImpl() diff --git a/webkit/compositor_bindings/CCThreadImpl.h b/webkit/compositor_bindings/CCThreadImpl.h index b45acb3..bd598a9 100644 --- a/webkit/compositor_bindings/CCThreadImpl.h +++ b/webkit/compositor_bindings/CCThreadImpl.h @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "CCThread.h" +#include "base/memory/scoped_ptr.h" #include "base/threading/platform_thread.h" +#include "cc/thread.h" #include <wtf/OwnPtr.h> -#include <wtf/Threading.h> +#include <wtf/PassOwnPtr.h> #ifndef CCThreadImpl_h #define CCThreadImpl_h @@ -18,10 +19,10 @@ class WebThread; class CCThreadImpl : public cc::CCThread { public: // Creates a CCThreadImpl wrapping the current thread. - static PassOwnPtr<cc::CCThread> createForCurrentThread(); + static scoped_ptr<cc::CCThread> createForCurrentThread(); // Creates a CCThread wrapping a non-current WebThread. - static PassOwnPtr<cc::CCThread> createForDifferentThread(WebThread*); + static scoped_ptr<cc::CCThread> createForDifferentThread(WebThread*); virtual ~CCThreadImpl(); virtual void postTask(PassOwnPtr<cc::CCThread::Task>); diff --git a/webkit/compositor_bindings/WebAnimationCurveCommon.cpp b/webkit/compositor_bindings/WebAnimationCurveCommon.cpp index 2cd5ac2..0193c3c 100644 --- a/webkit/compositor_bindings/WebAnimationCurveCommon.cpp +++ b/webkit/compositor_bindings/WebAnimationCurveCommon.cpp @@ -6,7 +6,7 @@ #include "WebAnimationCurveCommon.h" -#include "CCTimingFunction.h" +#include "cc/timing_function.h" namespace WebKit { diff --git a/webkit/compositor_bindings/WebAnimationCurveCommon.h b/webkit/compositor_bindings/WebAnimationCurveCommon.h index 1278830..8a6726b 100644 --- a/webkit/compositor_bindings/WebAnimationCurveCommon.h +++ b/webkit/compositor_bindings/WebAnimationCurveCommon.h @@ -6,8 +6,7 @@ #define WebAnimationCurveCommon_h #include "base/memory/scoped_ptr.h" -#include <public/WebAnimationCurve.h> -#include <wtf/Forward.h> +#include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationCurve.h" namespace cc { class CCTimingFunction; diff --git a/webkit/compositor_bindings/WebAnimationImpl.cpp b/webkit/compositor_bindings/WebAnimationImpl.cpp index cf401e9..2a0db9e3 100644 --- a/webkit/compositor_bindings/WebAnimationImpl.cpp +++ b/webkit/compositor_bindings/WebAnimationImpl.cpp @@ -6,13 +6,12 @@ #include "WebAnimationImpl.h" -#include "CCActiveAnimation.h" -#include "CCAnimationCurve.h" #include "WebFloatAnimationCurveImpl.h" #include "WebTransformAnimationCurveImpl.h" -#include <public/WebAnimation.h> -#include <public/WebAnimationCurve.h> -#include <wtf/OwnPtr.h> +#include "cc/active_animation.h" +#include "cc/animation_curve.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebAnimation.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationCurve.h" using cc::CCActiveAnimation; diff --git a/webkit/compositor_bindings/WebAnimationImpl.h b/webkit/compositor_bindings/WebAnimationImpl.h index d15eeb3..d7312b1 100644 --- a/webkit/compositor_bindings/WebAnimationImpl.h +++ b/webkit/compositor_bindings/WebAnimationImpl.h @@ -6,9 +6,7 @@ #define WebAnimationImpl_h #include "base/memory/scoped_ptr.h" -#include <public/WebAnimation.h> -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> +#include "third_party/WebKit/Source/Platform/chromium/public/WebAnimation.h" namespace cc { class CCActiveAnimation; diff --git a/webkit/compositor_bindings/WebAnimationTest.cpp b/webkit/compositor_bindings/WebAnimationTest.cpp index cb9be37..a122f9b 100644 --- a/webkit/compositor_bindings/WebAnimationTest.cpp +++ b/webkit/compositor_bindings/WebAnimationTest.cpp @@ -4,30 +4,19 @@ #include "config.h" -#include <public/WebAnimation.h> - -#include <gtest/gtest.h> -#include <public/WebFloatAnimationCurve.h> -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> +#include "WebAnimationImpl.h" +#include "WebFloatAnimationCurveImpl.h" +#include "base/memory/scoped_ptr.h" +#include "testing/gtest/include/gtest/gtest.h" using namespace WebKit; namespace { -// Linux/Win bots failed on this test. -// https://bugs.webkit.org/show_bug.cgi?id=90651 -#if OS(WINDOWS) -#define MAYBE_DefaultSettings DISABLED_DefaultSettings -#elif OS(LINUX) -#define MAYBE_DefaultSettings DISABLED_DefaultSettings -#else -#define MAYBE_DefaultSettings DefaultSettings -#endif -TEST(WebAnimationTest, MAYBE_DefaultSettings) +TEST(WebAnimationTest, DefaultSettings) { - OwnPtr<WebAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); - OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(*curve, WebAnimation::TargetPropertyOpacity)); + scoped_ptr<WebAnimationCurve> curve(new WebFloatAnimationCurveImpl()); + scoped_ptr<WebAnimation> animation(new WebAnimationImpl(*curve, WebAnimation::TargetPropertyOpacity, 1)); // Ensure that the defaults are correct. EXPECT_EQ(1, animation->iterations()); @@ -36,19 +25,10 @@ TEST(WebAnimationTest, MAYBE_DefaultSettings) EXPECT_FALSE(animation->alternatesDirection()); } -// Linux/Win bots failed on this test. -// https://bugs.webkit.org/show_bug.cgi?id=90651 -#if OS(WINDOWS) -#define MAYBE_ModifiedSettings DISABLED_ModifiedSettings -#elif OS(LINUX) -#define MAYBE_ModifiedSettings DISABLED_ModifiedSettings -#else -#define MAYBE_ModifiedSettings ModifiedSettings -#endif -TEST(WebAnimationTest, MAYBE_ModifiedSettings) +TEST(WebAnimationTest, ModifiedSettings) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); - OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(*curve, WebAnimation::TargetPropertyOpacity)); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl()); + scoped_ptr<WebAnimation> animation(new WebAnimationImpl(*curve, WebAnimation::TargetPropertyOpacity, 1)); animation->setIterations(2); animation->setStartTime(2); animation->setTimeOffset(2); diff --git a/webkit/compositor_bindings/WebCompositorImpl.cpp b/webkit/compositor_bindings/WebCompositorImpl.cpp index 145287c..2b42b38 100644 --- a/webkit/compositor_bindings/WebCompositorImpl.cpp +++ b/webkit/compositor_bindings/WebCompositorImpl.cpp @@ -6,18 +6,16 @@ #include "WebCompositorImpl.h" -#include "CCLayerTreeHost.h" -#include "CCProxy.h" -#include "CCSettings.h" -#include "CCThreadImpl.h" -#include <public/Platform.h> -#include <wtf/ThreadingPrimitives.h> - #ifdef LOG #undef LOG #endif #include "base/message_loop_proxy.h" +#include "cc/layer_tree_host.h" +#include "cc/proxy.h" +#include "cc/settings.h" +#include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" #include "webkit/glue/webthread_impl.h" +#include "CCThreadImpl.h" using namespace cc; @@ -72,10 +70,10 @@ void WebCompositorImpl::initialize(WebThread* implThread) ASSERT(!s_initialized); s_initialized = true; - s_mainThread = CCThreadImpl::createForCurrentThread().leakPtr(); + s_mainThread = CCThreadImpl::createForCurrentThread().release(); CCProxy::setMainThread(s_mainThread); if (implThread) { - s_implThread = CCThreadImpl::createForDifferentThread(implThread).leakPtr(); + s_implThread = CCThreadImpl::createForDifferentThread(implThread).release(); CCProxy::setImplThread(s_implThread); } else CCProxy::setImplThread(0); diff --git a/webkit/compositor_bindings/WebCompositorImpl.h b/webkit/compositor_bindings/WebCompositorImpl.h index c117a89..f07871e 100644 --- a/webkit/compositor_bindings/WebCompositorImpl.h +++ b/webkit/compositor_bindings/WebCompositorImpl.h @@ -5,11 +5,7 @@ #ifndef WebCompositorImpl_h #define WebCompositorImpl_h -#include <public/WebCompositor.h> - -#include <wtf/HashSet.h> -#include <wtf/Noncopyable.h> -#include <wtf/OwnPtr.h> +#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositor.h" namespace cc { class CCThread; @@ -20,7 +16,6 @@ namespace WebKit { class WebThread; class WebCompositorImpl : public WebCompositor { - WTF_MAKE_NONCOPYABLE(WebCompositorImpl); public: static bool initialized(); diff --git a/webkit/compositor_bindings/WebCompositorInputHandlerImpl.cpp b/webkit/compositor_bindings/WebCompositorInputHandlerImpl.cpp deleted file mode 100644 index 20c1e96c..0000000 --- a/webkit/compositor_bindings/WebCompositorInputHandlerImpl.cpp +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "config.h" - -#include "WebCompositorInputHandlerImpl.h" - -#include "CCActiveGestureAnimation.h" -#include "CCProxy.h" -#include "PlatformGestureCurveTarget.h" -#include "TouchpadFlingPlatformGestureCurve.h" -#include "TraceEvent.h" -#include "WebCompositorImpl.h" -#include "WebCompositorInputHandlerClient.h" -#include "WebInputEvent.h" -#include <wtf/ThreadingPrimitives.h> - -using namespace WebCore; - -namespace WebCore { - -PassOwnPtr<CCInputHandler> CCInputHandler::create(CCInputHandlerClient* inputHandlerClient) -{ - return WebKit::WebCompositorInputHandlerImpl::create(inputHandlerClient); -} - -class PlatformGestureToCCGestureAdapter : public CCGestureCurve, public PlatformGestureCurveTarget { -public: - static PassOwnPtr<CCGestureCurve> create(PassOwnPtr<PlatformGestureCurve> platformCurve) - { - return adoptPtr(new PlatformGestureToCCGestureAdapter(platformCurve)); - } - - virtual const char* debugName() const - { - return m_curve->debugName(); - } - - virtual bool apply(double time, CCGestureCurveTarget* target) - { - ASSERT(target); - m_target = target; - return m_curve->apply(time, this); - } - - virtual void scrollBy(const IntPoint& scrollDelta) - { - ASSERT(m_target); - m_target->scrollBy(scrollDelta); - } - -private: - PlatformGestureToCCGestureAdapter(PassOwnPtr<PlatformGestureCurve> curve) - : m_curve(curve) - , m_target(0) - { - } - - OwnPtr<PlatformGestureCurve> m_curve; - CCGestureCurveTarget* m_target; -}; - -} - -namespace WebKit { - -// These statics may only be accessed from the compositor thread. -int WebCompositorInputHandlerImpl::s_nextAvailableIdentifier = 1; -HashSet<WebCompositorInputHandlerImpl*>* WebCompositorInputHandlerImpl::s_compositors = 0; - -WebCompositorInputHandler* WebCompositorInputHandler::fromIdentifier(int identifier) -{ - return WebCompositorInputHandlerImpl::fromIdentifier(identifier); -} - -PassOwnPtr<WebCompositorInputHandlerImpl> WebCompositorInputHandlerImpl::create(WebCore::CCInputHandlerClient* inputHandlerClient) -{ - return adoptPtr(new WebCompositorInputHandlerImpl(inputHandlerClient)); -} - -WebCompositorInputHandler* WebCompositorInputHandlerImpl::fromIdentifier(int identifier) -{ - ASSERT(WebCompositorImpl::initialized()); - ASSERT(CCProxy::isImplThread()); - - if (!s_compositors) - return 0; - - for (HashSet<WebCompositorInputHandlerImpl*>::iterator it = s_compositors->begin(); it != s_compositors->end(); ++it) { - if ((*it)->identifier() == identifier) - return *it; - } - return 0; -} - -WebCompositorInputHandlerImpl::WebCompositorInputHandlerImpl(CCInputHandlerClient* inputHandlerClient) - : m_client(0) - , m_identifier(s_nextAvailableIdentifier++) - , m_inputHandlerClient(inputHandlerClient) -#ifndef NDEBUG - , m_expectScrollUpdateEnd(false) - , m_expectPinchUpdateEnd(false) -#endif - , m_gestureScrollStarted(false) -{ - ASSERT(CCProxy::isImplThread()); - - if (!s_compositors) - s_compositors = new HashSet<WebCompositorInputHandlerImpl*>; - s_compositors->add(this); -} - -WebCompositorInputHandlerImpl::~WebCompositorInputHandlerImpl() -{ - ASSERT(CCProxy::isImplThread()); - if (m_client) - m_client->willShutdown(); - - ASSERT(s_compositors); - s_compositors->remove(this); - if (!s_compositors->size()) { - delete s_compositors; - s_compositors = 0; - } -} - -void WebCompositorInputHandlerImpl::setClient(WebCompositorInputHandlerClient* client) -{ - ASSERT(CCProxy::isImplThread()); - // It's valid to set a new client if we've never had one or to clear the client, but it's not valid to change from having one client to a different one. - ASSERT(!m_client || !client); - m_client = client; -} - -void WebCompositorInputHandlerImpl::handleInputEvent(const WebInputEvent& event) -{ - ASSERT(CCProxy::isImplThread()); - ASSERT(m_client); - - WebCompositorInputHandlerImpl::EventDisposition disposition = handleInputEventInternal(event); - switch (disposition) { - case DidHandle: - m_client->didHandleInputEvent(); - break; - case DidNotHandle: - m_client->didNotHandleInputEvent(true /* sendToWidget */); - break; - case DropEvent: - m_client->didNotHandleInputEvent(false /* sendToWidget */); - break; - } -} - -WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::handleInputEventInternal(const WebInputEvent& event) -{ - if (event.type == WebInputEvent::MouseWheel) { - const WebMouseWheelEvent& wheelEvent = *static_cast<const WebMouseWheelEvent*>(&event); - CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(wheelEvent.x, wheelEvent.y), CCInputHandlerClient::Wheel); - switch (scrollStatus) { - case CCInputHandlerClient::ScrollStarted: { - TRACE_EVENT_INSTANT2("cc", "WebCompositorInputHandlerImpl::handleInput wheel scroll", "deltaX", -wheelEvent.deltaX, "deltaY", -wheelEvent.deltaY); - m_inputHandlerClient->scrollBy(IntPoint(wheelEvent.x, wheelEvent.y), IntSize(-wheelEvent.deltaX, -wheelEvent.deltaY)); - m_inputHandlerClient->scrollEnd(); - return DidHandle; - } - case CCInputHandlerClient::ScrollIgnored: - // FIXME: This should be DropEvent, but in cases where we fail to properly sync scrollability it's safer to send the - // event to the main thread. Change back to DropEvent once we have synchronization bugs sorted out. - return DidNotHandle; - case CCInputHandlerClient::ScrollOnMainThread: - return DidNotHandle; - } - } else if (event.type == WebInputEvent::GestureScrollBegin) { - ASSERT(!m_gestureScrollStarted); - ASSERT(!m_expectScrollUpdateEnd); -#ifndef NDEBUG - m_expectScrollUpdateEnd = true; -#endif - const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event); - CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(gestureEvent.x, gestureEvent.y), CCInputHandlerClient::Gesture); - switch (scrollStatus) { - case CCInputHandlerClient::ScrollStarted: - m_gestureScrollStarted = true; - return DidHandle; - case CCInputHandlerClient::ScrollOnMainThread: - return DidNotHandle; - case CCInputHandlerClient::ScrollIgnored: - return DropEvent; - } - } else if (event.type == WebInputEvent::GestureScrollUpdate) { - ASSERT(m_expectScrollUpdateEnd); - - if (!m_gestureScrollStarted) - return DidNotHandle; - - const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event); - m_inputHandlerClient->scrollBy(IntPoint(gestureEvent.x, gestureEvent.y), IntSize(-gestureEvent.deltaX, -gestureEvent.deltaY)); - return DidHandle; - } else if (event.type == WebInputEvent::GestureScrollEnd) { - ASSERT(m_expectScrollUpdateEnd); -#ifndef NDEBUG - m_expectScrollUpdateEnd = false; -#endif - if (!m_gestureScrollStarted) - return DidNotHandle; - - m_inputHandlerClient->scrollEnd(); - m_gestureScrollStarted = false; - return DidHandle; - } else if (event.type == WebInputEvent::GesturePinchBegin) { - ASSERT(!m_expectPinchUpdateEnd); -#ifndef NDEBUG - m_expectPinchUpdateEnd = true; -#endif - m_inputHandlerClient->pinchGestureBegin(); - return DidHandle; - } else if (event.type == WebInputEvent::GesturePinchEnd) { - ASSERT(m_expectPinchUpdateEnd); -#ifndef NDEBUG - m_expectPinchUpdateEnd = false; -#endif - m_inputHandlerClient->pinchGestureEnd(); - return DidHandle; - } else if (event.type == WebInputEvent::GesturePinchUpdate) { - ASSERT(m_expectPinchUpdateEnd); - const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event); - m_inputHandlerClient->pinchGestureUpdate(gestureEvent.deltaX, IntPoint(gestureEvent.x, gestureEvent.y)); - return DidHandle; - } else if (event.type == WebInputEvent::GestureFlingStart) { - const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event); - return handleGestureFling(gestureEvent); - } else if (event.type == WebInputEvent::GestureFlingCancel) { - if (cancelCurrentFling()) - return DidHandle; - } else if (WebInputEvent::isKeyboardEventType(event.type)) { - cancelCurrentFling(); - } - - return DidNotHandle; -} - -WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::handleGestureFling(const WebGestureEvent& gestureEvent) -{ - CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->scrollBegin(IntPoint(gestureEvent.x, gestureEvent.y), CCInputHandlerClient::Gesture); - switch (scrollStatus) { - case CCInputHandlerClient::ScrollStarted: { - TRACE_EVENT_INSTANT0("cc", "WebCompositorInputHandlerImpl::handleGestureFling::started"); - OwnPtr<PlatformGestureCurve> flingCurve = TouchpadFlingPlatformGestureCurve::create(FloatPoint(gestureEvent.deltaX, gestureEvent.deltaY)); - m_wheelFlingAnimation = CCActiveGestureAnimation::create(PlatformGestureToCCGestureAdapter::create(flingCurve.release()), this); - m_wheelFlingParameters.delta = WebFloatPoint(gestureEvent.deltaX, gestureEvent.deltaY); - m_wheelFlingParameters.point = WebPoint(gestureEvent.x, gestureEvent.y); - m_wheelFlingParameters.globalPoint = WebPoint(gestureEvent.globalX, gestureEvent.globalY); - m_wheelFlingParameters.modifiers = gestureEvent.modifiers; - m_inputHandlerClient->scheduleAnimation(); - return DidHandle; - } - case CCInputHandlerClient::ScrollOnMainThread: { - TRACE_EVENT_INSTANT0("cc", "WebCompositorInputHandlerImpl::handleGestureFling::scrollOnMainThread"); - return DidNotHandle; - } - case CCInputHandlerClient::ScrollIgnored: { - TRACE_EVENT_INSTANT0("cc", "WebCompositorInputHandlerImpl::handleGestureFling::ignored"); - // We still pass the curve to the main thread if there's nothing scrollable, in case something - // registers a handler before the curve is over. - return DidNotHandle; - } - } - return DidNotHandle; -} - -int WebCompositorInputHandlerImpl::identifier() const -{ - ASSERT(CCProxy::isImplThread()); - return m_identifier; -} - -void WebCompositorInputHandlerImpl::animate(double monotonicTime) -{ - if (!m_wheelFlingAnimation) - return; - - if (!m_wheelFlingParameters.startTime) - m_wheelFlingParameters.startTime = monotonicTime; - - if (m_wheelFlingAnimation->animate(monotonicTime)) - m_inputHandlerClient->scheduleAnimation(); - else { - TRACE_EVENT_INSTANT0("cc", "WebCompositorInputHandlerImpl::animate::flingOver"); - cancelCurrentFling(); - } -} - -bool WebCompositorInputHandlerImpl::cancelCurrentFling() -{ - bool hadFlingAnimation = m_wheelFlingAnimation; - TRACE_EVENT_INSTANT1("cc", "WebCompositorInputHandlerImpl::cancelCurrentFling", "hadFlingAnimation", hadFlingAnimation); - m_wheelFlingAnimation.clear(); - m_wheelFlingParameters = WebActiveWheelFlingParameters(); - return hadFlingAnimation; -} - -void WebCompositorInputHandlerImpl::scrollBy(const IntPoint& increment) -{ - if (increment == IntPoint::zero()) - return; - - TRACE_EVENT2("cc", "WebCompositorInputHandlerImpl::scrollBy", "x", increment.x(), "y", increment.y()); - WebMouseWheelEvent syntheticWheel; - syntheticWheel.type = WebInputEvent::MouseWheel; - syntheticWheel.deltaX = increment.x(); - syntheticWheel.deltaY = increment.y(); - syntheticWheel.hasPreciseScrollingDeltas = true; - syntheticWheel.x = m_wheelFlingParameters.point.x; - syntheticWheel.y = m_wheelFlingParameters.point.y; - syntheticWheel.globalX = m_wheelFlingParameters.globalPoint.x; - syntheticWheel.globalY = m_wheelFlingParameters.globalPoint.y; - syntheticWheel.modifiers = m_wheelFlingParameters.modifiers; - - WebCompositorInputHandlerImpl::EventDisposition disposition = handleInputEventInternal(syntheticWheel); - switch (disposition) { - case DidHandle: - m_wheelFlingParameters.cumulativeScroll.width += increment.x(); - m_wheelFlingParameters.cumulativeScroll.height += increment.y(); - case DropEvent: - break; - case DidNotHandle: - TRACE_EVENT_INSTANT0("cc", "WebCompositorInputHandlerImpl::scrollBy::AbortFling"); - // If we got a DidNotHandle, that means we need to deliver wheels on the main thread. - // In this case we need to schedule a commit and transfer the fling curve over to the main - // thread and run the rest of the wheels from there. - // This can happen when flinging a page that contains a scrollable subarea that we can't - // scroll on the thread if the fling starts outside the subarea but then is flung "under" the - // pointer. - m_client->transferActiveWheelFlingAnimation(m_wheelFlingParameters); - cancelCurrentFling(); - break; - } -} - -} diff --git a/webkit/compositor_bindings/WebCompositorInputHandlerImpl.h b/webkit/compositor_bindings/WebCompositorInputHandlerImpl.h deleted file mode 100644 index 6f1c3e1..0000000 --- a/webkit/compositor_bindings/WebCompositorInputHandlerImpl.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WebCompositorInputHandlerImpl_h -#define WebCompositorInputHandlerImpl_h - -#include "CCGestureCurve.h" -#include "CCInputHandler.h" -#include "WebActiveWheelFlingParameters.h" -#include "WebCompositorInputHandler.h" -#include "WebInputEvent.h" -#include <public/WebCompositor.h> -#include <wtf/HashSet.h> -#include <wtf/Noncopyable.h> -#include <wtf/OwnPtr.h> - -namespace WTF { -class Mutex; -} - -namespace WebCore { -class IntPoint; -class CCGestureCurveTarget; -class CCInputHandlerClient; -class CCThread; -} - -namespace WebKit { - -class WebCompositorInputHandlerClient; - -class WebCompositorInputHandlerImpl : public WebCompositorInputHandler, public WebCore::CCInputHandler, public WebCore::CCGestureCurveTarget { - WTF_MAKE_NONCOPYABLE(WebCompositorInputHandlerImpl); -public: - static PassOwnPtr<WebCompositorInputHandlerImpl> create(WebCore::CCInputHandlerClient*); - static WebCompositorInputHandler* fromIdentifier(int identifier); - - virtual ~WebCompositorInputHandlerImpl(); - - // WebCompositorInputHandler implementation. - virtual void setClient(WebCompositorInputHandlerClient*); - virtual void handleInputEvent(const WebInputEvent&); - - // WebCore::CCInputHandler implementation. - virtual int identifier() const; - virtual void animate(double monotonicTime); - - // WebCore::CCGestureCurveTarget implementation. - virtual void scrollBy(const WebCore::IntPoint&); - -private: - explicit WebCompositorInputHandlerImpl(WebCore::CCInputHandlerClient*); - - enum EventDisposition { DidHandle, DidNotHandle, DropEvent }; - // This function processes the input event and determines the disposition, but does not make - // any calls out to the WebCompositorInputHandlerClient. Some input types defer to helpers. - EventDisposition handleInputEventInternal(const WebInputEvent&); - - EventDisposition handleGestureFling(const WebGestureEvent&); - - // Returns true if we actually had an active fling to cancel. - bool cancelCurrentFling(); - - OwnPtr<WebCore::CCActiveGestureAnimation> m_wheelFlingAnimation; - // Parameters for the active fling animation, stored in case we need to transfer it out later. - WebActiveWheelFlingParameters m_wheelFlingParameters; - - WebCompositorInputHandlerClient* m_client; - int m_identifier; - WebCore::CCInputHandlerClient* m_inputHandlerClient; - -#ifndef NDEBUG - bool m_expectScrollUpdateEnd; - bool m_expectPinchUpdateEnd; -#endif - bool m_gestureScrollStarted; - - static int s_nextAvailableIdentifier; - static HashSet<WebCompositorInputHandlerImpl*>* s_compositors; -}; - -} - -#endif // WebCompositorImpl_h diff --git a/webkit/compositor_bindings/WebContentLayerImpl.cpp b/webkit/compositor_bindings/WebContentLayerImpl.cpp index 61d5998..1f07416 100644 --- a/webkit/compositor_bindings/WebContentLayerImpl.cpp +++ b/webkit/compositor_bindings/WebContentLayerImpl.cpp @@ -5,16 +5,16 @@ #include "config.h" #include "WebContentLayerImpl.h" -#include "ContentLayerChromium.h" -#include "FloatRect.h" -#include "IntRect.h" #include "SkMatrix44.h" +#include "cc/content_layer.h" +#include "cc/stubs/float_rect.h" +#include "cc/stubs/int_rect.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayerClient.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" #include "webcore_convert.h" -#include <public/WebContentLayerClient.h> -#include <public/WebFloatPoint.h> -#include <public/WebFloatRect.h> -#include <public/WebRect.h> -#include <public/WebSize.h> using namespace cc; @@ -26,7 +26,7 @@ WebContentLayer* WebContentLayer::create(WebContentLayerClient* client) } WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* client) - : m_layer(adoptPtr(new WebLayerImpl(ContentLayerChromium::create(this)))) + : m_layer(new WebLayerImpl(ContentLayerChromium::create(this))) , m_client(client) { m_layer->layer()->setIsDrawable(true); diff --git a/webkit/compositor_bindings/WebContentLayerImpl.h b/webkit/compositor_bindings/WebContentLayerImpl.h index 0eb1a81..dc6c291 100644 --- a/webkit/compositor_bindings/WebContentLayerImpl.h +++ b/webkit/compositor_bindings/WebContentLayerImpl.h @@ -5,10 +5,10 @@ #ifndef WebContentLayerImpl_h #define WebContentLayerImpl_h -#include "ContentLayerChromiumClient.h" #include "WebLayerImpl.h" -#include <public/WebContentLayer.h> -#include <wtf/OwnPtr.h> +#include "base/memory/scoped_ptr.h" +#include "cc/content_layer_client.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayer.h" namespace cc { class IntRect; @@ -37,7 +37,7 @@ protected: // ContentLayerChromiumClient implementation. virtual void paintContents(SkCanvas*, const cc::IntRect& clip, cc::FloatRect& opaque) OVERRIDE; - OwnPtr<WebLayerImpl> m_layer; + scoped_ptr<WebLayerImpl> m_layer; WebContentLayerClient* m_client; bool m_drawsContent; }; diff --git a/webkit/compositor_bindings/WebDelegatedRendererLayerImpl.cpp b/webkit/compositor_bindings/WebDelegatedRendererLayerImpl.cpp index c0326a9..9bd4621 100644 --- a/webkit/compositor_bindings/WebDelegatedRendererLayerImpl.cpp +++ b/webkit/compositor_bindings/WebDelegatedRendererLayerImpl.cpp @@ -5,15 +5,14 @@ #include "config.h" #include "WebDelegatedRendererLayerImpl.h" -#include "DelegatedRendererLayerChromium.h" -#include <wtf/PassOwnPtr.h> +#include "cc/delegated_renderer_layer.h" using namespace cc; namespace WebKit { WebDelegatedRendererLayerImpl::WebDelegatedRendererLayerImpl() - : m_layer(adoptPtr(new WebLayerImpl(DelegatedRendererLayerChromium::create()))) + : m_layer(new WebLayerImpl(DelegatedRendererLayerChromium::create())) { } diff --git a/webkit/compositor_bindings/WebDelegatedRendererLayerImpl.h b/webkit/compositor_bindings/WebDelegatedRendererLayerImpl.h index 321e9c3..055487a 100644 --- a/webkit/compositor_bindings/WebDelegatedRendererLayerImpl.h +++ b/webkit/compositor_bindings/WebDelegatedRendererLayerImpl.h @@ -6,8 +6,8 @@ #define WebDelegatedRendererLayerImpl_h #include "WebLayerImpl.h" -#include <public/WebDelegatedRendererLayer.h> -#include <wtf/OwnPtr.h> +#include "base/memory/scoped_ptr.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebDelegatedRendererLayer.h" namespace WebKit { @@ -22,7 +22,7 @@ protected: virtual ~WebDelegatedRendererLayerImpl(); private: - OwnPtr<WebLayerImpl> m_layer; + scoped_ptr<WebLayerImpl> m_layer; }; } // namespace WebKit diff --git a/webkit/compositor_bindings/WebExternalTextureLayerImpl.cpp b/webkit/compositor_bindings/WebExternalTextureLayerImpl.cpp index 3ddc75f..165fd63 100644 --- a/webkit/compositor_bindings/WebExternalTextureLayerImpl.cpp +++ b/webkit/compositor_bindings/WebExternalTextureLayerImpl.cpp @@ -5,13 +5,13 @@ #include "config.h" #include "WebExternalTextureLayerImpl.h" -#include "CCTextureUpdateQueue.h" -#include "TextureLayerChromium.h" #include "WebLayerImpl.h" +#include "cc/texture_layer.h" +#include "cc/texture_update_queue.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureLayerClient.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" #include "webcore_convert.h" -#include <public/WebExternalTextureLayerClient.h> -#include <public/WebFloatRect.h> -#include <public/WebSize.h> using namespace cc; @@ -31,7 +31,7 @@ WebExternalTextureLayerImpl::WebExternalTextureLayerImpl(WebExternalTextureLayer else layer = TextureLayerChromium::create(0); layer->setIsDrawable(true); - m_layer = adoptPtr(new WebLayerImpl(layer)); + m_layer.reset(new WebLayerImpl(layer)); } WebExternalTextureLayerImpl::~WebExternalTextureLayerImpl() diff --git a/webkit/compositor_bindings/WebExternalTextureLayerImpl.h b/webkit/compositor_bindings/WebExternalTextureLayerImpl.h index 542a650..d631058 100644 --- a/webkit/compositor_bindings/WebExternalTextureLayerImpl.h +++ b/webkit/compositor_bindings/WebExternalTextureLayerImpl.h @@ -5,9 +5,9 @@ #ifndef WebExternalTextureLayerImpl_h #define WebExternalTextureLayerImpl_h -#include "TextureLayerChromiumClient.h" -#include <public/WebExternalTextureLayer.h> -#include <wtf/OwnPtr.h> +#include "base/memory/scoped_ptr.h" +#include "cc/texture_layer_client.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureLayer.h" namespace WebKit { @@ -35,7 +35,7 @@ public: private: WebExternalTextureLayerClient* m_client; - OwnPtr<WebLayerImpl> m_layer; + scoped_ptr<WebLayerImpl> m_layer; }; } diff --git a/webkit/compositor_bindings/WebFloatAnimationCurveImpl.cpp b/webkit/compositor_bindings/WebFloatAnimationCurveImpl.cpp index 8bce2ce..e4e4d4c 100644 --- a/webkit/compositor_bindings/WebFloatAnimationCurveImpl.cpp +++ b/webkit/compositor_bindings/WebFloatAnimationCurveImpl.cpp @@ -6,10 +6,10 @@ #include "WebFloatAnimationCurveImpl.h" -#include "CCAnimationCurve.h" -#include "CCKeyframedAnimationCurve.h" -#include "CCTimingFunction.h" #include "WebAnimationCurveCommon.h" +#include "cc/animation_curve.h" +#include "cc/keyframed_animation_curve.h" +#include "cc/timing_function.h" namespace WebKit { diff --git a/webkit/compositor_bindings/WebFloatAnimationCurveImpl.h b/webkit/compositor_bindings/WebFloatAnimationCurveImpl.h index 757d3e6..299190f 100644 --- a/webkit/compositor_bindings/WebFloatAnimationCurveImpl.h +++ b/webkit/compositor_bindings/WebFloatAnimationCurveImpl.h @@ -6,7 +6,7 @@ #define WebFloatAnimationCurveImpl_h #include "base/memory/scoped_ptr.h" -#include <public/WebFloatAnimationCurve.h> +#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatAnimationCurve.h" namespace cc { class CCAnimationCurve; diff --git a/webkit/compositor_bindings/WebFloatAnimationCurveTest.cpp b/webkit/compositor_bindings/WebFloatAnimationCurveTest.cpp index 8cb12e5..4342d43 100644 --- a/webkit/compositor_bindings/WebFloatAnimationCurveTest.cpp +++ b/webkit/compositor_bindings/WebFloatAnimationCurveTest.cpp @@ -4,13 +4,10 @@ #include "config.h" -#include <public/WebFloatAnimationCurve.h> - -#include "CCTimingFunction.h" - -#include <gtest/gtest.h> -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> +#include "WebFloatAnimationCurveImpl.h" +#include "base/memory/scoped_ptr.h" +#include "cc/timing_function.h" +#include "testing/gtest/include/gtest/gtest.h" using namespace WebKit; @@ -19,7 +16,7 @@ namespace { // Tests that a float animation with one keyframe works as expected. TEST(WebFloatAnimationCurveTest, OneFloatKeyframe) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); EXPECT_FLOAT_EQ(2, curve->getValue(-1)); EXPECT_FLOAT_EQ(2, curve->getValue(0)); @@ -31,7 +28,7 @@ TEST(WebFloatAnimationCurveTest, OneFloatKeyframe) // Tests that a float animation with two keyframes works as expected. TEST(WebFloatAnimationCurveTest, TwoFloatKeyframe) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); curve->add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); EXPECT_FLOAT_EQ(2, curve->getValue(-1)); @@ -44,7 +41,7 @@ TEST(WebFloatAnimationCurveTest, TwoFloatKeyframe) // Tests that a float animation with three keyframes works as expected. TEST(WebFloatAnimationCurveTest, ThreeFloatKeyframe) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); curve->add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); curve->add(WebFloatKeyframe(2, 8), WebAnimationCurve::TimingFunctionTypeLinear); @@ -60,7 +57,7 @@ TEST(WebFloatAnimationCurveTest, ThreeFloatKeyframe) // Tests that a float animation with multiple keys at a given time works sanely. TEST(WebFloatAnimationCurveTest, RepeatedFloatKeyTimes) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 4), WebAnimationCurve::TimingFunctionTypeLinear); curve->add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); curve->add(WebFloatKeyframe(1, 6), WebAnimationCurve::TimingFunctionTypeLinear); @@ -82,7 +79,7 @@ TEST(WebFloatAnimationCurveTest, RepeatedFloatKeyTimes) // Tests that the keyframes may be added out of order. TEST(WebFloatAnimationCurveTest, UnsortedKeyframes) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(2, 8), WebAnimationCurve::TimingFunctionTypeLinear); curve->add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); curve->add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); @@ -99,7 +96,7 @@ TEST(WebFloatAnimationCurveTest, UnsortedKeyframes) // Tests that a cubic bezier timing function works as expected. TEST(WebFloatAnimationCurveTest, CubicBezierTimingFunction) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 0), 0.25, 0, 0.75, 1); curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); @@ -115,7 +112,7 @@ TEST(WebFloatAnimationCurveTest, CubicBezierTimingFunction) // Tests that an ease timing function works as expected. TEST(WebFloatAnimationCurveTest, EaseTimingFunction) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEase); curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); @@ -129,7 +126,7 @@ TEST(WebFloatAnimationCurveTest, EaseTimingFunction) // Tests using a linear timing function. TEST(WebFloatAnimationCurveTest, LinearTimingFunction) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeLinear); curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); @@ -142,7 +139,7 @@ TEST(WebFloatAnimationCurveTest, LinearTimingFunction) // Tests that an ease in timing function works as expected. TEST(WebFloatAnimationCurveTest, EaseInTimingFunction) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEaseIn); curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); @@ -156,7 +153,7 @@ TEST(WebFloatAnimationCurveTest, EaseInTimingFunction) // Tests that an ease in timing function works as expected. TEST(WebFloatAnimationCurveTest, EaseOutTimingFunction) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEaseOut); curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); @@ -170,7 +167,7 @@ TEST(WebFloatAnimationCurveTest, EaseOutTimingFunction) // Tests that an ease in timing function works as expected. TEST(WebFloatAnimationCurveTest, EaseInOutTimingFunction) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEaseInOut); curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); @@ -184,7 +181,7 @@ TEST(WebFloatAnimationCurveTest, EaseInOutTimingFunction) // Tests that an ease in timing function works as expected. TEST(WebFloatAnimationCurveTest, CustomBezierTimingFunction) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); double x1 = 0.3; double y1 = 0.2; double x2 = 0.8; @@ -202,7 +199,7 @@ TEST(WebFloatAnimationCurveTest, CustomBezierTimingFunction) // Tests that the default timing function is indeed ease. TEST(WebFloatAnimationCurveTest, DefaultTimingFunction) { - OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl); curve->add(WebFloatKeyframe(0, 0)); curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); diff --git a/webkit/compositor_bindings/WebIOSurfaceLayerImpl.cpp b/webkit/compositor_bindings/WebIOSurfaceLayerImpl.cpp index 0866dc2..0d9f5d6 100644 --- a/webkit/compositor_bindings/WebIOSurfaceLayerImpl.cpp +++ b/webkit/compositor_bindings/WebIOSurfaceLayerImpl.cpp @@ -5,10 +5,9 @@ #include "config.h" #include "WebIOSurfaceLayerImpl.h" -#include "IOSurfaceLayerChromium.h" #include "WebLayerImpl.h" +#include "cc/io_surface_layer.h" #include "webcore_convert.h" -#include <wtf/PassOwnPtr.h> using cc::IOSurfaceLayerChromium; @@ -20,7 +19,7 @@ WebIOSurfaceLayer* WebIOSurfaceLayer::create() } WebIOSurfaceLayerImpl::WebIOSurfaceLayerImpl() - : m_layer(adoptPtr(new WebLayerImpl(IOSurfaceLayerChromium::create()))) + : m_layer(new WebLayerImpl(IOSurfaceLayerChromium::create())) { m_layer->layer()->setIsDrawable(true); } diff --git a/webkit/compositor_bindings/WebIOSurfaceLayerImpl.h b/webkit/compositor_bindings/WebIOSurfaceLayerImpl.h index d2d3a87..b7a80f4 100644 --- a/webkit/compositor_bindings/WebIOSurfaceLayerImpl.h +++ b/webkit/compositor_bindings/WebIOSurfaceLayerImpl.h @@ -5,8 +5,8 @@ #ifndef WebIOSurfaceLayerImpl_h #define WebIOSurfaceLayerImpl_h -#include <public/WebIOSurfaceLayer.h> -#include <wtf/OwnPtr.h> +#include "third_party/WebKit/Source/Platform/chromium/public/WebIOSurfaceLayer.h" +#include "base/memory/scoped_ptr.h" namespace WebKit { @@ -20,7 +20,7 @@ public: virtual void setIOSurfaceProperties(unsigned ioSurfaceId, WebSize) OVERRIDE; private: - OwnPtr<WebLayerImpl> m_layer; + scoped_ptr<WebLayerImpl> m_layer; }; } diff --git a/webkit/compositor_bindings/WebImageLayerImpl.cpp b/webkit/compositor_bindings/WebImageLayerImpl.cpp index 06717e0..f146f33 100644 --- a/webkit/compositor_bindings/WebImageLayerImpl.cpp +++ b/webkit/compositor_bindings/WebImageLayerImpl.cpp @@ -5,7 +5,7 @@ #include "config.h" #include "WebImageLayerImpl.h" -#include "ImageLayerChromium.h" +#include "cc/image_layer.h" #include "WebLayerImpl.h" using cc::ImageLayerChromium; @@ -18,7 +18,7 @@ WebImageLayer* WebImageLayer::create() } WebImageLayerImpl::WebImageLayerImpl() - : m_layer(adoptPtr(new WebLayerImpl(ImageLayerChromium::create()))) + : m_layer(new WebLayerImpl(ImageLayerChromium::create())) { } diff --git a/webkit/compositor_bindings/WebImageLayerImpl.h b/webkit/compositor_bindings/WebImageLayerImpl.h index 6478923..06eb234 100644 --- a/webkit/compositor_bindings/WebImageLayerImpl.h +++ b/webkit/compositor_bindings/WebImageLayerImpl.h @@ -5,8 +5,8 @@ #ifndef WebImageLayerImpl_h #define WebImageLayerImpl_h -#include <public/WebImageLayer.h> -#include <wtf/OwnPtr.h> +#include "base/memory/scoped_ptr.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebImageLayer.h" namespace WebKit { class WebLayerImpl; @@ -21,7 +21,7 @@ public: virtual void setBitmap(SkBitmap) OVERRIDE; private: - OwnPtr<WebLayerImpl> m_layer; + scoped_ptr<WebLayerImpl> m_layer; }; } diff --git a/webkit/compositor_bindings/WebLayerImpl.cpp b/webkit/compositor_bindings/WebLayerImpl.cpp index 77d3d8d..a1c6e3e 100644 --- a/webkit/compositor_bindings/WebLayerImpl.cpp +++ b/webkit/compositor_bindings/WebLayerImpl.cpp @@ -5,19 +5,19 @@ #include "config.h" #include "WebLayerImpl.h" -#include "CCActiveAnimation.h" -#include "LayerChromium.h" #include "SkMatrix44.h" #include "WebAnimationImpl.h" #ifdef LOG #undef LOG #endif #include "base/string_util.h" +#include "cc/active_animation.h" +#include "cc/layer.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMatrix.h" #include "webcore_convert.h" -#include <public/WebFloatPoint.h> -#include <public/WebFloatRect.h> -#include <public/WebSize.h> -#include <public/WebTransformationMatrix.h> using cc::CCActiveAnimation; using cc::LayerChromium; diff --git a/webkit/compositor_bindings/WebLayerImpl.h b/webkit/compositor_bindings/WebLayerImpl.h index c88632e..88a433f 100644 --- a/webkit/compositor_bindings/WebLayerImpl.h +++ b/webkit/compositor_bindings/WebLayerImpl.h @@ -6,7 +6,7 @@ #define WebLayerImpl_h #include "base/memory/ref_counted.h" -#include <public/WebLayer.h> +#include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" namespace cc { class LayerChromium; diff --git a/webkit/compositor_bindings/WebLayerTreeViewImpl.cpp b/webkit/compositor_bindings/WebLayerTreeViewImpl.cpp index c7b4d31..f621a86 100644 --- a/webkit/compositor_bindings/WebLayerTreeViewImpl.cpp +++ b/webkit/compositor_bindings/WebLayerTreeViewImpl.cpp @@ -5,20 +5,20 @@ #include "config.h" #include "WebLayerTreeViewImpl.h" -#include "CCFontAtlas.h" -#include "CCInputHandler.h" -#include "CCLayerTreeHost.h" -#include "LayerChromium.h" #include "WebLayerImpl.h" #include "WebToCCInputHandlerAdapter.h" +#include "cc/font_atlas.h" +#include "cc/input_handler.h" +#include "cc/layer.h" +#include "cc/layer_tree_host.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewClient.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" #include "webcore_convert.h" -#include <public/WebGraphicsContext3D.h> -#include <public/WebInputHandler.h> -#include <public/WebLayer.h> -#include <public/WebLayerTreeView.h> -#include <public/WebLayerTreeViewClient.h> -#include <public/WebRenderingStats.h> -#include <public/WebSize.h> using namespace cc; @@ -233,9 +233,9 @@ void WebLayerTreeViewImpl::didRecreateOutputSurface(bool success) scoped_ptr<CCInputHandler> WebLayerTreeViewImpl::createInputHandler() { scoped_ptr<CCInputHandler> ret; - OwnPtr<WebInputHandler> handler = adoptPtr(m_client->createInputHandler()); + scoped_ptr<WebInputHandler> handler(m_client->createInputHandler()); if (handler) - ret = WebToCCInputHandlerAdapter::create(handler.release()); + ret = WebToCCInputHandlerAdapter::create(handler.Pass()); return ret.Pass(); } diff --git a/webkit/compositor_bindings/WebLayerTreeViewImpl.h b/webkit/compositor_bindings/WebLayerTreeViewImpl.h index c492a97..f9b9e11 100644 --- a/webkit/compositor_bindings/WebLayerTreeViewImpl.h +++ b/webkit/compositor_bindings/WebLayerTreeViewImpl.h @@ -6,8 +6,8 @@ #define WebLayerTreeViewImpl_h #include "base/memory/scoped_ptr.h" -#include "CCLayerTreeHostClient.h" -#include <public/WebLayerTreeView.h> +#include "cc/layer_tree_host_client.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" namespace cc { class CCLayerTreeHost; diff --git a/webkit/compositor_bindings/WebLayerTreeViewTest.cpp b/webkit/compositor_bindings/WebLayerTreeViewTest.cpp index 14b373b1..3fd0915 100644 --- a/webkit/compositor_bindings/WebLayerTreeViewTest.cpp +++ b/webkit/compositor_bindings/WebLayerTreeViewTest.cpp @@ -4,19 +4,19 @@ #include "config.h" -#include <public/WebLayerTreeView.h> - +#include "WebLayerImpl.h" +#include "WebLayerTreeViewImpl.h" +#include "WebLayerTreeViewTestCommon.h" +#include "base/memory/ref_counted.h" #include "cc/test/compositor_fake_web_graphics_context_3d.h" #include "cc/test/fake_web_compositor_output_surface.h" -#include "WebLayerTreeViewTestCommon.h" -#include <gmock/gmock.h> -#include <public/Platform.h> -#include <public/WebCompositorSupport.h> -#include <public/WebLayer.h> -#include <public/WebLayerTreeViewClient.h> -#include <public/WebThread.h> -#include <wtf/RefCounted.h> -#include <wtf/RefPtr.h> +#include "testing/gmock/include/gmock/gmock.h" +#include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSupport.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewClient.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebThread.h" using namespace WebKit; using testing::Mock; @@ -42,8 +42,10 @@ public: virtual void SetUp() { initializeCompositor(); - m_rootLayer = adoptPtr(WebLayer::create()); - ASSERT_TRUE(m_view = adoptPtr(WebLayerTreeView::create(client(), *m_rootLayer, WebLayerTreeView::Settings()))); + m_rootLayer.reset(new WebLayerImpl); + m_view.reset(new WebLayerTreeViewImpl(client())); + ASSERT_TRUE(m_view->initialize(WebLayerTreeView::Settings())); + m_view->setRootLayer(*m_rootLayer); m_view->setSurfaceReady(); } @@ -51,14 +53,14 @@ public: { Mock::VerifyAndClearExpectations(client()); - m_rootLayer.clear(); - m_view.clear(); + m_rootLayer.reset(); + m_view.reset(); WebKit::Platform::current()->compositorSupport()->shutdown(); } protected: - OwnPtr<WebLayer> m_rootLayer; - OwnPtr<WebLayerTreeView> m_view; + scoped_ptr<WebLayer> m_rootLayer; + scoped_ptr<WebLayerTreeViewImpl> m_view; }; class WebLayerTreeViewSingleThreadTest : public WebLayerTreeViewTestBase { @@ -81,7 +83,7 @@ protected: MockWebLayerTreeViewClient m_client; }; -class CancelableTaskWrapper : public RefCounted<CancelableTaskWrapper> { +class CancelableTaskWrapper : public base::RefCounted<CancelableTaskWrapper> { class Task : public WebThread::Task { public: Task(CancelableTaskWrapper* cancelableTask) @@ -95,14 +97,13 @@ class CancelableTaskWrapper : public RefCounted<CancelableTaskWrapper> { m_cancelableTask->runIfNotCanceled(); } - RefPtr<CancelableTaskWrapper> m_cancelableTask; + scoped_refptr<CancelableTaskWrapper> m_cancelableTask; }; public: CancelableTaskWrapper(PassOwnPtr<WebThread::Task> task) : m_task(task) { - turnOffVerifier(); } void cancel() @@ -125,6 +126,9 @@ public: } private: + friend class base::RefCounted<CancelableTaskWrapper>; + ~CancelableTaskWrapper() { } + OwnPtr<WebThread::Task> m_task; }; @@ -140,7 +144,7 @@ protected: void composite() { m_view->setNeedsRedraw(); - RefPtr<CancelableTaskWrapper> timeoutTask = adoptRef(new CancelableTaskWrapper(adoptPtr(new TimeoutTask()))); + scoped_refptr<CancelableTaskWrapper> timeoutTask(new CancelableTaskWrapper(adoptPtr(new TimeoutTask()))); WebKit::Platform::current()->currentThread()->postDelayedTask(timeoutTask->createTask(), 5000); WebKit::Platform::current()->currentThread()->enterRunLoop(); timeoutTask->cancel(); @@ -149,7 +153,7 @@ protected: virtual void initializeCompositor() OVERRIDE { - m_webThread = adoptPtr(WebKit::Platform::current()->createThread("WebLayerTreeViewTest")); + m_webThread.reset(WebKit::Platform::current()->createThread("WebLayerTreeViewTest")); WebKit::Platform::current()->compositorSupport()->initialize(m_webThread.get()); } @@ -159,7 +163,7 @@ protected: } MockWebLayerTreeViewClientForThreadedTests m_client; - OwnPtr<WebThread> m_webThread; + scoped_ptr<WebThread> m_webThread; }; TEST_F(WebLayerTreeViewSingleThreadTest, InstrumentationCallbacks) diff --git a/webkit/compositor_bindings/WebScrollbarLayerImpl.cpp b/webkit/compositor_bindings/WebScrollbarLayerImpl.cpp index f216de3..be770a6 100644 --- a/webkit/compositor_bindings/WebScrollbarLayerImpl.cpp +++ b/webkit/compositor_bindings/WebScrollbarLayerImpl.cpp @@ -5,8 +5,8 @@ #include "config.h" #include "WebScrollbarLayerImpl.h" -#include "ScrollbarLayerChromium.h" #include "WebLayerImpl.h" +#include "cc/scrollbar_layer.h" using cc::ScrollbarLayerChromium; @@ -19,7 +19,7 @@ WebScrollbarLayer* WebScrollbarLayer::create(WebScrollbar* scrollbar, WebScrollb WebScrollbarLayerImpl::WebScrollbarLayerImpl(WebScrollbar* scrollbar, WebScrollbarThemePainter painter, WebScrollbarThemeGeometry* geometry) - : m_layer(adoptPtr(new WebLayerImpl(ScrollbarLayerChromium::create(adoptPtr(scrollbar), painter, adoptPtr(geometry), 0)))) + : m_layer(new WebLayerImpl(ScrollbarLayerChromium::create(adoptPtr(scrollbar), painter, adoptPtr(geometry), 0))) { } diff --git a/webkit/compositor_bindings/WebScrollbarLayerImpl.h b/webkit/compositor_bindings/WebScrollbarLayerImpl.h index d4a33a1..58a236f 100644 --- a/webkit/compositor_bindings/WebScrollbarLayerImpl.h +++ b/webkit/compositor_bindings/WebScrollbarLayerImpl.h @@ -5,8 +5,8 @@ #ifndef WebScrollbarLayerImpl_h #define WebScrollbarLayerImpl_h -#include <public/WebScrollbarLayer.h> -#include <wtf/OwnPtr.h> +#include "base/memory/scoped_ptr.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbarLayer.h" namespace WebKit { class WebLayerImpl; @@ -21,7 +21,7 @@ public: virtual void setScrollLayer(WebLayer*) OVERRIDE; private: - OwnPtr<WebLayerImpl> m_layer; + scoped_ptr<WebLayerImpl> m_layer; }; } diff --git a/webkit/compositor_bindings/WebSolidColorLayerImpl.cpp b/webkit/compositor_bindings/WebSolidColorLayerImpl.cpp index e0cd08e..f763eb4 100644 --- a/webkit/compositor_bindings/WebSolidColorLayerImpl.cpp +++ b/webkit/compositor_bindings/WebSolidColorLayerImpl.cpp @@ -5,9 +5,8 @@ #include "config.h" #include "WebSolidColorLayerImpl.h" -#include "SolidColorLayerChromium.h" #include "WebLayerImpl.h" -#include <wtf/PassOwnPtr.h> +#include "cc/solid_color_layer.h" using cc::SolidColorLayerChromium; @@ -19,7 +18,7 @@ WebSolidColorLayer* WebSolidColorLayer::create() } WebSolidColorLayerImpl::WebSolidColorLayerImpl() - : m_layer(adoptPtr(new WebLayerImpl(SolidColorLayerChromium::create()))) + : m_layer(new WebLayerImpl(SolidColorLayerChromium::create())) { m_layer->layer()->setIsDrawable(true); } diff --git a/webkit/compositor_bindings/WebSolidColorLayerImpl.h b/webkit/compositor_bindings/WebSolidColorLayerImpl.h index db15d19..361ce53 100644 --- a/webkit/compositor_bindings/WebSolidColorLayerImpl.h +++ b/webkit/compositor_bindings/WebSolidColorLayerImpl.h @@ -5,8 +5,8 @@ #ifndef WebSolidColorLayerImpl_h #define WebSolidColorLayerImpl_h -#include <public/WebSolidColorLayer.h> -#include <wtf/OwnPtr.h> +#include "base/memory/scoped_ptr.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebSolidColorLayer.h" namespace WebKit { class WebLayerImpl; @@ -21,7 +21,7 @@ public: virtual void setBackgroundColor(WebColor) OVERRIDE; private: - OwnPtr<WebLayerImpl> m_layer; + scoped_ptr<WebLayerImpl> m_layer; }; } // namespace WebKit diff --git a/webkit/compositor_bindings/WebToCCInputHandlerAdapter.cpp b/webkit/compositor_bindings/WebToCCInputHandlerAdapter.cpp index 2ce8e4b..32f44f8 100644 --- a/webkit/compositor_bindings/WebToCCInputHandlerAdapter.cpp +++ b/webkit/compositor_bindings/WebToCCInputHandlerAdapter.cpp @@ -6,10 +6,10 @@ #include "WebToCCInputHandlerAdapter.h" -#include "IntPoint.h" -#include "IntSize.h" +#include "cc/stubs/int_point.h" +#include "cc/stubs/int_size.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandlerClient.h" #include "webcore_convert.h" -#include <public/WebInputHandlerClient.h> #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, cc_name) \ COMPILE_ASSERT(int(WebKit::webkit_name) == int(cc::cc_name), mismatching_enums) @@ -22,13 +22,13 @@ COMPILE_ASSERT_MATCHING_ENUM(WebInputHandlerClient::ScrollInputTypeWheel, CCInpu namespace WebKit { -scoped_ptr<WebToCCInputHandlerAdapter> WebToCCInputHandlerAdapter::create(PassOwnPtr<WebInputHandler> handler) +scoped_ptr<WebToCCInputHandlerAdapter> WebToCCInputHandlerAdapter::create(scoped_ptr<WebInputHandler> handler) { - return scoped_ptr<WebToCCInputHandlerAdapter>(new WebToCCInputHandlerAdapter(handler)); + return scoped_ptr<WebToCCInputHandlerAdapter>(new WebToCCInputHandlerAdapter(handler.Pass())); } -WebToCCInputHandlerAdapter::WebToCCInputHandlerAdapter(PassOwnPtr<WebInputHandler> handler) - : m_handler(handler) +WebToCCInputHandlerAdapter::WebToCCInputHandlerAdapter(scoped_ptr<WebInputHandler> handler) + : m_handler(handler.Pass()) { } @@ -98,7 +98,7 @@ private: void WebToCCInputHandlerAdapter::bindToClient(cc::CCInputHandlerClient* client) { - m_clientAdapter = adoptPtr(new ClientAdapter(client)); + m_clientAdapter.reset(new ClientAdapter(client)); m_handler->bindToClient(m_clientAdapter.get()); } diff --git a/webkit/compositor_bindings/WebToCCInputHandlerAdapter.h b/webkit/compositor_bindings/WebToCCInputHandlerAdapter.h index 437c923..7cbf3244 100644 --- a/webkit/compositor_bindings/WebToCCInputHandlerAdapter.h +++ b/webkit/compositor_bindings/WebToCCInputHandlerAdapter.h @@ -6,16 +6,14 @@ #define WebToCCInputHandlerAdapter_h #include "base/memory/scoped_ptr.h" -#include "CCInputHandler.h" -#include <public/WebInputHandler.h> -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> +#include "cc/input_handler.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" namespace WebKit { class WebToCCInputHandlerAdapter : public cc::CCInputHandler { public: - static scoped_ptr<WebToCCInputHandlerAdapter> create(PassOwnPtr<WebInputHandler>); + static scoped_ptr<WebToCCInputHandlerAdapter> create(scoped_ptr<WebInputHandler>); virtual ~WebToCCInputHandlerAdapter(); // cc::CCInputHandler implementation. @@ -23,11 +21,11 @@ public: virtual void animate(double monotonicTime) OVERRIDE; private: - explicit WebToCCInputHandlerAdapter(PassOwnPtr<WebInputHandler>); + explicit WebToCCInputHandlerAdapter(scoped_ptr<WebInputHandler>); class ClientAdapter; - OwnPtr<ClientAdapter> m_clientAdapter; - OwnPtr<WebInputHandler> m_handler; + scoped_ptr<ClientAdapter> m_clientAdapter; + scoped_ptr<WebInputHandler> m_handler; }; } diff --git a/webkit/compositor_bindings/WebTransformAnimationCurveImpl.cpp b/webkit/compositor_bindings/WebTransformAnimationCurveImpl.cpp index e6b732f..ce32d44 100644 --- a/webkit/compositor_bindings/WebTransformAnimationCurveImpl.cpp +++ b/webkit/compositor_bindings/WebTransformAnimationCurveImpl.cpp @@ -6,11 +6,9 @@ #include "WebTransformAnimationCurveImpl.h" -#include "CCKeyframedAnimationCurve.h" -#include "CCTimingFunction.h" #include "WebAnimationCurveCommon.h" -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> +#include "cc/keyframed_animation_curve.h" +#include "cc/timing_function.h" namespace WebKit { diff --git a/webkit/compositor_bindings/WebTransformAnimationCurveImpl.h b/webkit/compositor_bindings/WebTransformAnimationCurveImpl.h index 88f1c3e..51a8011 100644 --- a/webkit/compositor_bindings/WebTransformAnimationCurveImpl.h +++ b/webkit/compositor_bindings/WebTransformAnimationCurveImpl.h @@ -6,7 +6,7 @@ #define WebTransformAnimationCurveImpl_h #include "base/memory/scoped_ptr.h" -#include <public/WebTransformAnimationCurve.h> +#include "third_party/WebKit/Source/Platform/chromium/public/WebTransformAnimationCurve.h" namespace cc { class CCAnimationCurve; diff --git a/webkit/compositor_bindings/WebTransformAnimationCurveTest.cpp b/webkit/compositor_bindings/WebTransformAnimationCurveTest.cpp index fe0ab80..24c181d 100644 --- a/webkit/compositor_bindings/WebTransformAnimationCurveTest.cpp +++ b/webkit/compositor_bindings/WebTransformAnimationCurveTest.cpp @@ -4,15 +4,12 @@ #include "config.h" -#include <public/WebTransformAnimationCurve.h> - -#include "CCTimingFunction.h" - -#include <gtest/gtest.h> -#include <public/WebTransformOperations.h> -#include <public/WebTransformationMatrix.h> -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> +#include "WebTransformAnimationCurveImpl.h" +#include "base/memory/scoped_ptr.h" +#include "cc/timing_function.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebTransformOperations.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMatrix.h" using namespace WebKit; @@ -21,7 +18,7 @@ namespace { // Tests that a transform animation with one keyframe works as expected. TEST(WebTransformAnimationCurveTest, OneTransformKeyframe) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations; operations.appendTranslate(2, 0, 0); curve->add(WebTransformKeyframe(0, operations), WebAnimationCurve::TimingFunctionTypeLinear); @@ -36,7 +33,7 @@ TEST(WebTransformAnimationCurveTest, OneTransformKeyframe) // Tests that a transform animation with two keyframes works as expected. TEST(WebTransformAnimationCurveTest, TwoTransformKeyframe) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(2, 0, 0); WebKit::WebTransformOperations operations2; @@ -53,7 +50,7 @@ TEST(WebTransformAnimationCurveTest, TwoTransformKeyframe) // Tests that a transform animation with three keyframes works as expected. TEST(WebTransformAnimationCurveTest, ThreeTransformKeyframe) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(2, 0, 0); WebKit::WebTransformOperations operations2; @@ -76,7 +73,7 @@ TEST(WebTransformAnimationCurveTest, ThreeTransformKeyframe) TEST(WebTransformAnimationCurveTest, RepeatedTransformKeyTimes) { // A step function. - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(4, 0, 0); WebKit::WebTransformOperations operations2; @@ -106,7 +103,7 @@ TEST(WebTransformAnimationCurveTest, RepeatedTransformKeyTimes) // Tests that the keyframes may be added out of order. TEST(WebTransformAnimationCurveTest, UnsortedKeyframes) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(2, 0, 0); WebKit::WebTransformOperations operations2; @@ -129,7 +126,7 @@ TEST(WebTransformAnimationCurveTest, UnsortedKeyframes) // Tests that a cubic bezier timing function works as expected. TEST(WebTransformAnimationCurveTest, CubicBezierTimingFunction) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; @@ -148,7 +145,7 @@ TEST(WebTransformAnimationCurveTest, CubicBezierTimingFunction) // Tests that an ease timing function works as expected. TEST(WebTransformAnimationCurveTest, EaseTimingFunction) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; @@ -166,7 +163,7 @@ TEST(WebTransformAnimationCurveTest, EaseTimingFunction) // Tests using a linear timing function. TEST(WebTransformAnimationCurveTest, LinearTimingFunction) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; @@ -183,7 +180,7 @@ TEST(WebTransformAnimationCurveTest, LinearTimingFunction) // Tests that an ease in timing function works as expected. TEST(WebTransformAnimationCurveTest, EaseInTimingFunction) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; @@ -201,7 +198,7 @@ TEST(WebTransformAnimationCurveTest, EaseInTimingFunction) // Tests that an ease in timing function works as expected. TEST(WebTransformAnimationCurveTest, EaseOutTimingFunction) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; @@ -219,7 +216,7 @@ TEST(WebTransformAnimationCurveTest, EaseOutTimingFunction) // Tests that an ease in timing function works as expected. TEST(WebTransformAnimationCurveTest, EaseInOutTimingFunction) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; @@ -237,7 +234,7 @@ TEST(WebTransformAnimationCurveTest, EaseInOutTimingFunction) // Tests that an ease in timing function works as expected. TEST(WebTransformAnimationCurveTest, CustomBezierTimingFunction) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); double x1 = 0.3; double y1 = 0.2; double x2 = 0.8; @@ -259,7 +256,7 @@ TEST(WebTransformAnimationCurveTest, CustomBezierTimingFunction) // Tests that the default timing function is indeed ease. TEST(WebTransformAnimationCurveTest, DefaultTimingFunction) { - OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); + scoped_ptr<WebTransformAnimationCurve> curve(new WebTransformAnimationCurveImpl); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; diff --git a/webkit/compositor_bindings/WebVideoLayerImpl.cpp b/webkit/compositor_bindings/WebVideoLayerImpl.cpp index 8fd1d2f..8b03508 100644 --- a/webkit/compositor_bindings/WebVideoLayerImpl.cpp +++ b/webkit/compositor_bindings/WebVideoLayerImpl.cpp @@ -5,9 +5,8 @@ #include "config.h" #include "WebVideoLayerImpl.h" -#include "VideoLayerChromium.h" #include "WebLayerImpl.h" -#include <wtf/PassOwnPtr.h> +#include "cc/video_layer.h" namespace WebKit { @@ -17,7 +16,7 @@ WebVideoLayer* WebVideoLayer::create(WebVideoFrameProvider* provider) } WebVideoLayerImpl::WebVideoLayerImpl(WebVideoFrameProvider* provider) - : m_layer(adoptPtr(new WebLayerImpl(cc::VideoLayerChromium::create(provider)))) + : m_layer(new WebLayerImpl(cc::VideoLayerChromium::create(provider))) { } diff --git a/webkit/compositor_bindings/WebVideoLayerImpl.h b/webkit/compositor_bindings/WebVideoLayerImpl.h index 96a73fa..e35cdd1 100644 --- a/webkit/compositor_bindings/WebVideoLayerImpl.h +++ b/webkit/compositor_bindings/WebVideoLayerImpl.h @@ -5,8 +5,8 @@ #ifndef WebVideoLayerImpl_h #define WebVideoLayerImpl_h -#include <public/WebVideoLayer.h> -#include <wtf/OwnPtr.h> +#include "base/memory/scoped_ptr.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebVideoLayer.h" namespace WebKit { class WebLayerImpl; @@ -21,7 +21,7 @@ public: virtual bool active() const OVERRIDE; private: - OwnPtr<WebLayerImpl> m_layer; + scoped_ptr<WebLayerImpl> m_layer; }; } |