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

Unified Diff: Source/core/testing/Internals.cpp

Issue 14741004: NOT FOR REVIEW - Update comp-scrolling state at a well defined point in the pipeline. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added annotations describing how this patch will be split. Created 7 years, 8 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
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index ee84fbfc31be8ffef88fe548329f7aeb731d54f6..f934bbf49d17cf7b896933dcb1d7befe8c6550ff 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -1570,6 +1570,28 @@ String Internals::layerTreeAsText(Document* document, ExceptionCode& ec) const
return layerTreeAsText(document, 0, ec);
}
+// PATCH 1 (just moving stuff to its right place. Maybe this is just noisy?)
+
+String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionCode& ec) const
+{
+ if (!document || !document->frame()) {
+ ec = INVALID_ACCESS_ERR;
+ return String();
+ }
+
+ LayerTreeFlags layerTreeFlags = 0;
+ if (flags & LAYER_TREE_INCLUDES_VISIBLE_RECTS)
+ layerTreeFlags |= LayerTreeFlagsIncludeVisibleRects;
+ if (flags & LAYER_TREE_INCLUDES_TILE_CACHES)
+ layerTreeFlags |= LayerTreeFlagsIncludeTileCaches;
+ if (flags & LAYER_TREE_INCLUDES_REPAINT_RECTS)
+ layerTreeFlags |= LayerTreeFlagsIncludeRepaintRects;
+ if (flags & LAYER_TREE_INCLUDES_PAINTING_PHASES)
+ layerTreeFlags |= LayerTreeFlagsIncludePaintingPhases;
+
+ return document->frame()->layerTreeAsText(layerTreeFlags);
+}
+
static PassRefPtr<NodeList> paintOrderList(Element* element, ExceptionCode& ec, RenderLayer::PaintOrderListType type)
{
if (!element) {
@@ -1606,24 +1628,29 @@ PassRefPtr<NodeList> Internals::paintOrderListAfterPromote(Element* element, Exc
return paintOrderList(element, ec, RenderLayer::AfterPromote);
}
-String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionCode& ec) const
+// PATCH 1
+void Internals::setNeedsCompositedScrolling(Element* element, unsigned needsCompositedScrolling, ExceptionCode& ec)
{
- if (!document || !document->frame()) {
+ if (!element) {
ec = INVALID_ACCESS_ERR;
- return String();
+ return;
}
- LayerTreeFlags layerTreeFlags = 0;
- if (flags & LAYER_TREE_INCLUDES_VISIBLE_RECTS)
- layerTreeFlags |= LayerTreeFlagsIncludeVisibleRects;
- if (flags & LAYER_TREE_INCLUDES_TILE_CACHES)
- layerTreeFlags |= LayerTreeFlagsIncludeTileCaches;
- if (flags & LAYER_TREE_INCLUDES_REPAINT_RECTS)
- layerTreeFlags |= LayerTreeFlagsIncludeRepaintRects;
- if (flags & LAYER_TREE_INCLUDES_PAINTING_PHASES)
- layerTreeFlags |= LayerTreeFlagsIncludePaintingPhases;
+ element->document()->updateLayout();
- return document->frame()->layerTreeAsText(layerTreeFlags);
+ RenderObject* renderer = element->renderer();
+ if (!renderer || !renderer->isBox()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ RenderLayer* layer = toRenderBox(renderer)->layer();
+ if (!layer) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ layer->setForceNeedsCompositedScrolling(static_cast<RenderLayer::ForceNeedsCompositedScrollingMode>(needsCompositedScrolling));
}
String Internals::repaintRectsAsText(Document* document, ExceptionCode& ec) const

Powered by Google App Engine
This is Rietveld 408576698