Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Side by Side Diff: third_party/WebKit/Source/core/paint/HTMLCanvasPaintInvalidator.cpp

Issue 2872423002: Tweak PaintInvalidationReasons (Closed)
Patch Set: Rebaseline-cl Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698