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

Side by Side Diff: Source/core/rendering/RenderGeometryMap.cpp

Issue 26110004: Defer the real work in updateCompositingLayers until it's really needed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years, 2 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 | Annotate | Revision Log
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() & & (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) 112 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() & & (!container || (m_mapping.size() && container == m_mapping[0].m_renderer)))
113 result = p + roundedIntSize(m_accumulatedOffset); 113 result = p + roundedIntSize(m_accumulatedOffset);
114 else { 114 else {
115 TransformState transformState(TransformState::ApplyTransformDirection, p ); 115 TransformState transformState(TransformState::ApplyTransformDirection, p );
116 mapToContainer(transformState, container); 116 mapToContainer(transformState, container);
117 result = transformState.lastPlanarPoint(); 117 result = transformState.lastPlanarPoint();
118 } 118 }
119 119
120 #if !ASSERT_DISABLED 120 #if !ASSERT_DISABLED
121 FloatPoint rendererMappedResult = m_mapping.last().m_renderer->localToAbsolu te(p, m_mapCoordinatesFlags); 121 if (m_mapping.size() > 0) {
122 ASSERT(roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)); 122 FloatPoint rendererMappedResult = m_mapping.last().m_renderer->localToAb solute(p, m_mapCoordinatesFlags);
123 // if (roundedIntPoint(rendererMappedResult) != roundedIntPoint(result)) 123 ASSERT(roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)) ;
124 // fprintf(stderr, "Mismatched point\n"); 124 // if (roundedIntPoint(rendererMappedResult) != roundedIntPoint(resul t))
125 // fprintf(stderr, "Mismatched point\n");
126 }
125 #endif 127 #endif
126 128
127 return result; 129 return result;
128 } 130 }
129 131
130 #ifndef NDEBUG 132 #ifndef NDEBUG
131 // Handy function to call from gdb while debugging mismatched point/rect errors. 133 // Handy function to call from gdb while debugging mismatched point/rect errors.
132 void RenderGeometryMap::dumpSteps() 134 void RenderGeometryMap::dumpSteps()
133 { 135 {
134 fprintf(stderr, "RenderGeometryMap::dumpSteps accumulatedOffset=%d,%d\n", m_ accumulatedOffset.width().toInt(), m_accumulatedOffset.height().toInt()); 136 fprintf(stderr, "RenderGeometryMap::dumpSteps accumulatedOffset=%d,%d\n", m_ accumulatedOffset.width().toInt(), m_accumulatedOffset.height().toInt());
(...skipping 13 matching lines...) Expand all
148 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() & & (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) { 150 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() & & (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) {
149 result = rect; 151 result = rect;
150 result.move(m_accumulatedOffset); 152 result.move(m_accumulatedOffset);
151 } else { 153 } else {
152 TransformState transformState(TransformState::ApplyTransformDirection, r ect.center(), rect); 154 TransformState transformState(TransformState::ApplyTransformDirection, r ect.center(), rect);
153 mapToContainer(transformState, container); 155 mapToContainer(transformState, container);
154 result = transformState.lastPlanarQuad().boundingBox(); 156 result = transformState.lastPlanarQuad().boundingBox();
155 } 157 }
156 158
157 #if !ASSERT_DISABLED 159 #if !ASSERT_DISABLED
158 FloatRect rendererMappedResult = m_mapping.last().m_renderer->localToContain erQuad(rect, container, m_mapCoordinatesFlags).boundingBox(); 160 if (m_mapping.size() > 0) {
159 // Inspector creates renderers with negative width <https://bugs.webkit.org/ show_bug.cgi?id=87194>. 161 FloatRect rendererMappedResult = m_mapping.last().m_renderer->localToCon tainerQuad(rect, container, m_mapCoordinatesFlags).boundingBox();
160 // Taking FloatQuad bounds avoids spurious assertions because of that. 162 // Inspector creates renderers with negative width <https://bugs.webkit. org/show_bug.cgi?id=87194>.
161 ASSERT(enclosingIntRect(rendererMappedResult) == enclosingIntRect(FloatQuad( result).boundingBox())); 163 // Taking FloatQuad bounds avoids spurious assertions because of that.
162 // if (enclosingIntRect(rendererMappedResult) != enclosingIntRect(FloatQuad(r esult).boundingBox())) 164 ASSERT(enclosingIntRect(rendererMappedResult) == enclosingIntRect(FloatQ uad(result).boundingBox()));
163 // fprintf(stderr, "Mismatched rects\n"); 165 // if (enclosingIntRect(rendererMappedResult) != enclosingIntRect(Flo atQuad(result).boundingBox()))
166 // fprintf(stderr, "Mismatched rects\n");
167 }
164 #endif 168 #endif
165 169
166 return result; 170 return result;
167 } 171 }
168 172
169 void RenderGeometryMap::pushMappingsToAncestor(const RenderObject* renderer, con st RenderLayerModelObject* ancestorRenderer) 173 void RenderGeometryMap::pushMappingsToAncestor(const RenderObject* renderer, con st RenderLayerModelObject* ancestorRenderer)
170 { 174 {
171 // We need to push mappings in reverse order here, so do insertions rather t han appends. 175 // We need to push mappings in reverse order here, so do insertions rather t han appends.
172 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size() ); 176 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size() );
173 do { 177 do {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 // "topmost" (to preserve original behavior). 325 // "topmost" (to preserve original behavior).
322 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries)) 326 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries))
323 return true; 327 return true;
324 328
325 Frame* thisFrame = renderer->frame(); 329 Frame* thisFrame = renderer->frame();
326 return thisFrame == thisFrame->page()->mainFrame(); 330 return thisFrame == thisFrame->page()->mainFrame();
327 } 331 }
328 #endif 332 #endif
329 333
330 } // namespace WebCore 334 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698