OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "sky/engine/config.h" | 5 #include "sky/engine/config.h" |
6 #include "sky/engine/core/painting/LayoutRoot.h" | 6 #include "sky/engine/core/painting/LayoutRoot.h" |
7 | 7 |
8 #include "sky/engine/core/dom/Document.h" | 8 #include "sky/engine/core/dom/Document.h" |
9 #include "sky/engine/core/dom/Element.h" | 9 #include "sky/engine/core/dom/Element.h" |
10 #include "sky/engine/core/frame/FrameView.h" | 10 #include "sky/engine/core/frame/FrameView.h" |
11 #include "sky/engine/core/frame/LocalFrame.h" | 11 #include "sky/engine/core/frame/LocalFrame.h" |
12 #include "sky/engine/core/frame/Settings.h" | 12 #include "sky/engine/core/frame/Settings.h" |
| 13 #include "sky/engine/core/painting/Canvas.h" |
13 #include "sky/engine/core/painting/PaintingTasks.h" | 14 #include "sky/engine/core/painting/PaintingTasks.h" |
14 #include "sky/engine/platform/geometry/IntRect.h" | 15 #include "sky/engine/platform/geometry/IntRect.h" |
15 #include "third_party/skia/include/core/SkCanvas.h" | 16 #include "third_party/skia/include/core/SkCanvas.h" |
16 | 17 |
17 namespace blink { | 18 namespace blink { |
18 | 19 |
19 PassRefPtr<LayoutRoot> LayoutRoot::create() | 20 PassRefPtr<LayoutRoot> LayoutRoot::create() |
20 { | 21 { |
21 return adoptRef(new LayoutRoot); | 22 return adoptRef(new LayoutRoot); |
22 } | 23 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 m_frame->view()->setLayoutSize(maxSize); | 77 m_frame->view()->setLayoutSize(maxSize); |
77 | 78 |
78 m_document->updateLayout(); | 79 m_document->updateLayout(); |
79 | 80 |
80 m_document->setFrame(nullptr); | 81 m_document->setFrame(nullptr); |
81 m_frame->setDocument(nullptr); | 82 m_frame->setDocument(nullptr); |
82 } | 83 } |
83 | 84 |
84 void LayoutRoot::paint(Canvas* canvas) | 85 void LayoutRoot::paint(Canvas* canvas) |
85 { | 86 { |
86 if (m_document) | 87 if (m_document && canvas && canvas->skCanvas()) |
87 rootElement()->paint(canvas); | 88 rootElement()->paint(canvas); |
88 } | 89 } |
89 | 90 |
90 } // namespace blink | 91 } // namespace blink |
OLD | NEW |