OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/paint/DrawingRecorder.h" | 6 #include "core/paint/DrawingRecorder.h" |
7 | 7 |
8 #include "core/rendering/RenderObject.h" | 8 #include "core/rendering/RenderObject.h" |
9 #include "core/rendering/RenderView.h" | 9 #include "core/rendering/RenderView.h" |
10 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 #if ENABLE(ASSERT) | 46 #if ENABLE(ASSERT) |
47 s_inDrawingRecorder = false; | 47 s_inDrawingRecorder = false; |
48 #endif | 48 #endif |
49 | 49 |
50 RefPtr<DisplayList> displayList = m_context->endRecording(); | 50 RefPtr<DisplayList> displayList = m_context->endRecording(); |
51 if (!displayList->picture()->approximateOpCount()) | 51 if (!displayList->picture()->approximateOpCount()) |
52 return; | 52 return; |
53 ASSERT(displayList->bounds() == m_bounds); | 53 ASSERT(displayList->bounds() == m_bounds); |
54 OwnPtr<DrawingDisplayItem> drawingItem = adoptPtr( | 54 OwnPtr<DrawingDisplayItem> drawingItem = adoptPtr( |
55 new DrawingDisplayItem(displayList->picture(), m_bounds.location(), m_ph ase, m_renderer)); | 55 new DrawingDisplayItem(displayList->picture(), m_bounds.location(), m_ph ase, m_renderer)); |
56 ASSERT(m_renderer->view()); | 56 |
57 m_renderer->view()->viewDisplayList().add(drawingItem.release()); | 57 ViewDisplayList::fromRenderObject(m_renderer).add(drawingItem.release()); |
chrishtr
2014/11/01 23:44:10
I hadn't mentioned it yet, but since your CL force
trchen
2014/11/02 10:36:46
Ah ha, that makes sense. I will revise as you plan
| |
58 } | 58 } |
59 | 59 |
60 #ifndef NDEBUG | 60 #ifndef NDEBUG |
61 WTF::String DrawingDisplayItem::asDebugString() const | 61 WTF::String DrawingDisplayItem::asDebugString() const |
62 { | 62 { |
63 return String::format("{%s, type: \"%s\", location: [%f,%f]}", | 63 return String::format("{%s, type: \"%s\", location: [%f,%f]}", |
64 rendererDebugString(renderer()).utf8().data(), typeAsDebugString(type()) .utf8().data(), | 64 rendererDebugString(renderer()).utf8().data(), typeAsDebugString(type()) .utf8().data(), |
65 m_location.x(), m_location.y()); | 65 m_location.x(), m_location.y()); |
66 } | 66 } |
67 #endif | 67 #endif |
68 | 68 |
69 } // namespace blink | 69 } // namespace blink |
OLD | NEW |