OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "core/paint/HTMLCanvasPaintInvalidator.h" | 5 #include "core/paint/HTMLCanvasPaintInvalidator.h" |
6 | 6 |
7 #include "core/html/HTMLCanvasElement.h" | 7 #include "core/html/HTMLCanvasElement.h" |
8 #include "core/layout/LayoutHTMLCanvas.h" | 8 #include "core/layout/LayoutHTMLCanvas.h" |
9 #include "core/paint/BoxPaintInvalidator.h" | 9 #include "core/paint/BoxPaintInvalidator.h" |
10 #include "core/paint/PaintInvalidator.h" | 10 #include "core/paint/PaintInvalidator.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 PaintInvalidationReason HTMLCanvasPaintInvalidator::InvalidatePaint() { | 14 PaintInvalidationReason HTMLCanvasPaintInvalidator::InvalidatePaint() { |
15 PaintInvalidationReason reason = | 15 PaintInvalidationReason reason = |
16 BoxPaintInvalidator(html_canvas_, context_).InvalidatePaint(); | 16 BoxPaintInvalidator(html_canvas_, context_).InvalidatePaint(); |
17 | 17 |
18 HTMLCanvasElement* element = toHTMLCanvasElement(html_canvas_.GetNode()); | 18 HTMLCanvasElement* element = toHTMLCanvasElement(html_canvas_.GetNode()); |
19 if (element->IsDirty()) { | 19 if (element->IsDirty()) { |
20 element->DoDeferredPaintInvalidation(); | 20 element->DoDeferredPaintInvalidation(); |
21 if (reason < kPaintInvalidationRectangle) | 21 if (reason < PaintInvalidationReason::kRectangle) |
22 reason = kPaintInvalidationRectangle; | 22 reason = PaintInvalidationReason::kRectangle; |
23 } | 23 } |
24 | 24 |
25 return reason; | 25 return reason; |
26 } | 26 } |
27 | 27 |
28 } // namespace blink | 28 } // namespace blink |
OLD | NEW |