| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include <limits> | 44 #include <limits> |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 class LayoutInline; | 48 class LayoutInline; |
| 49 class LayoutBoxModelObject; | 49 class LayoutBoxModelObject; |
| 50 class LayoutObject; | 50 class LayoutObject; |
| 51 class PaintInvalidationState; | 51 class PaintInvalidationState; |
| 52 | 52 |
| 53 struct CORE_EXPORT PaintInfo { | 53 struct CORE_EXPORT PaintInfo { |
| 54 PaintInfo(GraphicsContext& newContext, const IntRect& cullRect, PaintPhase n
ewPhase, GlobalPaintFlags globalPaintFlags, PaintLayerFlags paintFlags, | 54 PaintInfo(GraphicsContext& newContext, const IntRect& cullRect, PaintPhase n
ewPhase, GlobalPaintFlags globalPaintFlags, |
| 55 LayoutObject* newPaintingRoot = nullptr, const LayoutBoxModelObject* new
PaintContainer = nullptr) | 55 PaintLayerFlags paintFlags, const LayoutBoxModelObject* newPaintContaine
r = nullptr) |
| 56 : context(newContext) | 56 : context(newContext) |
| 57 , phase(newPhase) | 57 , phase(newPhase) |
| 58 , paintingRoot(newPaintingRoot) | |
| 59 , m_cullRect(cullRect) | 58 , m_cullRect(cullRect) |
| 60 , m_paintContainer(newPaintContainer) | 59 , m_paintContainer(newPaintContainer) |
| 61 , m_paintFlags(paintFlags) | 60 , m_paintFlags(paintFlags) |
| 62 , m_globalPaintFlags(globalPaintFlags) | 61 , m_globalPaintFlags(globalPaintFlags) |
| 63 { | 62 { |
| 64 } | 63 } |
| 65 | 64 |
| 66 PaintInfo(GraphicsContext& newContext, const PaintInfo& copyOtherFieldsFrom) | 65 PaintInfo(GraphicsContext& newContext, const PaintInfo& copyOtherFieldsFrom) |
| 67 : context(newContext) | 66 : context(newContext) |
| 68 , phase(copyOtherFieldsFrom.phase) | 67 , phase(copyOtherFieldsFrom.phase) |
| 69 , paintingRoot(copyOtherFieldsFrom.paintingRoot) | |
| 70 , m_cullRect(copyOtherFieldsFrom.m_cullRect) | 68 , m_cullRect(copyOtherFieldsFrom.m_cullRect) |
| 71 , m_paintContainer(copyOtherFieldsFrom.m_paintContainer) | 69 , m_paintContainer(copyOtherFieldsFrom.m_paintContainer) |
| 72 , m_paintFlags(copyOtherFieldsFrom.m_paintFlags) | 70 , m_paintFlags(copyOtherFieldsFrom.m_paintFlags) |
| 73 , m_globalPaintFlags(copyOtherFieldsFrom.m_globalPaintFlags) | 71 , m_globalPaintFlags(copyOtherFieldsFrom.m_globalPaintFlags) |
| 74 { } | 72 { } |
| 75 | 73 |
| 76 // Creates a PaintInfo for painting descendants. See comments about the pain
t phases | 74 // Creates a PaintInfo for painting descendants. See comments about the pain
t phases |
| 77 // in PaintPhase.h for details. | 75 // in PaintPhase.h for details. |
| 78 // TODO(wangxianzhu): Actually use this method. | 76 // TODO(wangxianzhu): Actually use this method. |
| 79 PaintInfo forDescendants() const | 77 PaintInfo forDescendants() const |
| 80 { | 78 { |
| 81 PaintInfo result(*this); | 79 PaintInfo result(*this); |
| 82 if (phase == PaintPhaseDescendantOutlinesOnly) | 80 if (phase == PaintPhaseDescendantOutlinesOnly) |
| 83 result.phase = PaintPhaseOutline; | 81 result.phase = PaintPhaseOutline; |
| 84 else if (phase == PaintPhaseDescendantBlockBackgroundsOnly) | 82 else if (phase == PaintPhaseDescendantBlockBackgroundsOnly) |
| 85 result.phase = PaintPhaseBlockBackground; | 83 result.phase = PaintPhaseBlockBackground; |
| 86 return result; | 84 return result; |
| 87 } | 85 } |
| 88 | 86 |
| 89 void updatePaintingRootForChildren(const LayoutObject*); | |
| 90 | |
| 91 bool shouldPaintWithinRoot(const LayoutObject*) const; | |
| 92 | |
| 93 bool isRenderingClipPathAsMaskImage() const { return m_paintFlags & PaintLay
erPaintingRenderingClipPathAsMask; } | 87 bool isRenderingClipPathAsMaskImage() const { return m_paintFlags & PaintLay
erPaintingRenderingClipPathAsMask; } |
| 94 | 88 |
| 95 bool skipRootBackground() const { return m_paintFlags & PaintLayerPaintingSk
ipRootBackground; } | 89 bool skipRootBackground() const { return m_paintFlags & PaintLayerPaintingSk
ipRootBackground; } |
| 96 bool paintRootBackgroundOnly() const { return m_paintFlags & PaintLayerPaint
ingRootBackgroundOnly; } | 90 bool paintRootBackgroundOnly() const { return m_paintFlags & PaintLayerPaint
ingRootBackgroundOnly; } |
| 97 | 91 |
| 98 bool isPrinting() const { return m_globalPaintFlags & GlobalPaintPrinting; } | 92 bool isPrinting() const { return m_globalPaintFlags & GlobalPaintPrinting; } |
| 99 | 93 |
| 100 DisplayItem::Type displayItemTypeForClipping() const { return DisplayItem::p
aintPhaseToClipBoxType(phase); } | 94 DisplayItem::Type displayItemTypeForClipping() const { return DisplayItem::p
aintPhaseToClipBoxType(phase); } |
| 101 | 95 |
| 102 const LayoutBoxModelObject* paintContainer() const { return m_paintContainer
; } | 96 const LayoutBoxModelObject* paintContainer() const { return m_paintContainer
; } |
| 103 | 97 |
| 104 GlobalPaintFlags globalPaintFlags() const { return m_globalPaintFlags; } | 98 GlobalPaintFlags globalPaintFlags() const { return m_globalPaintFlags; } |
| 105 | 99 |
| 106 PaintLayerFlags paintFlags() const { return m_paintFlags; } | 100 PaintLayerFlags paintFlags() const { return m_paintFlags; } |
| 107 | 101 |
| 108 const CullRect& cullRect() const { return m_cullRect; } | 102 const CullRect& cullRect() const { return m_cullRect; } |
| 109 | 103 |
| 110 void updateCullRect(const AffineTransform& localToParentTransform); | 104 void updateCullRect(const AffineTransform& localToParentTransform); |
| 111 | 105 |
| 112 // FIXME: Introduce setters/getters at some point. Requires a lot of changes
throughout layout/. | 106 // FIXME: Introduce setters/getters at some point. Requires a lot of changes
throughout layout/. |
| 113 GraphicsContext& context; | 107 GraphicsContext& context; |
| 114 PaintPhase phase; | 108 PaintPhase phase; |
| 115 LayoutObject* paintingRoot; // used to draw just one element and its visual
kids | |
| 116 | 109 |
| 117 private: | 110 private: |
| 118 CullRect m_cullRect; | 111 CullRect m_cullRect; |
| 119 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 |
| 120 | 113 |
| 121 const PaintLayerFlags m_paintFlags; | 114 const PaintLayerFlags m_paintFlags; |
| 122 const GlobalPaintFlags m_globalPaintFlags; | 115 const GlobalPaintFlags m_globalPaintFlags; |
| 123 | 116 |
| 124 // TODO(chrishtr): temporary while we implement CullRect everywhere. | 117 // TODO(chrishtr): temporary while we implement CullRect everywhere. |
| 125 friend class SVGPaintContext; | 118 friend class SVGPaintContext; |
| 126 friend class SVGShapePainter; | 119 friend class SVGShapePainter; |
| 127 }; | 120 }; |
| 128 | 121 |
| 129 } // namespace blink | 122 } // namespace blink |
| 130 | 123 |
| 131 #endif // PaintInfo_h | 124 #endif // PaintInfo_h |
| OLD | NEW |