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

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

Issue 953673002: Delete RenderLayerModelObject. (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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 19 matching lines...) Expand all
30 #include "sky/engine/core/rendering/RenderObject.h" 30 #include "sky/engine/core/rendering/RenderObject.h"
31 #include "sky/engine/platform/geometry/FloatPoint.h" 31 #include "sky/engine/platform/geometry/FloatPoint.h"
32 #include "sky/engine/platform/geometry/FloatQuad.h" 32 #include "sky/engine/platform/geometry/FloatQuad.h"
33 #include "sky/engine/platform/geometry/IntSize.h" 33 #include "sky/engine/platform/geometry/IntSize.h"
34 #include "sky/engine/platform/geometry/LayoutSize.h" 34 #include "sky/engine/platform/geometry/LayoutSize.h"
35 #include "sky/engine/wtf/OwnPtr.h" 35 #include "sky/engine/wtf/OwnPtr.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 class RenderLayer; 39 class RenderLayer;
40 class RenderLayerModelObject; 40 class RenderBox;
41 class TransformationMatrix; 41 class TransformationMatrix;
42 class TransformState; 42 class TransformState;
43 43
44 // Can be used while walking the Renderer tree to cache data about offsets and t ransforms. 44 // Can be used while walking the Renderer tree to cache data about offsets and t ransforms.
45 class RenderGeometryMap { 45 class RenderGeometryMap {
46 WTF_MAKE_NONCOPYABLE(RenderGeometryMap); 46 WTF_MAKE_NONCOPYABLE(RenderGeometryMap);
47 public: 47 public:
48 RenderGeometryMap(MapCoordinatesFlags = UseTransforms); 48 RenderGeometryMap(MapCoordinatesFlags = UseTransforms);
49 ~RenderGeometryMap(); 49 ~RenderGeometryMap();
50 50
51 MapCoordinatesFlags mapCoordinatesFlags() const { return m_mapCoordinatesFla gs; } 51 MapCoordinatesFlags mapCoordinatesFlags() const { return m_mapCoordinatesFla gs; }
52 52
53 FloatRect absoluteRect(const FloatRect& rect) const 53 FloatRect absoluteRect(const FloatRect& rect) const
54 { 54 {
55 return mapToContainer(rect, 0).boundingBox(); 55 return mapToContainer(rect, 0).boundingBox();
56 } 56 }
57 57
58 // Map to a container. Will assert that the container has been pushed onto t his map. 58 // Map to a container. Will assert that the container has been pushed onto t his map.
59 // A null container maps through the RenderView (including its scale transfo rm, if any). 59 // A null container maps through the RenderView (including its scale transfo rm, if any).
60 // If the container is the RenderView, the scroll offset is applied, but not the scale. 60 // If the container is the RenderView, the scroll offset is applied, but not the scale.
61 FloatPoint mapToContainer(const FloatPoint&, const RenderLayerModelObject*) const; 61 FloatPoint mapToContainer(const FloatPoint&, const RenderBox*) const;
62 FloatQuad mapToContainer(const FloatRect&, const RenderLayerModelObject*) co nst; 62 FloatQuad mapToContainer(const FloatRect&, const RenderBox*) const;
63 63
64 // Called by code walking the renderer or layer trees. 64 // Called by code walking the renderer or layer trees.
65 void pushMappingsToAncestor(const RenderLayer*, const RenderLayer* ancestorL ayer); 65 void pushMappingsToAncestor(const RenderLayer*, const RenderLayer* ancestorL ayer);
66 void popMappingsToAncestor(const RenderLayer*); 66 void popMappingsToAncestor(const RenderLayer*);
67 void pushMappingsToAncestor(const RenderObject*, const RenderLayerModelObjec t* ancestorRenderer); 67 void pushMappingsToAncestor(const RenderObject*, const RenderBox* ancestorRe nderer);
68 void popMappingsToAncestor(const RenderLayerModelObject*); 68 void popMappingsToAncestor(const RenderBox*);
69 69
70 // The following methods should only be called by renderers inside a call to pushMappingsToAncestor(). 70 // The following methods should only be called by renderers inside a call to pushMappingsToAncestor().
71 71
72 // Push geometry info between this renderer and some ancestor. The ancestor must be its container() or some 72 // Push geometry info between this renderer and some ancestor. The ancestor must be its container() or some
73 // stacking context between the renderer and its container. 73 // stacking context between the renderer and its container.
74 void push(const RenderObject*, const LayoutSize&, bool accumulatingTransform = false, bool isNonUniform = false, bool hasTransform = false); 74 void push(const RenderObject*, const LayoutSize&, bool accumulatingTransform = false, bool isNonUniform = false, bool hasTransform = false);
75 void push(const RenderObject*, const TransformationMatrix&, bool accumulatin gTransform = false, bool isNonUniform = false, bool hasTransform = false); 75 void push(const RenderObject*, const TransformationMatrix&, bool accumulatin gTransform = false, bool isNonUniform = false, bool hasTransform = false);
76 76
77 private: 77 private:
78 void mapToContainer(TransformState&, const RenderLayerModelObject* container = 0) const; 78 void mapToContainer(TransformState&, const RenderBox* container = 0) const;
79 79
80 void stepInserted(const RenderGeometryMapStep&); 80 void stepInserted(const RenderGeometryMapStep&);
81 void stepRemoved(const RenderGeometryMapStep&); 81 void stepRemoved(const RenderGeometryMapStep&);
82 82
83 bool hasNonUniformStep() const { return m_nonUniformStepsCount; } 83 bool hasNonUniformStep() const { return m_nonUniformStepsCount; }
84 bool hasTransformStep() const { return m_transformedStepsCount; } 84 bool hasTransformStep() const { return m_transformedStepsCount; }
85 85
86 #ifndef NDEBUG 86 #ifndef NDEBUG
87 void dumpSteps() const; 87 void dumpSteps() const;
88 #endif 88 #endif
89 89
90 #if ENABLE(ASSERT) 90 #if ENABLE(ASSERT)
91 bool isTopmostRenderView(const RenderObject* renderer) const; 91 bool isTopmostRenderView(const RenderObject* renderer) const;
92 #endif 92 #endif
93 93
94 typedef Vector<RenderGeometryMapStep, 32> RenderGeometryMapSteps; 94 typedef Vector<RenderGeometryMapStep, 32> RenderGeometryMapSteps;
95 95
96 size_t m_insertionPosition; 96 size_t m_insertionPosition;
97 int m_nonUniformStepsCount; 97 int m_nonUniformStepsCount;
98 int m_transformedStepsCount; 98 int m_transformedStepsCount;
99 RenderGeometryMapSteps m_mapping; 99 RenderGeometryMapSteps m_mapping;
100 LayoutSize m_accumulatedOffset; 100 LayoutSize m_accumulatedOffset;
101 MapCoordinatesFlags m_mapCoordinatesFlags; 101 MapCoordinatesFlags m_mapCoordinatesFlags;
102 }; 102 };
103 103
104 } // namespace blink 104 } // namespace blink
105 105
106 #endif // SKY_ENGINE_CORE_RENDERING_RENDERGEOMETRYMAP_H_ 106 #endif // SKY_ENGINE_CORE_RENDERING_RENDERGEOMETRYMAP_H_
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBoxModelObject.cpp ('k') | sky/engine/core/rendering/RenderGeometryMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698