| 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 |
| 11 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
| 12 * version 2 of the License, or (at your option) any later version. | 12 * version 2 of the License, or (at your option) any later version. |
| 13 * | 13 * |
| 14 * This library is distributed in the hope that it will be useful, | 14 * This library is distributed in the hope that it will be useful, |
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 * Library General Public License for more details. | 17 * Library General Public License for more details. |
| 18 * | 18 * |
| 19 * You should have received a copy of the GNU Library General Public License | 19 * You should have received a copy of the GNU Library General Public License |
| 20 * along with this library; see the file COPYING.LIB. If not, write to | 20 * along with this library; see the file COPYING.LIB. If not, write to |
| 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
| 23 * | 23 * |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_ | 26 #ifndef SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_ |
| 27 #define SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_ | 27 #define SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_ |
| 28 | 28 |
| 29 #include <limits> | 29 #include <limits> |
| 30 #include "sky/engine/core/rendering/PaintPhase.h" | |
| 31 #include "sky/engine/platform/geometry/IntRect.h" | 30 #include "sky/engine/platform/geometry/IntRect.h" |
| 32 #include "sky/engine/platform/geometry/LayoutRect.h" | 31 #include "sky/engine/platform/geometry/LayoutRect.h" |
| 33 #include "sky/engine/platform/graphics/GraphicsContext.h" | 32 #include "sky/engine/platform/graphics/GraphicsContext.h" |
| 34 #include "sky/engine/platform/transforms/AffineTransform.h" | 33 #include "sky/engine/platform/transforms/AffineTransform.h" |
| 35 #include "sky/engine/wtf/HashMap.h" | 34 #include "sky/engine/wtf/HashMap.h" |
| 36 #include "sky/engine/wtf/ListHashSet.h" | 35 #include "sky/engine/wtf/ListHashSet.h" |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 40 class RenderInline; | 39 class RenderInline; |
| 41 class RenderLayerModelObject; | 40 class RenderLayerModelObject; |
| 42 class RenderObject; | 41 class RenderObject; |
| 43 | 42 |
| 44 /* | 43 /* |
| 45 * Paint the object and its children, clipped by (x|y|w|h). | 44 * Paint the object and its children, clipped by (x|y|w|h). |
| 46 * (tx|ty) is the calculated position of the parent | 45 * (tx|ty) is the calculated position of the parent |
| 47 */ | 46 */ |
| 48 struct PaintInfo { | 47 struct PaintInfo { |
| 49 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne
wPhase, | 48 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, |
| 50 const RenderLayerModelObject* newPaintContainer) | 49 const RenderLayerModelObject* newPaintContainer) |
| 51 : context(newContext) | 50 : context(newContext) |
| 52 , rect(newRect) | 51 , rect(newRect) |
| 53 , phase(newPhase) | |
| 54 , m_paintContainer(newPaintContainer) | 52 , m_paintContainer(newPaintContainer) |
| 55 { | 53 { |
| 56 } | 54 } |
| 57 | 55 |
| 58 void applyTransform(const AffineTransform& localToAncestorTransform, bool id
entityStatusUnknown = true) | 56 void applyTransform(const AffineTransform& localToAncestorTransform, bool id
entityStatusUnknown = true) |
| 59 { | 57 { |
| 60 if (identityStatusUnknown && localToAncestorTransform.isIdentity()) | 58 if (identityStatusUnknown && localToAncestorTransform.isIdentity()) |
| 61 return; | 59 return; |
| 62 | 60 |
| 63 context->concatCTM(localToAncestorTransform); | 61 context->concatCTM(localToAncestorTransform); |
| 64 | 62 |
| 65 if (rect == infiniteRect()) | 63 if (rect == infiniteRect()) |
| 66 return; | 64 return; |
| 67 | 65 |
| 68 if (localToAncestorTransform.isInvertible()) | 66 if (localToAncestorTransform.isInvertible()) |
| 69 rect = localToAncestorTransform.inverse().mapRect(rect); | 67 rect = localToAncestorTransform.inverse().mapRect(rect); |
| 70 else | 68 else |
| 71 rect.setSize(IntSize(0, 0)); | 69 rect.setSize(IntSize(0, 0)); |
| 72 } | 70 } |
| 73 | 71 |
| 74 static IntRect infiniteRect() { return IntRect(LayoutRect::infiniteRect());
} | 72 static IntRect infiniteRect() { return IntRect(LayoutRect::infiniteRect());
} |
| 75 const RenderLayerModelObject* paintContainer() const { return m_paintContain
er; } | 73 const RenderLayerModelObject* paintContainer() const { return m_paintContain
er; } |
| 76 | 74 |
| 77 // FIXME: Introduce setters/getters at some point. Requires a lot of changes
throughout rendering/. | 75 // FIXME: Introduce setters/getters at some point. Requires a lot of changes
throughout rendering/. |
| 78 GraphicsContext* context; | 76 GraphicsContext* context; |
| 79 IntRect rect; | 77 IntRect rect; |
| 80 PaintPhase phase; | |
| 81 | 78 |
| 82 private: | 79 private: |
| 83 const RenderLayerModelObject* m_paintContainer; // the layer object that ori
ginates the current painting | 80 const RenderLayerModelObject* m_paintContainer; // the layer object that ori
ginates the current painting |
| 84 }; | 81 }; |
| 85 | 82 |
| 86 } // namespace blink | 83 } // namespace blink |
| 87 | 84 |
| 88 #endif // SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_ | 85 #endif // SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_ |
| OLD | NEW |