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

Side by Side Diff: sky/engine/core/rendering/PaintInfo.h

Issue 882223005: Remove painting roots. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
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 29 matching lines...) Expand all
40 class RenderInline; 40 class RenderInline;
41 class RenderLayerModelObject; 41 class RenderLayerModelObject;
42 class RenderObject; 42 class RenderObject;
43 43
44 /* 44 /*
45 * Paint the object and its children, clipped by (x|y|w|h). 45 * Paint the object and its children, clipped by (x|y|w|h).
46 * (tx|ty) is the calculated position of the parent 46 * (tx|ty) is the calculated position of the parent
47 */ 47 */
48 struct PaintInfo { 48 struct PaintInfo {
49 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne wPhase, 49 PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase ne wPhase,
50 RenderObject* newPaintingRoot, const RenderLayerModelObject* newPaintCon tainer) 50 const RenderLayerModelObject* newPaintContainer)
51 : context(newContext) 51 : context(newContext)
52 , rect(newRect) 52 , rect(newRect)
53 , phase(newPhase) 53 , phase(newPhase)
54 , paintingRoot(newPaintingRoot)
55 , m_paintContainer(newPaintContainer) 54 , m_paintContainer(newPaintContainer)
56 { 55 {
57 } 56 }
58 57
59 void updatePaintingRootForChildren(const RenderObject* renderer)
60 {
61 if (!paintingRoot)
62 return;
63
64 // If we're the painting root, kids draw normally, and see root of 0.
65 if (paintingRoot == renderer) {
66 paintingRoot = 0;
67 return;
68 }
69 }
70
71 bool shouldPaintWithinRoot(const RenderObject* renderer) const
72 {
73 return !paintingRoot || paintingRoot == renderer;
74 }
75
76 void applyTransform(const AffineTransform& localToAncestorTransform, bool id entityStatusUnknown = true) 58 void applyTransform(const AffineTransform& localToAncestorTransform, bool id entityStatusUnknown = true)
77 { 59 {
78 if (identityStatusUnknown && localToAncestorTransform.isIdentity()) 60 if (identityStatusUnknown && localToAncestorTransform.isIdentity())
79 return; 61 return;
80 62
81 context->concatCTM(localToAncestorTransform); 63 context->concatCTM(localToAncestorTransform);
82 64
83 if (rect == infiniteRect()) 65 if (rect == infiniteRect())
84 return; 66 return;
85 67
86 if (localToAncestorTransform.isInvertible()) 68 if (localToAncestorTransform.isInvertible())
87 rect = localToAncestorTransform.inverse().mapRect(rect); 69 rect = localToAncestorTransform.inverse().mapRect(rect);
88 else 70 else
89 rect.setSize(IntSize(0, 0)); 71 rect.setSize(IntSize(0, 0));
90 } 72 }
91 73
92 static IntRect infiniteRect() { return IntRect(LayoutRect::infiniteRect()); } 74 static IntRect infiniteRect() { return IntRect(LayoutRect::infiniteRect()); }
93 const RenderLayerModelObject* paintContainer() const { return m_paintContain er; } 75 const RenderLayerModelObject* paintContainer() const { return m_paintContain er; }
94 76
95 // FIXME: Introduce setters/getters at some point. Requires a lot of changes throughout rendering/. 77 // FIXME: Introduce setters/getters at some point. Requires a lot of changes throughout rendering/.
96 GraphicsContext* context; 78 GraphicsContext* context;
97 IntRect rect; 79 IntRect rect;
98 PaintPhase phase; 80 PaintPhase phase;
99 RenderObject* paintingRoot; // used to draw just one element and its visual kids
100 81
101 private: 82 private:
102 const RenderLayerModelObject* m_paintContainer; // the layer object that ori ginates the current painting 83 const RenderLayerModelObject* m_paintContainer; // the layer object that ori ginates the current painting
103 }; 84 };
104 85
105 } // namespace blink 86 } // namespace blink
106 87
107 #endif // SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_ 88 #endif // SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/LayerPaintingInfo.h ('k') | sky/engine/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698