Index: Source/core/paint/DrawingRecorder.cpp |
diff --git a/Source/core/paint/DrawingRecorder.cpp b/Source/core/paint/DrawingRecorder.cpp |
index 65c94d46a059a66c263271a20039c3b843f87966..fae14dee3d40f983f91890c1d995fbba8bbd6ab1 100644 |
--- a/Source/core/paint/DrawingRecorder.cpp |
+++ b/Source/core/paint/DrawingRecorder.cpp |
@@ -5,18 +5,17 @@ |
#include "config.h" |
#include "core/paint/DrawingRecorder.h" |
+#include "core/rendering/RenderLayer.h" |
#include "core/rendering/RenderObject.h" |
-#include "core/rendering/RenderView.h" |
#include "platform/RuntimeEnabledFeatures.h" |
+#include "platform/graphics/DisplayList.h" |
#include "platform/graphics/GraphicsContext.h" |
+#include "platform/graphics/GraphicsLayer.h" |
+#include "platform/graphics/paint/DisplayItemList.h" |
+#include "platform/graphics/paint/DrawingDisplayItem.h" |
namespace blink { |
-void DrawingDisplayItem::replay(GraphicsContext* context) |
-{ |
- context->drawPicture(m_picture.get(), m_location); |
-} |
- |
#if ENABLE(ASSERT) |
static bool s_inDrawingRecorder = false; |
#endif |
@@ -52,18 +51,18 @@ DrawingRecorder::~DrawingRecorder() |
return; |
ASSERT(displayList->bounds() == m_bounds); |
OwnPtr<DrawingDisplayItem> drawingItem = adoptPtr( |
- new DrawingDisplayItem(displayList->picture(), m_bounds.location(), m_phase, m_renderer)); |
- ASSERT(m_renderer->view()); |
- m_renderer->view()->viewDisplayList().add(drawingItem.release()); |
-} |
- |
+ new DrawingDisplayItem(m_renderer->displayItemClient(), (DisplayItem::Type)m_phase, displayList->picture(), m_bounds.location())); |
#ifndef NDEBUG |
-WTF::String DrawingDisplayItem::asDebugString() const |
-{ |
- return String::format("{%s, type: \"%s\", location: [%f,%f]}", |
- rendererDebugString(renderer()).utf8().data(), typeAsDebugString(type()).utf8().data(), |
- m_location.x(), m_location.y()); |
-} |
+ if (!m_renderer) |
+ drawingItem->setClientDebugString("nullptr"); |
+ else if (m_renderer->node()) |
+ drawingItem->setClientDebugString(String::format("nodeName: \"%s\", renderer: \"%p\"", m_renderer->node()->nodeName().utf8().data(), m_renderer)); |
+ else |
+ drawingItem->setClientDebugString(String::format("renderer: \"%p\"", m_renderer)); |
#endif |
+ if (RenderLayer* container = m_renderer->enclosingLayer()->enclosingLayerForPaintInvalidationCrossingFrameBoundaries()) |
+ container->graphicsLayerBacking()->displayItemList().add(drawingItem.release()); |
+} |
+ |
} // namespace blink |