| 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 23 matching lines...) Expand all Loading... |
| 34 #include "platform/graphics/GraphicsContextStateSaver.h" | 34 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 35 #include "platform/graphics/paint/DisplayItem.h" | 35 #include "platform/graphics/paint/DisplayItem.h" |
| 36 #include "platform/transforms/AffineTransform.h" | 36 #include "platform/transforms/AffineTransform.h" |
| 37 #include "wtf/HashMap.h" | 37 #include "wtf/HashMap.h" |
| 38 #include "wtf/ListHashSet.h" | 38 #include "wtf/ListHashSet.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 class RenderInline; | 42 class RenderInline; |
| 43 class LayoutLayerModelObject; | 43 class LayoutLayerModelObject; |
| 44 class RenderObject; | 44 class LayoutObject; |
| 45 class RenderPart; | 45 class RenderPart; |
| 46 | 46 |
| 47 struct PaintInfo { | 47 struct PaintInfo { |
| 48 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne
wPhase, PaintBehavior newPaintBehavior, | 48 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne
wPhase, PaintBehavior newPaintBehavior, |
| 49 RenderObject* newPaintingRoot = 0, ListHashSet<RenderInline*>* newOutlin
eObjects = 0, | 49 LayoutObject* newPaintingRoot = 0, ListHashSet<RenderInline*>* newOutlin
eObjects = 0, |
| 50 const LayoutLayerModelObject* newPaintContainer = 0) | 50 const LayoutLayerModelObject* newPaintContainer = 0) |
| 51 : context(newContext) | 51 : context(newContext) |
| 52 , rect(newRect) | 52 , rect(newRect) |
| 53 , phase(newPhase) | 53 , phase(newPhase) |
| 54 , paintBehavior(newPaintBehavior) | 54 , paintBehavior(newPaintBehavior) |
| 55 , paintingRoot(newPaintingRoot) | 55 , paintingRoot(newPaintingRoot) |
| 56 , m_paintContainer(newPaintContainer) | 56 , m_paintContainer(newPaintContainer) |
| 57 , m_outlineObjects(newOutlineObjects) | 57 , m_outlineObjects(newOutlineObjects) |
| 58 { | 58 { |
| 59 } | 59 } |
| 60 | 60 |
| 61 void updatePaintingRootForChildren(const RenderObject* renderer) | 61 void updatePaintingRootForChildren(const LayoutObject* renderer) |
| 62 { | 62 { |
| 63 if (!paintingRoot) | 63 if (!paintingRoot) |
| 64 return; | 64 return; |
| 65 | 65 |
| 66 // If we're the painting root, kids draw normally, and see root of 0. | 66 // If we're the painting root, kids draw normally, and see root of 0. |
| 67 if (paintingRoot == renderer) { | 67 if (paintingRoot == renderer) { |
| 68 paintingRoot = 0; | 68 paintingRoot = 0; |
| 69 return; | 69 return; |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool shouldPaintWithinRoot(const RenderObject* renderer) const | 73 bool shouldPaintWithinRoot(const LayoutObject* renderer) const |
| 74 { | 74 { |
| 75 return !paintingRoot || paintingRoot == renderer; | 75 return !paintingRoot || paintingRoot == renderer; |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool forceBlackText() const { return paintBehavior & PaintBehaviorForceBlack
Text; } | 78 bool forceBlackText() const { return paintBehavior & PaintBehaviorForceBlack
Text; } |
| 79 bool isRenderingClipPathAsMaskImage() const { return paintBehavior & PaintBe
haviorRenderingClipPathAsMask; } | 79 bool isRenderingClipPathAsMaskImage() const { return paintBehavior & PaintBe
haviorRenderingClipPathAsMask; } |
| 80 | 80 |
| 81 bool skipRootBackground() const { return paintBehavior & PaintBehaviorSkipRo
otBackground; } | 81 bool skipRootBackground() const { return paintBehavior & PaintBehaviorSkipRo
otBackground; } |
| 82 bool paintRootBackgroundOnly() const { return paintBehavior & PaintBehaviorR
ootBackgroundOnly; } | 82 bool paintRootBackgroundOnly() const { return paintBehavior & PaintBehaviorR
ootBackgroundOnly; } |
| 83 | 83 |
| 84 DisplayItem::Type displayItemTypeForClipping() const { return DisplayItem::p
aintPhaseToClipBoxType(phase); } | 84 DisplayItem::Type displayItemTypeForClipping() const { return DisplayItem::p
aintPhaseToClipBoxType(phase); } |
| 85 | 85 |
| 86 const LayoutLayerModelObject* paintContainer() const { return m_paintContain
er; } | 86 const LayoutLayerModelObject* paintContainer() const { return m_paintContain
er; } |
| 87 | 87 |
| 88 ListHashSet<RenderInline*>* outlineObjects() const { return m_outlineObjects
; } | 88 ListHashSet<RenderInline*>* outlineObjects() const { return m_outlineObjects
; } |
| 89 void setOutlineObjects(ListHashSet<RenderInline*>* objects) { m_outlineObjec
ts = objects; } | 89 void setOutlineObjects(ListHashSet<RenderInline*>* objects) { m_outlineObjec
ts = objects; } |
| 90 | 90 |
| 91 // FIXME: Introduce setters/getters at some point. Requires a lot of changes
throughout rendering/. | 91 // FIXME: Introduce setters/getters at some point. Requires a lot of changes
throughout rendering/. |
| 92 GraphicsContext* context; | 92 GraphicsContext* context; |
| 93 IntRect rect; // dirty rect used for culling non-intersecting renderers | 93 IntRect rect; // dirty rect used for culling non-intersecting renderers |
| 94 PaintPhase phase; | 94 PaintPhase phase; |
| 95 PaintBehavior paintBehavior; | 95 PaintBehavior paintBehavior; |
| 96 RenderObject* paintingRoot; // used to draw just one element and its visual
kids | 96 LayoutObject* paintingRoot; // used to draw just one element and its visual
kids |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 const LayoutLayerModelObject* m_paintContainer; // the layer object that ori
ginates the current painting | 99 const LayoutLayerModelObject* m_paintContainer; // the layer object that ori
ginates the current painting |
| 100 ListHashSet<RenderInline*>* m_outlineObjects; // used to list outlines that
should be painted by a block with inline children | 100 ListHashSet<RenderInline*>* m_outlineObjects; // used to list outlines that
should be painted by a block with inline children |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace blink | 103 } // namespace blink |
| 104 | 104 |
| 105 #endif // PaintInfo_h | 105 #endif // PaintInfo_h |
| OLD | NEW |