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

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: Fix empty focus ring on Mac 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
« no previous file with comments | « Source/core/paint/ObjectPainter.cpp ('k') | Source/core/paint/PartPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 namespace blink { 44 namespace blink {
45 45
46 class LayoutInline; 46 class LayoutInline;
47 class LayoutBoxModelObject; 47 class LayoutBoxModelObject;
48 class LayoutObject; 48 class LayoutObject;
49 49
50 struct PaintInfo { 50 struct PaintInfo {
51 ALLOW_ONLY_INLINE_ALLOCATION(); 51 ALLOW_ONLY_INLINE_ALLOCATION();
52 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne wPhase, GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags, 52 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne wPhase, GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags,
53 LayoutObject* newPaintingRoot = 0, ListHashSet<LayoutInline*>* newOutlin eObjects = 0, 53 LayoutObject* newPaintingRoot = 0, const LayoutBoxModelObject* newPaintC ontainer = 0)
54 const LayoutBoxModelObject* newPaintContainer = 0)
55 : context(newContext) 54 : context(newContext)
56 , rect(newRect) 55 , rect(newRect)
57 , phase(newPhase) 56 , phase(newPhase)
58 , paintingRoot(newPaintingRoot) 57 , paintingRoot(newPaintingRoot)
59 , m_paintContainer(newPaintContainer) 58 , m_paintContainer(newPaintContainer)
60 , m_outlineObjects(newOutlineObjects)
61 , m_paintFlags(paintFlags) 59 , m_paintFlags(paintFlags)
62 , m_globalPaintFlags(globalPaintFlags) 60 , m_globalPaintFlags(globalPaintFlags)
63 { 61 {
64 } 62 }
65 63
66 void updatePaintingRootForChildren(const LayoutObject* layoutObject) 64 void updatePaintingRootForChildren(const LayoutObject* layoutObject)
67 { 65 {
68 if (!paintingRoot) 66 if (!paintingRoot)
69 return; 67 return;
70 68
(...skipping 13 matching lines...) Expand all
84 82
85 bool skipRootBackground() const { return m_paintFlags & PaintLayerPaintingSk ipRootBackground; } 83 bool skipRootBackground() const { return m_paintFlags & PaintLayerPaintingSk ipRootBackground; }
86 bool paintRootBackgroundOnly() const { return m_paintFlags & PaintLayerPaint ingRootBackgroundOnly; } 84 bool paintRootBackgroundOnly() const { return m_paintFlags & PaintLayerPaint ingRootBackgroundOnly; }
87 85
88 bool isPrinting() const { return m_globalPaintFlags & GlobalPaintPrinting; } 86 bool isPrinting() const { return m_globalPaintFlags & GlobalPaintPrinting; }
89 87
90 DisplayItem::Type displayItemTypeForClipping() const { return DisplayItem::p aintPhaseToClipBoxType(phase); } 88 DisplayItem::Type displayItemTypeForClipping() const { return DisplayItem::p aintPhaseToClipBoxType(phase); }
91 89
92 const LayoutBoxModelObject* paintContainer() const { return m_paintContainer ; } 90 const LayoutBoxModelObject* paintContainer() const { return m_paintContainer ; }
93 91
94 ListHashSet<LayoutInline*>* outlineObjects() const { return m_outlineObjects ; }
95 void setOutlineObjects(ListHashSet<LayoutInline*>* objects) { m_outlineObjec ts = objects; }
96
97 GlobalPaintFlags globalPaintFlags() const { return m_globalPaintFlags; } 92 GlobalPaintFlags globalPaintFlags() const { return m_globalPaintFlags; }
98 93
99 PaintLayerFlags paintFlags() const { return m_paintFlags; } 94 PaintLayerFlags paintFlags() const { return m_paintFlags; }
100 95
101 bool intersectsCullRect(const AffineTransform& transform, const FloatRect& b oundingBox) const 96 bool intersectsCullRect(const AffineTransform& transform, const FloatRect& b oundingBox) const
102 { 97 {
103 return transform.mapRect(boundingBox).intersects(rect); 98 return transform.mapRect(boundingBox).intersects(rect);
104 } 99 }
105 100
106 void updateCullRectForSVGTransform(const AffineTransform& localToParentTrans form) 101 void updateCullRectForSVGTransform(const AffineTransform& localToParentTrans form)
107 { 102 {
108 if (rect != LayoutRect::infiniteIntRect()) 103 if (rect != LayoutRect::infiniteIntRect())
109 rect = localToParentTransform.inverse().mapRect(rect); 104 rect = localToParentTransform.inverse().mapRect(rect);
110 } 105 }
111 106
112 // FIXME: Introduce setters/getters at some point. Requires a lot of changes throughout layout/. 107 // FIXME: Introduce setters/getters at some point. Requires a lot of changes throughout layout/.
113 GraphicsContext* context; 108 GraphicsContext* context;
114 IntRect rect; // dirty rect used for culling non-intersecting layoutObjects 109 IntRect rect; // dirty rect used for culling non-intersecting layoutObjects
115 PaintPhase phase; 110 PaintPhase phase;
116 LayoutObject* paintingRoot; // used to draw just one element and its visual kids 111 LayoutObject* paintingRoot; // used to draw just one element and its visual kids
117 112
118 private: 113 private:
119 const LayoutBoxModelObject* m_paintContainer; // the box model object that o riginates the current painting 114 const LayoutBoxModelObject* m_paintContainer; // the box model object that o riginates the current painting
120 ListHashSet<LayoutInline*>* m_outlineObjects; // used to list outlines that should be painted by a block with inline children
121 115
122 const PaintLayerFlags m_paintFlags; 116 const PaintLayerFlags m_paintFlags;
123 const GlobalPaintFlags m_globalPaintFlags; 117 const GlobalPaintFlags m_globalPaintFlags;
124 }; 118 };
125 119
126 } // namespace blink 120 } // namespace blink
127 121
128 #endif // PaintInfo_h 122 #endif // PaintInfo_h
OLDNEW
« no previous file with comments | « Source/core/paint/ObjectPainter.cpp ('k') | Source/core/paint/PartPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698