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

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

Issue 1422493003: Change Widget subclasses to use a CullRect instead of an IntRect for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either 11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version. 12 * version 2 of the License, or (at your option) any later version.
13 * 13 *
14 * This library is distributed in the hope that it will be useful, 14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details. 17 * Library General Public License for more details.
18 * 18 *
19 * You should have received a copy of the GNU Library General Public License 19 * You should have received a copy of the GNU Library General Public License
20 * along with this library; see the file COPYING.LIB. If not, write to 20 * along with this library; see the file COPYING.LIB. If not, write to
21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA. 22 * Boston, MA 02110-1301, USA.
23 * 23 *
24 */ 24 */
25 25
26 #ifndef PaintInfo_h 26 #ifndef PaintInfo_h
27 #define PaintInfo_h 27 #define PaintInfo_h
28 28
29 #include "core/CoreExport.h"
29 // TODO(jchaffraix): Once we unify PaintBehavior and PaintLayerFlags, we should move 30 // TODO(jchaffraix): Once we unify PaintBehavior and PaintLayerFlags, we should move
30 // PaintLayerFlags to PaintPhase and rename it. Thus removing the need for this #include. 31 // PaintLayerFlags to PaintPhase and rename it. Thus removing the need for this #include.#include "core/paint/PaintLayerPaintingInfo.h"
31 #include "core/CoreExport.h"
32 #include "core/paint/PaintLayerPaintingInfo.h" 32 #include "core/paint/PaintLayerPaintingInfo.h"
33 #include "core/paint/PaintPhase.h" 33 #include "core/paint/PaintPhase.h"
34 #include "platform/geometry/IntRect.h" 34 #include "platform/geometry/IntRect.h"
35 #include "platform/geometry/LayoutRect.h" 35 #include "platform/geometry/LayoutRect.h"
36 #include "platform/graphics/GraphicsContext.h" 36 #include "platform/graphics/GraphicsContext.h"
37 #include "platform/graphics/paint/CullRect.h"
37 #include "platform/graphics/paint/DisplayItem.h" 38 #include "platform/graphics/paint/DisplayItem.h"
38 #include "platform/transforms/AffineTransform.h" 39 #include "platform/transforms/AffineTransform.h"
39 #include "wtf/Allocator.h" 40 #include "wtf/Allocator.h"
40 #include "wtf/HashMap.h" 41 #include "wtf/HashMap.h"
41 #include "wtf/ListHashSet.h" 42 #include "wtf/ListHashSet.h"
42 43
43 #include <limits> 44 #include <limits>
44 45
45 namespace blink { 46 namespace blink {
46 47
47 class LayoutInline; 48 class LayoutInline;
48 class LayoutBoxModelObject; 49 class LayoutBoxModelObject;
49 class LayoutObject; 50 class LayoutObject;
50 class PaintInvalidationState; 51 class PaintInvalidationState;
51 52
52 class CORE_EXPORT CullRect {
53 public:
54 explicit CullRect(const IntRect& rect) : m_rect(rect) { }
55 CullRect(const CullRect&, const IntPoint& offset);
56
57 bool intersectsCullRect(const AffineTransform&, const FloatRect& boundingBox ) const;
58 void updateCullRect(const AffineTransform& localToParentTransform);
59 bool intersectsCullRect(const IntRect&) const;
60 bool intersectsCullRect(const LayoutRect&) const;
61 bool intersectsHorizontalRange(LayoutUnit lo, LayoutUnit hi) const;
62 bool intersectsVerticalRange(LayoutUnit lo, LayoutUnit hi) const;
63
64 private:
65 IntRect m_rect;
66
67 // TODO(chrishtr): temporary while we implement CullRect everywhere.
68 friend class ReplicaPainter;
69 friend class GridPainter;
70 friend class PartPainter;
71 friend class ScrollableAreaPainter;
72 friend class SVGPaintContext;
73 friend class SVGShapePainter;
74 friend class TableSectionPainter;
75 friend class ThemePainterMac;
76 friend class SVGInlineTextBoxPainter;
77 friend class SVGRootInlineBoxPainter;
78 };
79
80 struct CORE_EXPORT PaintInfo { 53 struct CORE_EXPORT PaintInfo {
81 ALLOW_ONLY_INLINE_ALLOCATION(); 54 ALLOW_ONLY_INLINE_ALLOCATION();
82 PaintInfo(GraphicsContext* newContext, const IntRect& cullRect, PaintPhase n ewPhase, GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags, 55 PaintInfo(GraphicsContext* newContext, const IntRect& cullRect, PaintPhase n ewPhase, GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags,
83 LayoutObject* newPaintingRoot = nullptr, const LayoutBoxModelObject* new PaintContainer = nullptr) 56 LayoutObject* newPaintingRoot = nullptr, const LayoutBoxModelObject* new PaintContainer = nullptr)
84 : context(newContext) 57 : context(newContext)
85 , phase(newPhase) 58 , phase(newPhase)
86 , paintingRoot(newPaintingRoot) 59 , paintingRoot(newPaintingRoot)
87 , paintInvalidationState(nullptr) 60 , paintInvalidationState(nullptr)
88 , m_cullRect(cullRect) 61 , m_cullRect(cullRect)
89 , m_paintContainer(newPaintContainer) 62 , m_paintContainer(newPaintContainer)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 const GlobalPaintFlags m_globalPaintFlags; 103 const GlobalPaintFlags m_globalPaintFlags;
131 104
132 // TODO(chrishtr): temporary while we implement CullRect everywhere. 105 // TODO(chrishtr): temporary while we implement CullRect everywhere.
133 friend class SVGPaintContext; 106 friend class SVGPaintContext;
134 friend class SVGShapePainter; 107 friend class SVGShapePainter;
135 }; 108 };
136 109
137 } // namespace blink 110 } // namespace blink
138 111
139 #endif // PaintInfo_h 112 #endif // PaintInfo_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/FramePainter.cpp ('k') | third_party/WebKit/Source/core/paint/PaintInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698