| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 m_frame->view()->setLayoutSize(maxSize); | 75 m_frame->view()->setLayoutSize(maxSize); |
| 75 | 76 |
| 76 m_document->updateLayout(); | 77 m_document->updateLayout(); |
| 77 | 78 |
| 78 m_document->setFrame(nullptr); | 79 m_document->setFrame(nullptr); |
| 79 m_frame->setDocument(nullptr); | 80 m_frame->setDocument(nullptr); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void LayoutRoot::paint(Canvas* canvas) | 83 void LayoutRoot::paint(Canvas* canvas) |
| 83 { | 84 { |
| 84 if (m_document) | 85 if (m_document && canvas->skCanvas()) |
| 85 rootElement()->paint(canvas); | 86 rootElement()->paint(canvas); |
| 86 } | 87 } |
| 87 | 88 |
| 88 } // namespace blink | 89 } // namespace blink |
| OLD | NEW |