diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-29 00:06:29 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-29 00:06:29 +0000 |
commit | 30faac90dedf380f50bb2beab7234662c11ea1d0 (patch) | |
tree | 592e74095ae0d91503bc260f184134d6e18e522b /cc | |
parent | 0d7498e4e1f0bfdd2639d1e3e4dd501a2f0be479 (diff) | |
download | chromium_src-30faac90dedf380f50bb2beab7234662c11ea1d0.zip chromium_src-30faac90dedf380f50bb2beab7234662c11ea1d0.tar.gz chromium_src-30faac90dedf380f50bb2beab7234662c11ea1d0.tar.bz2 |
Remove WTF::currentTime() / WTF::monotonicallyIncreasingTime() uses from cc
These are implemented on top of WebKit::Platform via webkit_wtf_support and need
to go.
BUG=154451
Review URL: https://chromiumcodereview.appspot.com/11191068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/delegated_renderer_layer_impl_unittest.cc | 4 | ||||
-rw-r--r-- | cc/frame_rate_controller.cc | 1 | ||||
-rw-r--r-- | cc/gl_renderer.cc | 1 | ||||
-rw-r--r-- | cc/input_handler.h | 7 | ||||
-rw-r--r-- | cc/layer_tree_host.cc | 27 | ||||
-rw-r--r-- | cc/layer_tree_host.h | 13 | ||||
-rw-r--r-- | cc/layer_tree_host_impl.cc | 37 | ||||
-rw-r--r-- | cc/layer_tree_host_impl.h | 20 | ||||
-rw-r--r-- | cc/layer_tree_host_impl_unittest.cc | 31 | ||||
-rw-r--r-- | cc/layer_tree_host_unittest.cc | 25 | ||||
-rw-r--r-- | cc/proxy.h | 3 | ||||
-rw-r--r-- | cc/resource_update_controller.cc | 1 | ||||
-rw-r--r-- | cc/single_thread_proxy.cc | 11 | ||||
-rw-r--r-- | cc/single_thread_proxy.h | 6 | ||||
-rw-r--r-- | cc/test/layer_tree_test_common.cc | 4 | ||||
-rw-r--r-- | cc/test/layer_tree_test_common.h | 8 | ||||
-rw-r--r-- | cc/thread_proxy.cc | 24 | ||||
-rw-r--r-- | cc/thread_proxy.h | 12 |
18 files changed, 115 insertions, 120 deletions
diff --git a/cc/delegated_renderer_layer_impl_unittest.cc b/cc/delegated_renderer_layer_impl_unittest.cc index c8ecda0..716bf1f 100644 --- a/cc/delegated_renderer_layer_impl_unittest.cc +++ b/cc/delegated_renderer_layer_impl_unittest.cc @@ -46,11 +46,11 @@ public: // LayerTreeHostImplClient implementation. virtual void didLoseContextOnImplThread() OVERRIDE { } virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE { } - virtual void onVSyncParametersChanged(double, double) OVERRIDE { } + virtual void onVSyncParametersChanged(base::TimeTicks, base::TimeDelta) OVERRIDE { } virtual void onCanDrawStateChanged(bool) OVERRIDE { } virtual void setNeedsRedrawOnImplThread() OVERRIDE { } virtual void setNeedsCommitOnImplThread() OVERRIDE { } - virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, double wallClockTime) OVERRIDE { } + virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, base::Time wallClockTime) OVERRIDE { } virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) OVERRIDE { return true; } virtual void sendManagedMemoryStats() OVERRIDE { } diff --git a/cc/frame_rate_controller.cc b/cc/frame_rate_controller.cc index ae095c7..46000fc 100644 --- a/cc/frame_rate_controller.cc +++ b/cc/frame_rate_controller.cc @@ -10,7 +10,6 @@ #include "base/logging.h" #include "cc/delay_based_time_source.h" #include "cc/time_source.h" -#include <wtf/CurrentTime.h> namespace { diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc index f287aec..37add03 100644 --- a/cc/gl_renderer.cc +++ b/cc/gl_renderer.cc @@ -41,7 +41,6 @@ #include <set> #include <string> #include <vector> -#include <wtf/CurrentTime.h> using namespace std; using WebKit::WebGraphicsContext3D; diff --git a/cc/input_handler.h b/cc/input_handler.h index 0e1e44c..def6c39 100644 --- a/cc/input_handler.h +++ b/cc/input_handler.h @@ -6,6 +6,7 @@ #define CCInputHandler_h #include "base/basictypes.h" +#include "base/time.h" namespace cc { @@ -52,8 +53,8 @@ public: virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anchorPoint, float pageScale, - double startTime, - double duration) = 0; + base::TimeTicks startTime, + base::TimeDelta duration) = 0; // Request another callback to InputHandler::animate(). virtual void scheduleAnimation() = 0; @@ -71,7 +72,7 @@ public: virtual ~InputHandler() { } virtual void bindToClient(InputHandlerClient*) = 0; - virtual void animate(double monotonicTime) = 0; + virtual void animate(base::TimeTicks time) = 0; protected: InputHandler() { } diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc index 7c70ef9..3377b75 100644 --- a/cc/layer_tree_host.cc +++ b/cc/layer_tree_host.cc @@ -223,11 +223,11 @@ void LayerTreeHost::acquireLayerTextures() m_proxy->acquireLayerTextures(); } -void LayerTreeHost::updateAnimations(double monotonicFrameBeginTime) +void LayerTreeHost::updateAnimations(base::TimeTicks frameBeginTime) { m_animating = true; - m_client->animate(monotonicFrameBeginTime); - animateLayers(monotonicFrameBeginTime); + m_client->animate((frameBeginTime - base::TimeTicks()).InSecondsF()); + animateLayers(frameBeginTime); m_animating = false; m_renderingStats.numAnimationFrames++; @@ -392,7 +392,7 @@ bool LayerTreeHost::commitRequested() const return m_proxy->commitRequested(); } -void LayerTreeHost::setAnimationEvents(scoped_ptr<AnimationEventsVector> events, double wallClockTime) +void LayerTreeHost::setAnimationEvents(scoped_ptr<AnimationEventsVector> events, base::Time wallClockTime) { DCHECK(ThreadProxy::isMainThread()); setAnimationEventsRecursive(*events.get(), m_rootLayer.get(), wallClockTime); @@ -451,9 +451,9 @@ void LayerTreeHost::setVisible(bool visible) m_proxy->setVisible(visible); } -void LayerTreeHost::startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double durationSec) +void LayerTreeHost::startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, base::TimeDelta duration) { - m_proxy->startPageScaleAnimation(targetPosition, useAnchor, scale, durationSec); + m_proxy->startPageScaleAnimation(targetPosition, useAnchor, scale, duration); } void LayerTreeHost::loseContext(int numTimes) @@ -769,22 +769,23 @@ void LayerTreeHost::setDeviceScaleFactor(float deviceScaleFactor) setNeedsCommit(); } -void LayerTreeHost::animateLayers(double monotonicTime) +void LayerTreeHost::animateLayers(base::TimeTicks time) { if (!Settings::acceleratedAnimationEnabled() || !m_needsAnimateLayers) return; TRACE_EVENT0("cc", "LayerTreeHostImpl::animateLayers"); - m_needsAnimateLayers = animateLayersRecursive(m_rootLayer.get(), monotonicTime); + m_needsAnimateLayers = animateLayersRecursive(m_rootLayer.get(), time); } -bool LayerTreeHost::animateLayersRecursive(Layer* current, double monotonicTime) +bool LayerTreeHost::animateLayersRecursive(Layer* current, base::TimeTicks time) { if (!current) return false; bool subtreeNeedsAnimateLayers = false; LayerAnimationController* currentController = current->layerAnimationController(); + double monotonicTime = (time - base::TimeTicks()).InSecondsF(); currentController->animate(monotonicTime, 0); // If the current controller still has an active animation, we must continue animating layers. @@ -792,14 +793,14 @@ bool LayerTreeHost::animateLayersRecursive(Layer* current, double monotonicTime) subtreeNeedsAnimateLayers = true; for (size_t i = 0; i < current->children().size(); ++i) { - if (animateLayersRecursive(current->children()[i].get(), monotonicTime)) + if (animateLayersRecursive(current->children()[i].get(), time)) subtreeNeedsAnimateLayers = true; } return subtreeNeedsAnimateLayers; } -void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& events, Layer* layer, double wallClockTime) +void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& events, Layer* layer, base::Time wallClockTime) { if (!layer) return; @@ -807,9 +808,9 @@ void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& eve for (size_t eventIndex = 0; eventIndex < events.size(); ++eventIndex) { if (layer->id() == events[eventIndex].layerId) { if (events[eventIndex].type == AnimationEvent::Started) - layer->notifyAnimationStarted(events[eventIndex], wallClockTime); + layer->notifyAnimationStarted(events[eventIndex], wallClockTime.ToDoubleT()); else - layer->notifyAnimationFinished(wallClockTime); + layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); } } diff --git a/cc/layer_tree_host.h b/cc/layer_tree_host.h index 12e7750..bdf5759 100644 --- a/cc/layer_tree_host.h +++ b/cc/layer_tree_host.h @@ -13,6 +13,7 @@ #include "base/hash_tables.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" +#include "base/time.h" #include "cc/animation_events.h" #include "cc/graphics_context.h" #include "cc/layer_tree_host_client.h" @@ -106,7 +107,7 @@ public: // LayerTreeHost interface to Proxy. void willBeginFrame() { m_client->willBeginFrame(); } void didBeginFrame() { m_client->didBeginFrame(); } - void updateAnimations(double monotonicFrameBeginTime); + void updateAnimations(base::TimeTicks monotonicFrameBeginTime); void layout(); void beginCommitOnImplThread(LayerTreeHostImpl*); void finishCommitOnImplThread(LayerTreeHostImpl*); @@ -163,7 +164,7 @@ public: void setNeedsRedraw(); bool commitRequested() const; - void setAnimationEvents(scoped_ptr<AnimationEventsVector>, double wallClockTime); + void setAnimationEvents(scoped_ptr<AnimationEventsVector>, base::Time wallClockTime); virtual void didAddAnimation(); Layer* rootLayer() { return m_rootLayer.get(); } @@ -188,7 +189,7 @@ public: bool visible() const { return m_visible; } void setVisible(bool); - void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double durationSec); + void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, base::TimeDelta duration); void applyScrollAndScale(const ScrollAndScaleSet&); void setImplTransform(const WebKit::WebTransformationMatrix&); @@ -230,9 +231,9 @@ private: void setPrioritiesForLayers(const LayerList&); size_t calculateMemoryForRenderSurfaces(const LayerList& updateList); - void animateLayers(double monotonicTime); - bool animateLayersRecursive(Layer* current, double monotonicTime); - void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, double wallClockTime); + void animateLayers(base::TimeTicks monotonicTime); + bool animateLayersRecursive(Layer* current, base::TimeTicks time); + void setAnimationEventsRecursive(const AnimationEventsVector&, Layer*, base::Time wallClockTime); bool m_animating; bool m_needsAnimateLayers; diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc index eca5aa2..272112c 100644 --- a/cc/layer_tree_host_impl.cc +++ b/cc/layer_tree_host_impl.cc @@ -31,7 +31,6 @@ #include "cc/single_thread_proxy.h" #include "cc/software_renderer.h" #include "cc/texture_uploader.h" -#include <wtf/CurrentTime.h> #include <algorithm> using WebKit::WebTransformationMatrix; @@ -175,7 +174,7 @@ public: // would be handled by the proxy/scheduler and this could be removed. DebugScopedSetImplThread impl; - m_layerTreeHostImpl->animate(monotonicallyIncreasingTime(), currentTime()); + m_layerTreeHostImpl->animate(base::TimeTicks::Now(), base::Time::Now()); } void setActive(bool active) @@ -292,14 +291,14 @@ GraphicsContext* LayerTreeHostImpl::context() const return m_context.get(); } -void LayerTreeHostImpl::animate(double monotonicTime, double wallClockTime) +void LayerTreeHostImpl::animate(base::TimeTicks monotonicTime, base::Time wallClockTime) { animatePageScale(monotonicTime); animateLayers(monotonicTime, wallClockTime); animateScrollbars(monotonicTime); } -void LayerTreeHostImpl::startPageScaleAnimation(const IntSize& targetPosition, bool anchorPoint, float pageScale, double startTime, double duration) +void LayerTreeHostImpl::startPageScaleAnimation(const IntSize& targetPosition, bool anchorPoint, float pageScale, base::TimeTicks startTime, base::TimeDelta duration) { if (!m_rootScrollLayerImpl) return; @@ -310,15 +309,16 @@ void LayerTreeHostImpl::startPageScaleAnimation(const IntSize& targetPosition, b IntSize scaledContentSize = contentSize(); scaledContentSize.scale(m_pinchZoomViewport.pageScaleDelta()); - m_pageScaleAnimation = PageScaleAnimation::create(scrollTotal, scaleTotal, m_deviceViewportSize, scaledContentSize, startTime); + double startTimeSeconds = (startTime - base::TimeTicks()).InSecondsF(); + m_pageScaleAnimation = PageScaleAnimation::create(scrollTotal, scaleTotal, m_deviceViewportSize, scaledContentSize, startTimeSeconds); if (anchorPoint) { IntSize windowAnchor(targetPosition); windowAnchor.scale(scaleTotal / pageScale); windowAnchor -= scrollTotal; - m_pageScaleAnimation->zoomWithAnchor(windowAnchor, pageScale, duration); + m_pageScaleAnimation->zoomWithAnchor(windowAnchor, pageScale, duration.InSecondsF()); } else - m_pageScaleAnimation->zoomTo(targetPosition, pageScale, duration); + m_pageScaleAnimation->zoomTo(targetPosition, pageScale, duration.InSecondsF()); m_client->setNeedsRedrawOnImplThread(); m_client->setNeedsCommitOnImplThread(); @@ -475,14 +475,15 @@ bool LayerTreeHostImpl::calculateRenderPasses(FrameData& frame) return drawFrame; } -void LayerTreeHostImpl::animateLayersRecursive(LayerImpl* current, double monotonicTime, double wallClockTime, AnimationEventsVector* events, bool& didAnimate, bool& needsAnimateLayers) +void LayerTreeHostImpl::animateLayersRecursive(LayerImpl* current, base::TimeTicks monotonicTime, base::Time wallClockTime, AnimationEventsVector* events, bool& didAnimate, bool& needsAnimateLayers) { bool subtreeNeedsAnimateLayers = false; LayerAnimationController* currentController = current->layerAnimationController(); bool hadActiveAnimation = currentController->hasActiveAnimation(); - currentController->animate(monotonicTime, events); + double monotonicTimeSeconds = (monotonicTime - base::TimeTicks()).InSecondsF(); + currentController->animate(monotonicTimeSeconds, events); bool startedAnimation = events->size() > 0; // We animated if we either ticked a running animation, or started a new animation. @@ -665,7 +666,9 @@ void LayerTreeHostImpl::setManagedMemoryPolicy(const ManagedMemoryPolicy& policy void LayerTreeHostImpl::onVSyncParametersChanged(double monotonicTimebase, double intervalInSeconds) { - m_client->onVSyncParametersChanged(monotonicTimebase, intervalInSeconds); + base::TimeTicks timebase = base::TimeTicks::FromInternalValue(monotonicTimebase * base::Time::kMicrosecondsPerSecond); + base::TimeDelta interval = base::TimeDelta::FromMicroseconds(intervalInSeconds * base::Time::kMicrosecondsPerSecond); + m_client->onVSyncParametersChanged(timebase, interval); } void LayerTreeHostImpl::drawLayers(const FrameData& frame) @@ -1368,11 +1371,12 @@ void LayerTreeHostImpl::setFullRootLayerDamage() } } -void LayerTreeHostImpl::animatePageScale(double monotonicTime) +void LayerTreeHostImpl::animatePageScale(base::TimeTicks time) { if (!m_pageScaleAnimation || !m_rootScrollLayerImpl) return; + double monotonicTime = (time - base::TimeTicks()).InSecondsF(); IntSize scrollTotal = flooredIntSize(m_rootScrollLayerImpl->scrollPosition() + m_rootScrollLayerImpl->scrollDelta()); setPageScaleDelta(m_pageScaleAnimation->pageScaleAtTime(monotonicTime) / m_pinchZoomViewport.pageScaleFactor()); @@ -1387,7 +1391,7 @@ void LayerTreeHostImpl::animatePageScale(double monotonicTime) } } -void LayerTreeHostImpl::animateLayers(double monotonicTime, double wallClockTime) +void LayerTreeHostImpl::animateLayers(base::TimeTicks monotonicTime, base::Time wallClockTime) { if (!Settings::acceleratedAnimationEnabled() || !m_needsAnimateLayers || !m_rootLayerImpl) return; @@ -1472,22 +1476,23 @@ void LayerTreeHostImpl::renderingStats(RenderingStats* stats) const stats->numMainThreadScrolls = m_numMainThreadScrolls; } -void LayerTreeHostImpl::animateScrollbars(double monotonicTime) +void LayerTreeHostImpl::animateScrollbars(base::TimeTicks time) { - animateScrollbarsRecursive(m_rootLayerImpl.get(), monotonicTime); + animateScrollbarsRecursive(m_rootLayerImpl.get(), time); } -void LayerTreeHostImpl::animateScrollbarsRecursive(LayerImpl* layer, double monotonicTime) +void LayerTreeHostImpl::animateScrollbarsRecursive(LayerImpl* layer, base::TimeTicks time) { if (!layer) return; ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimationController(); + double monotonicTime = (time - base::TimeTicks()).InSecondsF(); if (scrollbarController && scrollbarController->animate(monotonicTime)) m_client->setNeedsRedrawOnImplThread(); for (size_t i = 0; i < layer->children().size(); ++i) - animateScrollbarsRecursive(layer->children()[i], monotonicTime); + animateScrollbarsRecursive(layer->children()[i], time); } } // namespace cc diff --git a/cc/layer_tree_host_impl.h b/cc/layer_tree_host_impl.h index f864d3e..f6a4c65 100644 --- a/cc/layer_tree_host_impl.h +++ b/cc/layer_tree_host_impl.h @@ -36,11 +36,11 @@ class LayerTreeHostImplClient { public: virtual void didLoseContextOnImplThread() = 0; virtual void onSwapBuffersCompleteOnImplThread() = 0; - virtual void onVSyncParametersChanged(double monotonicTimebase, double intervalInSeconds) = 0; + virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDelta interval) = 0; virtual void onCanDrawStateChanged(bool canDraw) = 0; virtual void setNeedsRedrawOnImplThread() = 0; virtual void setNeedsCommitOnImplThread() = 0; - virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, double wallClockTime) = 0; + virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, base::Time wallClockTime) = 0; // Returns true if resources were deleted by this call. virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) = 0; virtual void sendManagedMemoryStats() = 0; @@ -114,7 +114,7 @@ public: virtual void pinchGestureBegin() OVERRIDE; virtual void pinchGestureUpdate(float, const IntPoint&) OVERRIDE; virtual void pinchGestureEnd() OVERRIDE; - virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anchorPoint, float pageScale, double startTime, double duration) OVERRIDE; + virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anchorPoint, float pageScale, base::TimeTicks startTime, base::TimeDelta duration) OVERRIDE; virtual void scheduleAnimation() OVERRIDE; struct FrameData : public RenderPassSink { @@ -134,7 +134,7 @@ public: // Virtual for testing. virtual void beginCommit(); virtual void commitComplete(); - virtual void animate(double monotonicTime, double wallClockTime); + virtual void animate(base::TimeTicks monotonicTime, base::Time wallClockTime); // Returns false if problems occured preparing the frame, and we should try // to avoid displaying the frame. If prepareToDraw is called, @@ -210,7 +210,7 @@ public: scoped_ptr<ScrollAndScaleSet> processScrollDeltas(); WebKit::WebTransformationMatrix implTransform() const; - void startPageScaleAnimation(const IntSize& tragetPosition, bool useAnchor, float scale, double durationSec); + void startPageScaleAnimation(const IntSize& tragetPosition, bool useAnchor, float scale, base::TimeDelta duration); SkColor backgroundColor() const { return m_backgroundColor; } void setBackgroundColor(SkColor color) { m_backgroundColor = color; } @@ -264,14 +264,14 @@ public: protected: LayerTreeHostImpl(const LayerTreeSettings&, LayerTreeHostImplClient*); - void animatePageScale(double monotonicTime); - void animateScrollbars(double monotonicTime); + void animatePageScale(base::TimeTicks monotonicTime); + void animateScrollbars(base::TimeTicks monotonicTime); // Exposed for testing. void calculateRenderSurfaceLayerList(LayerList&); // Virtual for testing. - virtual void animateLayers(double monotonicTime, double wallClockTime); + virtual void animateLayers(base::TimeTicks monotonicTime, base::Time wallClockTime); // Virtual for testing. virtual base::TimeDelta lowFrequencyAnimationInterval() const; @@ -292,7 +292,7 @@ private: // only be called from prepareToDraw, as didDrawAllLayers must be called // if this helper function is called. bool calculateRenderPasses(FrameData&); - void animateLayersRecursive(LayerImpl*, double monotonicTime, double wallClockTime, AnimationEventsVector*, bool& didAnimate, bool& needsAnimateLayers); + void animateLayersRecursive(LayerImpl*, base::TimeTicks monotonicTime, base::Time wallClockTime, AnimationEventsVector*, bool& didAnimate, bool& needsAnimateLayers); void setBackgroundTickingEnabled(bool); IntSize contentSize() const; @@ -301,7 +301,7 @@ private: bool ensureRenderSurfaceLayerList(); void clearCurrentlyScrollingLayer(); - void animateScrollbarsRecursive(LayerImpl*, double monotonicTime); + void animateScrollbarsRecursive(LayerImpl*, base::TimeTicks monotonicTime); void dumpRenderSurfaces(std::string*, int indent, const LayerImpl*) const; diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc index 106a702..999c63a 100644 --- a/cc/layer_tree_host_impl_unittest.cc +++ b/cc/layer_tree_host_impl_unittest.cc @@ -82,11 +82,11 @@ public: virtual void didLoseContextOnImplThread() OVERRIDE { } virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE { } - virtual void onVSyncParametersChanged(double, double) OVERRIDE { } + virtual void onVSyncParametersChanged(base::TimeTicks, base::TimeDelta) OVERRIDE { } virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { m_onCanDrawStateChangedCalled = true; } virtual void setNeedsRedrawOnImplThread() OVERRIDE { m_didRequestRedraw = true; } virtual void setNeedsCommitOnImplThread() OVERRIDE { m_didRequestCommit = true; } - virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, double wallClockTime) OVERRIDE { } + virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, base::Time wallClockTime) OVERRIDE { } virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) OVERRIDE { return m_reduceMemoryResult; } virtual void sendManagedMemoryStats() OVERRIDE { } @@ -635,10 +635,10 @@ TEST_P(LayerTreeHostImplTest, pageScaleAnimation) const float minPageScale = Settings::pageScalePinchZoomEnabled() ? 1 : 0.5; const float maxPageScale = 4; - const double startTime = 1; - const double duration = 0.1; - const double halfwayThroughAnimation = startTime + duration / 2; - const double endTime = startTime + duration; + const base::TimeTicks startTime = base::TimeTicks() + base::TimeDelta::FromSeconds(1); + const base::TimeDelta duration = base::TimeDelta::FromMilliseconds(100); + const base::TimeTicks halfwayThroughAnimation = startTime + duration / 2; + const base::TimeTicks endTime = startTime + duration; const WebTransformationMatrix identityScaleTransform; // Non-anchor zoom-in @@ -648,9 +648,9 @@ TEST_P(LayerTreeHostImplTest, pageScaleAnimation) scrollLayer->setScrollPosition(IntPoint(50, 50)); m_hostImpl->startPageScaleAnimation(IntSize(0, 0), false, 2, startTime, duration); - m_hostImpl->animate(halfwayThroughAnimation, halfwayThroughAnimation); + m_hostImpl->animate(halfwayThroughAnimation, base::Time()); EXPECT_TRUE(m_didRequestRedraw); - m_hostImpl->animate(endTime, endTime); + m_hostImpl->animate(endTime, base::Time()); EXPECT_TRUE(m_didRequestCommit); scoped_ptr<ScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas(); @@ -665,7 +665,7 @@ TEST_P(LayerTreeHostImplTest, pageScaleAnimation) scrollLayer->setScrollPosition(IntPoint(50, 50)); m_hostImpl->startPageScaleAnimation(IntSize(25, 25), true, minPageScale, startTime, duration); - m_hostImpl->animate(endTime, endTime); + m_hostImpl->animate(endTime, base::Time()); EXPECT_TRUE(m_didRequestRedraw); EXPECT_TRUE(m_didRequestCommit); @@ -756,11 +756,10 @@ TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhileAnimatingPage const float minPageScale = Settings::pageScalePinchZoomEnabled() ? 1 : 0.5; const float maxPageScale = 4; - const double startTime = 1; - const double duration = 0.1; - const double halfwayThroughAnimation = startTime + duration / 2; - const double endTime = startTime + duration; - + const base::TimeTicks startTime = base::TimeTicks() + base::TimeDelta::FromSeconds(1); + const base::TimeDelta duration = base::TimeDelta::FromMilliseconds(100); + const base::TimeTicks halfwayThroughAnimation = startTime + duration / 2; + const base::TimeTicks endTime = startTime + duration; // Start a page scale animation. const float pageScaleDelta = 2; m_hostImpl->setPageScaleFactorAndLimits(1, minPageScale, maxPageScale); @@ -768,7 +767,7 @@ TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhileAnimatingPage // We should immediately get the final zoom and scroll values for the // animation. - m_hostImpl->animate(halfwayThroughAnimation, halfwayThroughAnimation); + m_hostImpl->animate(halfwayThroughAnimation, base::Time()); scoped_ptr<ScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas(); if (!Settings::pageScalePinchZoomEnabled()) { @@ -787,7 +786,7 @@ TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhileAnimatingPage // The final page scale and scroll deltas should match what we got // earlier. - m_hostImpl->animate(endTime, endTime); + m_hostImpl->animate(endTime, base::Time()); scrollInfo = m_hostImpl->processScrollDeltas(); EXPECT_EQ(scrollInfo->pageScaleDelta, pageScaleDelta); expectContains(*scrollInfo, scrollLayer->id(), IntSize(25, 25)); diff --git a/cc/layer_tree_host_unittest.cc b/cc/layer_tree_host_unittest.cc index f85111e..030ee97 100644 --- a/cc/layer_tree_host_unittest.cc +++ b/cc/layer_tree_host_unittest.cc @@ -504,7 +504,7 @@ public: postSetNeedsCommitToMainThread(); } - virtual void animate(double monotonicTime) OVERRIDE + virtual void animate(base::TimeTicks monotonicTime) OVERRIDE { // We skip the first commit becasue its the commit that populates the // impl thread with a tree. @@ -564,7 +564,7 @@ public: postSetNeedsAnimateToMainThread(); } - virtual void animate(double) OVERRIDE + virtual void animate(base::TimeTicks) OVERRIDE { if (!m_numAnimates) { m_layerTreeHost->setNeedsAnimate(); @@ -595,7 +595,6 @@ public: : m_numAnimates(0) , m_receivedAnimationStartedNotification(false) , m_startTime(0) - , m_firstMonotonicTime(0) { } @@ -604,7 +603,7 @@ public: postAddInstantAnimationToMainThread(); } - virtual void animateLayers(LayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) OVERRIDE + virtual void animateLayers(LayerTreeHostImpl* layerTreeHostImpl, base::TimeTicks monotonicTime) OVERRIDE { if (!m_numAnimates) { // The animation had zero duration so layerTreeHostImpl should no @@ -615,8 +614,6 @@ public: return; } EXPECT_LT(0, m_startTime); - EXPECT_LT(0, m_firstMonotonicTime); - EXPECT_NE(m_startTime, m_firstMonotonicTime); EXPECT_TRUE(m_receivedAnimationStartedNotification); endTest(); } @@ -635,7 +632,7 @@ private: int m_numAnimates; bool m_receivedAnimationStartedNotification; double m_startTime; - double m_firstMonotonicTime; + base::TimeTicks m_firstMonotonicTime; }; TEST_F(LayerTreeHostTestAddAnimation, runMultiThread) @@ -661,7 +658,7 @@ public: { } - virtual void animateLayers(LayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) OVERRIDE + virtual void animateLayers(LayerTreeHostImpl* layerTreeHostImpl, base::TimeTicks monotonicTime) OVERRIDE { m_startedAnimating = true; } @@ -703,7 +700,7 @@ public: // Use willAnimateLayers to set visible false before the animation runs and // causes a commit, so we block the second visible animate in single-thread // mode. - virtual void willAnimateLayers(LayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) OVERRIDE + virtual void willAnimateLayers(LayerTreeHostImpl* layerTreeHostImpl, base::TimeTicks monotonicTime) OVERRIDE { if (m_numAnimates < 2) { if (!m_numAnimates) { @@ -738,7 +735,7 @@ public: postAddAnimationToMainThread(); } - virtual void animateLayers(LayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) OVERRIDE + virtual void animateLayers(LayerTreeHostImpl* layerTreeHostImpl, base::TimeTicks monotonicTime) OVERRIDE { const ActiveAnimation* animation = m_layerTreeHost->rootLayer()->layerAnimationController()->getActiveAnimation(0, ActiveAnimation::Opacity); if (!animation) @@ -811,8 +808,8 @@ public: postAddAnimationToMainThread(); } - // This is guaranteed to be called before LayerTreeHostImpl::animateLayers. - virtual void willAnimateLayers(LayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) OVERRIDE + // This is guaranteed to be called before CCLayerTreeHostImpl::animateLayers. + virtual void willAnimateLayers(LayerTreeHostImpl* layerTreeHostImpl, base::TimeTicks monotonicTime) OVERRIDE { m_layerTreeHostImpl = layerTreeHostImpl; } @@ -1072,7 +1069,7 @@ public: void requestStartPageScaleAnimation() { - layerTreeHost()->startPageScaleAnimation(IntSize(), false, 1.25, 0); + layerTreeHost()->startPageScaleAnimation(IntSize(), false, 1.25, base::TimeDelta()); } virtual void drawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE @@ -3144,7 +3141,7 @@ public: postSetNeedsCommitToMainThread(); } - virtual void animate(double) OVERRIDE + virtual void animate(base::TimeTicks) OVERRIDE { m_layerTreeHost->setNeedsAnimate(); } @@ -7,6 +7,7 @@ #include "base/basictypes.h" #include "base/logging.h" +#include "base/time.h" #include <public/WebCompositorOutputSurface.h> namespace cc { @@ -35,7 +36,7 @@ public: virtual bool compositeAndReadback(void *pixels, const IntRect&) = 0; - virtual void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double durationSec) = 0; + virtual void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, base::TimeDelta duration) = 0; virtual void finishAllRendering() = 0; diff --git a/cc/resource_update_controller.cc b/cc/resource_update_controller.cc index c70bec7..498f884 100644 --- a/cc/resource_update_controller.cc +++ b/cc/resource_update_controller.cc @@ -16,7 +16,6 @@ #include <limits> #include <public/WebGraphicsContext3D.h> #include <public/WebSharedGraphicsContext3D.h> -#include <wtf/CurrentTime.h> using WebKit::WebGraphicsContext3D; using WebKit::WebSharedGraphicsContext3D; diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc index 1089e30..0cfecccc 100644 --- a/cc/single_thread_proxy.cc +++ b/cc/single_thread_proxy.cc @@ -12,7 +12,6 @@ #include "cc/layer_tree_host.h" #include "cc/resource_update_controller.h" #include "cc/timer.h" -#include <wtf/CurrentTime.h> namespace cc { @@ -64,9 +63,9 @@ bool SingleThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect) return true; } -void SingleThreadProxy::startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double duration) +void SingleThreadProxy::startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, base::TimeDelta duration) { - m_layerTreeHostImpl->startPageScaleAnimation(targetPosition, useAnchor, scale, monotonicallyIncreasingTime(), duration); + m_layerTreeHostImpl->startPageScaleAnimation(targetPosition, useAnchor, scale, base::TimeTicks::Now(), duration); } void SingleThreadProxy::finishAllRendering() @@ -276,7 +275,7 @@ void SingleThreadProxy::setNeedsCommitOnImplThread() m_layerTreeHost->scheduleComposite(); } -void SingleThreadProxy::postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector> events, double wallClockTime) +void SingleThreadProxy::postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector> events, base::Time wallClockTime) { DCHECK(Proxy::isImplThread()); DebugScopedSetMainThread main; @@ -368,9 +367,7 @@ bool SingleThreadProxy::doComposite() if (!m_layerTreeHostImpl->visible()) return false; - double monotonicTime = monotonicallyIncreasingTime(); - double wallClockTime = currentTime(); - m_layerTreeHostImpl->animate(monotonicTime, wallClockTime); + m_layerTreeHostImpl->animate(base::TimeTicks::Now(), base::Time::Now()); // We guard prepareToDraw() with canDraw() because it always returns a valid frame, so can only // be used when such a frame is possible. Since drawLayers() depends on the result of diff --git a/cc/single_thread_proxy.h b/cc/single_thread_proxy.h index ca6769f..93f8c09 100644 --- a/cc/single_thread_proxy.h +++ b/cc/single_thread_proxy.h @@ -23,7 +23,7 @@ public: // Proxy implementation virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; - virtual void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double duration) OVERRIDE; + virtual void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, base::TimeDelta duration) OVERRIDE; virtual void finishAllRendering() OVERRIDE; virtual bool isStarted() const OVERRIDE; virtual bool initializeContext() OVERRIDE; @@ -49,11 +49,11 @@ public: // LayerTreeHostImplClient implementation virtual void didLoseContextOnImplThread() OVERRIDE { } virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; - virtual void onVSyncParametersChanged(double monotonicTimebase, double intervalInSeconds) OVERRIDE { } + virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDelta interval) OVERRIDE { } virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE { } virtual void setNeedsRedrawOnImplThread() OVERRIDE; virtual void setNeedsCommitOnImplThread() OVERRIDE; - virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, double wallClockTime) OVERRIDE; + virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, base::Time wallClockTime) OVERRIDE; virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) OVERRIDE; virtual void sendManagedMemoryStats() OVERRIDE; diff --git a/cc/test/layer_tree_test_common.cc b/cc/test/layer_tree_test_common.cc index 846e807..60b3fb4 100644 --- a/cc/test/layer_tree_test_common.cc +++ b/cc/test/layer_tree_test_common.cc @@ -125,7 +125,7 @@ void MockLayerTreeHostImpl::drawLayers(const FrameData& frame) m_testHooks->drawLayersOnThread(this); } -void MockLayerTreeHostImpl::animateLayers(double monotonicTime, double wallClockTime) +void MockLayerTreeHostImpl::animateLayers(base::TimeTicks monotonicTime, base::Time wallClockTime) { m_testHooks->willAnimateLayers(this, monotonicTime); LayerTreeHostImpl::animateLayers(monotonicTime, wallClockTime); @@ -216,7 +216,7 @@ public: virtual void animate(double monotonicTime) OVERRIDE { - m_testHooks->animate(monotonicTime); + m_testHooks->animate(base::TimeTicks::FromInternalValue(monotonicTime * base::Time::kMicrosecondsPerSecond)); } virtual void layout() OVERRIDE diff --git a/cc/test/layer_tree_test_common.h b/cc/test/layer_tree_test_common.h index d1378c8..ea82b05 100644 --- a/cc/test/layer_tree_test_common.h +++ b/cc/test/layer_tree_test_common.h @@ -30,10 +30,10 @@ public: virtual void commitCompleteOnThread(cc::LayerTreeHostImpl*) { } virtual bool prepareToDrawOnThread(cc::LayerTreeHostImpl*); virtual void drawLayersOnThread(cc::LayerTreeHostImpl*) { } - virtual void animateLayers(cc::LayerTreeHostImpl*, double monotonicTime) { } - virtual void willAnimateLayers(cc::LayerTreeHostImpl*, double monotonicTime) { } + virtual void animateLayers(cc::LayerTreeHostImpl*, base::TimeTicks monotonicTime) { } + virtual void willAnimateLayers(cc::LayerTreeHostImpl*, base::TimeTicks monotonicTime) { } virtual void applyScrollAndScale(const cc::IntSize&, float) { } - virtual void animate(double monotonicTime) { } + virtual void animate(base::TimeTicks monotonicTime) { } virtual void layout() { } virtual void didRecreateOutputSurface(bool succeeded) { } virtual void didAddAnimation() { } @@ -158,7 +158,7 @@ public: using LayerTreeHostImpl::calculateRenderSurfaceLayerList; protected: - virtual void animateLayers(double monotonicTime, double wallClockTime) OVERRIDE; + virtual void animateLayers(base::TimeTicks monotonicTime, base::Time wallClockTime) OVERRIDE; virtual base::TimeDelta lowFrequencyAnimationInterval() const OVERRIDE; private: diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc index e110f5a..023aad0 100644 --- a/cc/thread_proxy.cc +++ b/cc/thread_proxy.cc @@ -17,7 +17,6 @@ #include "cc/scoped_thread_proxy.h" #include "cc/thread_task.h" #include <public/WebSharedGraphicsContext3D.h> -#include <wtf/CurrentTime.h> using WebKit::WebSharedGraphicsContext3D; @@ -118,17 +117,17 @@ void ThreadProxy::requestReadbackOnImplThread(ReadbackRequest* request) m_schedulerOnImplThread->setNeedsForcedRedraw(); } -void ThreadProxy::startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double duration) +void ThreadProxy::startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, base::TimeDelta duration) { DCHECK(Proxy::isMainThread()); Proxy::implThread()->postTask(createThreadTask(this, &ThreadProxy::requestStartPageScaleAnimationOnImplThread, targetPosition, useAnchor, scale, duration)); } -void ThreadProxy::requestStartPageScaleAnimationOnImplThread(IntSize targetPosition, bool useAnchor, float scale, double duration) +void ThreadProxy::requestStartPageScaleAnimationOnImplThread(IntSize targetPosition, bool useAnchor, float scale, base::TimeDelta duration) { DCHECK(Proxy::isImplThread()); if (m_layerTreeHostImpl.get()) - m_layerTreeHostImpl->startPageScaleAnimation(targetPosition, useAnchor, scale, monotonicallyIncreasingTime(), duration); + m_layerTreeHostImpl->startPageScaleAnimation(targetPosition, useAnchor, scale, base::TimeTicks::Now(), duration); } void ThreadProxy::finishAllRendering() @@ -314,12 +313,10 @@ void ThreadProxy::onSwapBuffersCompleteOnImplThread() m_mainThreadProxy->postTask(createThreadTask(this, &ThreadProxy::didCompleteSwapBuffers)); } -void ThreadProxy::onVSyncParametersChanged(double monotonicTimebase, double intervalInSeconds) +void ThreadProxy::onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDelta interval) { DCHECK(isImplThread()); - TRACE_EVENT2("cc", "ThreadProxy::onVSyncParametersChanged", "monotonicTimebase", monotonicTimebase, "intervalInSeconds", intervalInSeconds); - base::TimeTicks timebase = base::TimeTicks::FromInternalValue(monotonicTimebase * base::Time::kMicrosecondsPerSecond); - base::TimeDelta interval = base::TimeDelta::FromMicroseconds(intervalInSeconds * base::Time::kMicrosecondsPerSecond); + TRACE_EVENT2("cc", "ThreadProxy::onVSyncParametersChanged", "timebase", (timebase - base::TimeTicks()).InMilliseconds(), "interval", interval.InMilliseconds()); m_schedulerOnImplThread->setTimebaseAndInterval(timebase, interval); } @@ -345,7 +342,7 @@ void ThreadProxy::setNeedsForcedCommitOnImplThread() m_schedulerOnImplThread->setNeedsForcedCommit(); } -void ThreadProxy::postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector> events, double wallClockTime) +void ThreadProxy::postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector> events, base::Time wallClockTime) { DCHECK(isImplThread()); TRACE_EVENT0("cc", "ThreadProxy::postAnimationEventsToMainThreadOnImplThread"); @@ -505,7 +502,7 @@ void ThreadProxy::scheduledActionBeginFrame() TRACE_EVENT0("cc", "ThreadProxy::scheduledActionBeginFrame"); DCHECK(!m_pendingBeginFrameRequest); m_pendingBeginFrameRequest = make_scoped_ptr(new BeginFrameAndCommitState()); - m_pendingBeginFrameRequest->monotonicFrameBeginTime = monotonicallyIncreasingTime(); + m_pendingBeginFrameRequest->monotonicFrameBeginTime = base::TimeTicks::Now(); m_pendingBeginFrameRequest->scrollInfo = m_layerTreeHostImpl->processScrollDeltas(); m_pendingBeginFrameRequest->implTransform = m_layerTreeHostImpl->implTransform(); m_pendingBeginFrameRequest->memoryAllocationLimitBytes = m_layerTreeHostImpl->memoryAllocationLimitBytes(); @@ -738,8 +735,8 @@ ScheduledActionDrawAndSwapResult ThreadProxy::scheduledActionDrawAndSwapInternal return result; // FIXME: compute the frame display time more intelligently - double monotonicTime = monotonicallyIncreasingTime(); - double wallClockTime = currentTime(); + base::TimeTicks monotonicTime = base::TimeTicks::Now(); + base::Time wallClockTime = base::Time::Now(); if (m_inputHandlerOnImplThread.get()) m_inputHandlerOnImplThread->animate(monotonicTime); @@ -864,7 +861,7 @@ void ThreadProxy::didCompleteSwapBuffers() m_layerTreeHost->didCompleteSwapBuffers(); } -void ThreadProxy::setAnimationEvents(AnimationEventsVector* passed_events, double wallClockTime) +void ThreadProxy::setAnimationEvents(AnimationEventsVector* passed_events, base::Time wallClockTime) { scoped_ptr<AnimationEventsVector> events(make_scoped_ptr(passed_events)); @@ -1005,7 +1002,6 @@ void ThreadProxy::renderingStatsOnImplThread(CompletionEvent* completion, Render } ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() - : monotonicFrameBeginTime(0) { } diff --git a/cc/thread_proxy.h b/cc/thread_proxy.h index 695ac80..d20e8f4 100644 --- a/cc/thread_proxy.h +++ b/cc/thread_proxy.h @@ -31,7 +31,7 @@ public: // Proxy implementation virtual bool compositeAndReadback(void *pixels, const IntRect&) OVERRIDE; - virtual void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, double duration) OVERRIDE; + virtual void startPageScaleAnimation(const IntSize& targetPosition, bool useAnchor, float scale, base::TimeDelta duration) OVERRIDE; virtual void finishAllRendering() OVERRIDE; virtual bool isStarted() const OVERRIDE; virtual bool initializeContext() OVERRIDE; @@ -57,11 +57,11 @@ public: // LayerTreeHostImplClient implementation virtual void didLoseContextOnImplThread() OVERRIDE; virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE; - virtual void onVSyncParametersChanged(double monotonicTimebase, double intervalInSeconds) OVERRIDE; + virtual void onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDelta interval) OVERRIDE; virtual void onCanDrawStateChanged(bool canDraw) OVERRIDE; virtual void setNeedsRedrawOnImplThread() OVERRIDE; virtual void setNeedsCommitOnImplThread() OVERRIDE; - virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, double wallClockTime) OVERRIDE; + virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector>, base::Time wallClockTime) OVERRIDE; virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) OVERRIDE; virtual void sendManagedMemoryStats() OVERRIDE; @@ -86,7 +86,7 @@ private: BeginFrameAndCommitState(); ~BeginFrameAndCommitState(); - double monotonicFrameBeginTime; + base::TimeTicks monotonicFrameBeginTime; scoped_ptr<ScrollAndScaleSet> scrollInfo; WebKit::WebTransformationMatrix implTransform; PrioritizedTextureManager::BackingList evictedContentsTexturesBackings; @@ -98,7 +98,7 @@ private: void beginFrame(); void didCommitAndDrawFrame(); void didCompleteSwapBuffers(); - void setAnimationEvents(AnimationEventsVector*, double wallClockTime); + void setAnimationEvents(AnimationEventsVector*, base::Time wallClockTime); void beginContextRecreation(); void tryToRecreateContext(); @@ -113,7 +113,7 @@ private: void beginFrameCompleteOnImplThread(CompletionEvent*, ResourceUpdateQueue*); void beginFrameAbortedOnImplThread(); void requestReadbackOnImplThread(ReadbackRequest*); - void requestStartPageScaleAnimationOnImplThread(IntSize targetPosition, bool useAnchor, float scale, double durationSec); + void requestStartPageScaleAnimationOnImplThread(IntSize targetPosition, bool useAnchor, float scale, base::TimeDelta duration); void finishAllRenderingOnImplThread(CompletionEvent*); void initializeImplOnImplThread(CompletionEvent*, InputHandler*); void setSurfaceReadyOnImplThread(); |