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

Unified Diff: Source/core/page/PageAnimator.cpp

Issue 202533003: Don't schedule an animation during compositing dirty-bit setting unless needed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add null check. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/PageAnimator.h ('k') | Source/core/rendering/compositing/RenderLayerCompositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PageAnimator.cpp
diff --git a/Source/core/page/PageAnimator.cpp b/Source/core/page/PageAnimator.cpp
index 8bca069bd0b727cada442ae55655b1278ca97414..c2255481bb51838a961950b138e3f22151e50ae0 100644
--- a/Source/core/page/PageAnimator.cpp
+++ b/Source/core/page/PageAnimator.cpp
@@ -20,6 +20,7 @@ PageAnimator::PageAnimator(Page* page)
: m_page(page)
, m_animationFramePending(false)
, m_servicingAnimations(false)
+ , m_updatingLayoutAndStyleForPainting(false)
{
}
@@ -44,10 +45,29 @@ void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
void PageAnimator::scheduleVisualUpdate()
{
- if (m_animationFramePending || m_servicingAnimations)
+ // FIXME: also include m_animationFramePending here. It is currently not there due to crbug.com/353756.
+ if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting)
return;
m_page->chrome().scheduleAnimation();
- ASSERT(m_animationFramePending);
+}
+
+void PageAnimator::updateLayoutAndStyleForPainting()
+{
+ RefPtr<FrameView> view = m_page->mainFrame()->view();
+
+ TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true);
+
+ // In order for our child HWNDs (NativeWindowWidgets) to update properly,
+ // they need to be told that we are updating the screen. The problem is that
+ // the native widgets need to recalculate their clip region and not overlap
+ // any of our non-native widgets. To force the resizing, call
+ // setFrameRect(). This will be a quick operation for most frames, but the
+ // NativeWindowWidgets will update a proper clipping region.
+ view->setFrameRect(view->frameRect());
+
+ // setFrameRect may have the side-effect of causing existing page layout to
+ // be invalidated, so layout needs to be called last.
+ view->updateLayoutAndStyleForPainting();
}
}
« no previous file with comments | « Source/core/page/PageAnimator.h ('k') | Source/core/rendering/compositing/RenderLayerCompositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698