OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/paint/HTMLCanvasPaintInvalidator.h" |
| 6 |
| 7 #include "core/html/HTMLCanvasElement.h" |
| 8 #include "core/layout/LayoutHTMLCanvas.h" |
| 9 #include "core/paint/BoxPaintInvalidator.h" |
| 10 #include "core/paint/PaintInvalidator.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 PaintInvalidationReason HTMLCanvasPaintInvalidator::invalidatePaintIfNeeded() |
| 15 { |
| 16 PaintInvalidationReason reason = BoxPaintInvalidator(m_htmlCanvas, m_context
).invalidatePaintIfNeeded(); |
| 17 |
| 18 HTMLCanvasElement* element = toHTMLCanvasElement(m_htmlCanvas.node()); |
| 19 if (element->isDirty()) { |
| 20 element->doDeferredPaintInvalidation(); |
| 21 if (reason < PaintInvalidationRectangle) |
| 22 reason = PaintInvalidationRectangle; |
| 23 } |
| 24 |
| 25 return reason; |
| 26 } |
| 27 |
| 28 } // namespace blink |
OLD | NEW |