Index: third_party/WebKit/Source/core/paint/HTMLCanvasPaintInvalidator.cpp |
diff --git a/third_party/WebKit/Source/core/paint/HTMLCanvasPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/HTMLCanvasPaintInvalidator.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c317802dc216a65ff315fefc81eb1c7be12cdb59 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/paint/HTMLCanvasPaintInvalidator.cpp |
@@ -0,0 +1,28 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "core/paint/HTMLCanvasPaintInvalidator.h" |
+ |
+#include "core/html/HTMLCanvasElement.h" |
+#include "core/layout/LayoutHTMLCanvas.h" |
+#include "core/paint/BoxPaintInvalidator.h" |
+#include "core/paint/PaintInvalidator.h" |
+ |
+namespace blink { |
+ |
+PaintInvalidationReason HTMLCanvasPaintInvalidator::invalidatePaintIfNeeded() |
+{ |
+ PaintInvalidationReason reason = BoxPaintInvalidator(m_htmlCanvas, m_context).invalidatePaintIfNeeded(); |
+ |
+ HTMLCanvasElement* element = toHTMLCanvasElement(m_htmlCanvas.node()); |
+ if (element->isDirty()) { |
+ element->doDeferredPaintInvalidation(); |
+ if (reason < PaintInvalidationRectangle) |
+ reason = PaintInvalidationRectangle; |
+ } |
+ |
+ return reason; |
+} |
+ |
+} // namespace blink |