Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 class RenderLayerModelObject; | 42 class RenderLayerModelObject; |
| 43 class RenderObject; | 43 class RenderObject; |
| 44 class RenderRegion; | 44 class RenderRegion; |
| 45 | 45 |
| 46 typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap; | 46 typedef HashMap<OverlapTestRequestClient*, IntRect> OverlapTestRequestMap; |
| 47 | 47 |
| 48 /* | 48 /* |
| 49 * Paint the object and its children, clipped by (x|y|w|h). | 49 * Paint the object and its children, clipped by (x|y|w|h). |
| 50 * (tx|ty) is the calculated position of the parent | 50 * (tx|ty) is the calculated position of the parent |
| 51 */ | 51 */ |
| 52 struct PaintInfo { | 52 class PaintInfo { |
| 53 public: | |
| 53 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne wPhase, PaintBehavior newPaintBehavior, | 54 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne wPhase, PaintBehavior newPaintBehavior, |
| 54 RenderObject* newPaintingRoot = 0, RenderRegion* region = 0, ListHashSet <RenderInline*>* newOutlineObjects = 0, | 55 RenderObject* newPaintingRoot = 0, RenderRegion* region = 0, ListHashSet <RenderInline*>* newOutlineObjects = 0, |
| 55 OverlapTestRequestMap* overlapTestRequests = 0, const RenderLayerModelOb ject* newPaintContainer = 0) | 56 OverlapTestRequestMap* overlapTestRequests = 0, const RenderLayerModelOb ject* newPaintContainer = 0) |
| 56 : context(newContext) | 57 : context(newContext) |
| 57 , rect(newRect) | 58 , rect(newRect) |
| 58 , phase(newPhase) | 59 , phase(newPhase) |
| 59 , paintBehavior(newPaintBehavior) | 60 , paintBehavior(newPaintBehavior) |
| 60 , paintingRoot(newPaintingRoot) | 61 , paintingRoot(newPaintingRoot) |
| 61 , renderRegion(region) | 62 , renderRegion(region) |
| 62 , outlineObjects(newOutlineObjects) | 63 , outlineObjects(newOutlineObjects) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 context->concatCTM(localToAncestorTransform); | 96 context->concatCTM(localToAncestorTransform); |
| 96 | 97 |
| 97 if (rect == infiniteRect()) | 98 if (rect == infiniteRect()) |
| 98 return; | 99 return; |
| 99 | 100 |
| 100 rect = localToAncestorTransform.inverse().mapRect(rect); | 101 rect = localToAncestorTransform.inverse().mapRect(rect); |
| 101 } | 102 } |
| 102 | 103 |
| 103 static IntRect infiniteRect() { return IntRect(LayoutRect::infiniteRect()); } | 104 static IntRect infiniteRect() { return IntRect(LayoutRect::infiniteRect()); } |
| 104 | 105 |
| 105 // FIXME: Introduce setters/getters at some point. Requires a lot of changes throughout rendering/. | 106 GraphicsContext* getContext() { return context; } |
|
do-not-use
2013/08/01 18:50:14
We usually don't use 'get' prefix for getters, so
| |
| 107 void setContext(GraphicsContext *acontext) { context = acontext; } | |
|
do-not-use
2013/08/01 18:50:14
* on wrong side.
do-not-use
2013/08/01 18:50:14
acontext -> context once you rename the member to
Savago-old
2013/08/02 14:56:56
Ouch! You are right, I guess the check-style scrip
| |
| 108 | |
| 109 IntRect& getRect() { return rect; } | |
| 110 void setRect(const IntRect &arect) { rect = arect; } | |
|
do-not-use
2013/08/01 18:50:14
Space should be after the &, not before.
Savago-old
2013/08/02 14:56:56
Same case.
| |
| 111 | |
| 112 const PaintPhase& getPhase() const { return phase; } | |
| 113 void setPhase(const PaintPhase& param) { phase = param; } | |
| 114 | |
| 115 RenderRegion* getRenderRegion() { return renderRegion; } | |
| 116 OverlapTestRequestMap* getOverlapTestRequests() { return overlapTestRequests ; } | |
| 117 void setOverlapTestRequests(OverlapTestRequestMap* map) { overlapTestRequest s = map; } | |
| 118 | |
| 119 ListHashSet<RenderInline*>* getOutlineObjects() { return outlineObjects; } | |
| 120 void setOutlineObjects(ListHashSet<RenderInline*>* objects) { outlineObjects = objects; } | |
| 121 | |
| 122 const RenderLayerModelObject* getPaintContainer() { return paintContainer; } | |
|
do-not-use
2013/08/01 18:50:14
Getter can be const since you return a const point
| |
| 123 | |
| 124 private: | |
| 106 GraphicsContext* context; | 125 GraphicsContext* context; |
|
do-not-use
2013/08/01 18:50:14
now that those are private, we should really use m
Savago-old
2013/08/02 14:56:56
Nice suggestion, I will update the patch.
| |
| 107 IntRect rect; | 126 IntRect rect; |
| 108 PaintPhase phase; | 127 PaintPhase phase; |
| 109 PaintBehavior paintBehavior; | 128 PaintBehavior paintBehavior; |
| 110 RenderObject* paintingRoot; // used to draw just one element and its visual kids | 129 RenderObject* paintingRoot; // used to draw just one element and its visual kids |
| 111 RenderRegion* renderRegion; | 130 RenderRegion* renderRegion; |
| 112 ListHashSet<RenderInline*>* outlineObjects; // used to list outlines that sh ould be painted by a block with inline children | 131 ListHashSet<RenderInline*>* outlineObjects; // used to list outlines that sh ould be painted by a block with inline children |
| 113 OverlapTestRequestMap* overlapTestRequests; | 132 OverlapTestRequestMap* overlapTestRequests; |
| 114 const RenderLayerModelObject* paintContainer; // the layer object that origi nates the current painting | 133 const RenderLayerModelObject* paintContainer; // the layer object that origi nates the current painting |
| 115 }; | 134 }; |
| 116 | 135 |
| 117 } // namespace WebCore | 136 } // namespace WebCore |
| 118 | 137 |
| 119 #endif // PaintInfo_h | 138 #endif // PaintInfo_h |
| OLD | NEW |