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

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

Issue 1224933002: Combine outline and focus ring code paths (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 3 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 | Annotate | Revision Log
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
(...skipping 30 matching lines...) Expand all
41 #include <limits> 41 #include <limits>
42 42
43 namespace blink { 43 namespace blink {
44 44
45 class LayoutInline; 45 class LayoutInline;
46 class LayoutBoxModelObject; 46 class LayoutBoxModelObject;
47 class LayoutObject; 47 class LayoutObject;
48 48
49 struct PaintInfo { 49 struct PaintInfo {
50 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne wPhase, GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags, 50 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne wPhase, GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags,
51 LayoutObject* newPaintingRoot = 0, ListHashSet<LayoutInline*>* newOutlin eObjects = 0, 51 LayoutObject* newPaintingRoot = 0, const LayoutBoxModelObject* newPaintC ontainer = 0)
52 const LayoutBoxModelObject* newPaintContainer = 0)
53 : context(newContext) 52 : context(newContext)
54 , rect(newRect) 53 , rect(newRect)
55 , phase(newPhase) 54 , phase(newPhase)
56 , paintingRoot(newPaintingRoot) 55 , paintingRoot(newPaintingRoot)
57 , m_paintContainer(newPaintContainer) 56 , m_paintContainer(newPaintContainer)
58 , m_outlineObjects(newOutlineObjects)
59 , m_paintFlags(paintFlags) 57 , m_paintFlags(paintFlags)
60 , m_globalPaintFlags(globalPaintFlags) 58 , m_globalPaintFlags(globalPaintFlags)
61 { 59 {
62 } 60 }
63 61
64 void updatePaintingRootForChildren(const LayoutObject* layoutObject) 62 void updatePaintingRootForChildren(const LayoutObject* layoutObject)
65 { 63 {
66 if (!paintingRoot) 64 if (!paintingRoot)
67 return; 65 return;
68 66
(...skipping 13 matching lines...) Expand all
82 80
83 bool skipRootBackground() const { return m_paintFlags & PaintLayerPaintingSk ipRootBackground; } 81 bool skipRootBackground() const { return m_paintFlags & PaintLayerPaintingSk ipRootBackground; }
84 bool paintRootBackgroundOnly() const { return m_paintFlags & PaintLayerPaint ingRootBackgroundOnly; } 82 bool paintRootBackgroundOnly() const { return m_paintFlags & PaintLayerPaint ingRootBackgroundOnly; }
85 83
86 bool isPrinting() const { return m_globalPaintFlags & GlobalPaintPrinting; } 84 bool isPrinting() const { return m_globalPaintFlags & GlobalPaintPrinting; }
87 85
88 DisplayItem::Type displayItemTypeForClipping() const { return DisplayItem::p aintPhaseToClipBoxType(phase); } 86 DisplayItem::Type displayItemTypeForClipping() const { return DisplayItem::p aintPhaseToClipBoxType(phase); }
89 87
90 const LayoutBoxModelObject* paintContainer() const { return m_paintContainer ; } 88 const LayoutBoxModelObject* paintContainer() const { return m_paintContainer ; }
91 89
92 ListHashSet<LayoutInline*>* outlineObjects() const { return m_outlineObjects ; }
93 void setOutlineObjects(ListHashSet<LayoutInline*>* objects) { m_outlineObjec ts = objects; }
94
95 GlobalPaintFlags globalPaintFlags() const { return m_globalPaintFlags; } 90 GlobalPaintFlags globalPaintFlags() const { return m_globalPaintFlags; }
96 91
97 PaintLayerFlags paintFlags() const { return m_paintFlags; } 92 PaintLayerFlags paintFlags() const { return m_paintFlags; }
98 93
99 bool intersectsCullRect(const AffineTransform& transform, const FloatRect& b oundingBox) const 94 bool intersectsCullRect(const AffineTransform& transform, const FloatRect& b oundingBox) const
100 { 95 {
101 return transform.mapRect(boundingBox).intersects(rect); 96 return transform.mapRect(boundingBox).intersects(rect);
102 } 97 }
103 98
104 void updateCullRectForSVGTransform(const AffineTransform& localToParentTrans form) 99 void updateCullRectForSVGTransform(const AffineTransform& localToParentTrans form)
105 { 100 {
106 if (rect != LayoutRect::infiniteIntRect()) 101 if (rect != LayoutRect::infiniteIntRect())
107 rect = localToParentTransform.inverse().mapRect(rect); 102 rect = localToParentTransform.inverse().mapRect(rect);
108 } 103 }
109 104
110 // FIXME: Introduce setters/getters at some point. Requires a lot of changes throughout layout/. 105 // FIXME: Introduce setters/getters at some point. Requires a lot of changes throughout layout/.
111 GraphicsContext* context; 106 GraphicsContext* context;
112 IntRect rect; // dirty rect used for culling non-intersecting layoutObjects 107 IntRect rect; // dirty rect used for culling non-intersecting layoutObjects
113 PaintPhase phase; 108 PaintPhase phase;
114 LayoutObject* paintingRoot; // used to draw just one element and its visual kids 109 LayoutObject* paintingRoot; // used to draw just one element and its visual kids
115 110
116 private: 111 private:
117 const LayoutBoxModelObject* m_paintContainer; // the box model object that o riginates the current painting 112 const LayoutBoxModelObject* m_paintContainer; // the box model object that o riginates the current painting
118 ListHashSet<LayoutInline*>* m_outlineObjects; // used to list outlines that should be painted by a block with inline children
119 113
120 const PaintLayerFlags m_paintFlags; 114 const PaintLayerFlags m_paintFlags;
121 const GlobalPaintFlags m_globalPaintFlags; 115 const GlobalPaintFlags m_globalPaintFlags;
122 }; 116 };
123 117
124 } // namespace blink 118 } // namespace blink
125 119
126 #endif // PaintInfo_h 120 #endif // PaintInfo_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698