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

Unified Diff: sky/engine/core/page/PageAnimator.cpp

Issue 1027563002: Integrate custom paint with the DocumentLifecycle (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | « sky/engine/core/dom/Element.cpp ('k') | sky/engine/core/painting/PaintingContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/page/PageAnimator.cpp
diff --git a/sky/engine/core/page/PageAnimator.cpp b/sky/engine/core/page/PageAnimator.cpp
index 7a147848e963fa9bfbb507e83838734e00d18baa..d16042fb0b8661c0eb24735dccc7357d89d555e7 100644
--- a/sky/engine/core/page/PageAnimator.cpp
+++ b/sky/engine/core/page/PageAnimator.cpp
@@ -11,6 +11,7 @@
#include "sky/engine/core/frame/LocalFrame.h"
#include "sky/engine/core/page/ChromeClient.h"
#include "sky/engine/core/page/Page.h"
+#include "sky/engine/core/painting/PaintingTasks.h"
#include "sky/engine/platform/Logging.h"
namespace blink {
@@ -45,17 +46,18 @@ void PageAnimator::updateLayoutAndStyleForPainting(LocalFrame* rootFrame)
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());
+ view->updateLayoutAndStyleForPainting();
- // setFrameRect may have the side-effect of causing existing page layout to
- // be invalidated, so layout needs to be called last.
+ // TODO(abarth): Remove these calls to updateLayoutAndStyleForPainting
+ // once requestPaint callbacks can't dirty layout.
+ while (PaintingTasks::serviceRequests())
+ view->updateLayoutAndStyleForPainting();
view->updateLayoutAndStyleForPainting();
ojan 2015/03/20 02:35:14 Is this call needed?
abarth-chromium 2015/03/20 02:54:51 serviceRequests returns if there are more requests
ojan 2015/03/20 03:38:02 Don't know if this is intentional, but if you hit
+
+ PaintingTasks::drainCommits();
+
+ ASSERT(m_page->mainFrame()->document()->lifecycle().state() == DocumentLifecycle::StyleAndLayoutClean);
}
}
« no previous file with comments | « sky/engine/core/dom/Element.cpp ('k') | sky/engine/core/painting/PaintingContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698