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

Side by Side Diff: third_party/WebKit/Source/core/paint/BoxPaintInvalidator.h

Issue 2699463004: Fix gradient background invalidation when HTML size changes (Closed)
Patch Set: - Created 3 years, 10 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 #ifndef BoxPaintInvalidator_h 5 #ifndef BoxPaintInvalidator_h
6 #define BoxPaintInvalidator_h 6 #define BoxPaintInvalidator_h
7 7
8 #include "platform/graphics/PaintInvalidationReason.h" 8 #include "platform/graphics/PaintInvalidationReason.h"
9 #include "wtf/Allocator.h" 9 #include "wtf/Allocator.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class LayoutBox; 13 class LayoutBox;
14 class LayoutRect; 14 class LayoutRect;
15 class LayoutSize; 15 class LayoutSize;
16 struct PaintInvalidatorContext; 16 struct PaintInvalidatorContext;
17 17
18 class BoxPaintInvalidator { 18 class BoxPaintInvalidator {
19 STACK_ALLOCATED(); 19 STACK_ALLOCATED();
20 20
21 public: 21 public:
22 BoxPaintInvalidator(const LayoutBox& box, 22 BoxPaintInvalidator(const LayoutBox& box,
23 const PaintInvalidatorContext& context) 23 const PaintInvalidatorContext& context)
24 : m_box(box), m_context(context) {} 24 : m_box(box), m_context(context) {}
25 25
26 static void boxWillBeDestroyed(const LayoutBox&); 26 static void boxWillBeDestroyed(const LayoutBox&);
27 27
28 PaintInvalidationReason invalidatePaintIfNeeded(); 28 PaintInvalidationReason invalidatePaintIfNeeded();
29 29
30 static LayoutSize previousBorderBoxSize(const LayoutBox&);
31
30 private: 32 private:
31 bool backgroundGeometryDependsOnLayoutOverflowRect(); 33 bool backgroundGeometryDependsOnLayoutOverflowRect();
32 bool backgroundPaintsOntoScrollingContentsLayer(); 34 bool backgroundPaintsOntoScrollingContentsLayer();
33 bool shouldFullyInvalidateBackgroundOnLayoutOverflowChange( 35 bool shouldFullyInvalidateBackgroundOnLayoutOverflowChange(
34 const LayoutRect& oldLayoutOverflow, 36 const LayoutRect& oldLayoutOverflow,
35 const LayoutRect& newLayoutOverflow); 37 const LayoutRect& newLayoutOverflow);
36 void invalidateScrollingContentsBackgroundIfNeeded(); 38 void invalidateScrollingContentsBackgroundIfNeeded();
37 39
38 PaintInvalidationReason computePaintInvalidationReason(); 40 PaintInvalidationReason computePaintInvalidationReason();
39 41
40 bool incrementallyInvalidatePaint(PaintInvalidationReason, 42 bool incrementallyInvalidatePaint(PaintInvalidationReason,
41 const LayoutRect& oldRect, 43 const LayoutRect& oldRect,
42 const LayoutRect& newRect); 44 const LayoutRect& newRect);
43 45
44 bool needsToSavePreviousBoxGeometries(); 46 bool needsToSavePreviousBoxGeometries();
45 void savePreviousBoxGeometriesIfNeeded(); 47 void savePreviousBoxGeometriesIfNeeded();
46 LayoutSize previousBorderBoxSize(); 48 LayoutSize previousBorderBoxSize();
47 LayoutRect previousContentBoxRect(); 49 LayoutRect previousContentBoxRect();
48 LayoutRect previousLayoutOverflowRect(); 50 LayoutRect previousLayoutOverflowRect();
49 51
50 const LayoutBox& m_box; 52 const LayoutBox& m_box;
51 const PaintInvalidatorContext& m_context; 53 const PaintInvalidatorContext& m_context;
52 }; 54 };
53 55
54 } // namespace blink 56 } // namespace blink
55 57
56 #endif 58 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698