Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: sky/engine/core/page/PageAnimator.cpp

Issue 1229273004: Remove Animations and Transitions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/page/PageAnimator.h ('k') | sky/engine/core/page/PageVisibilityState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "sky/engine/core/page/PageAnimator.h"
6
7 #include "sky/engine/core/animation/DocumentAnimations.h"
8 #include "sky/engine/core/dom/Document.h"
9 #include "sky/engine/core/frame/FrameView.h"
10 #include "sky/engine/core/frame/LocalFrame.h"
11 #include "sky/engine/core/page/ChromeClient.h"
12 #include "sky/engine/core/page/Page.h"
13 #include "sky/engine/core/painting/PaintingTasks.h"
14 #include "sky/engine/platform/Logging.h"
15
16 namespace blink {
17
18 PageAnimator::PageAnimator(Page* page)
19 : m_page(page)
20 , m_servicingAnimations(false)
21 , m_updatingLayoutAndStyleForPainting(false)
22 {
23 }
24
25 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
26 {
27 TemporaryChange<bool> servicing(m_servicingAnimations, true);
28
29 RefPtr<Document> document = m_page->mainFrame()->document();
30
31 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document, monoto nicAnimationStartTime);
32 document->serviceScriptedAnimations(monotonicAnimationStartTime);
33 }
34
35 void PageAnimator::scheduleVisualUpdate()
36 {
37 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting)
38 return;
39 m_page->scheduleVisualUpdate();
40 }
41
42 void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame)
43 {
44 RefPtr<FrameView> view = rootFrame->view();
45
46 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true);
47
48 view->setFrameRect(view->frameRect());
49 view->updateLayoutAndStyleForPainting();
50
51 // TODO(abarth): Remove these calls to updateLayoutAndStyleForPainting
52 // once requestPaint callbacks can't dirty layout.
53 while (PaintingTasks::serviceRequests())
54 view->updateLayoutAndStyleForPainting();
55
56 PaintingTasks::drainCommits();
57
58 ASSERT(m_page->mainFrame()->document()->lifecycle().state() == DocumentLifec ycle::StyleAndLayoutClean);
59 }
60
61 }
OLDNEW
« no previous file with comments | « sky/engine/core/page/PageAnimator.h ('k') | sky/engine/core/page/PageVisibilityState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698