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

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

Issue 30383002: Merge 159961 "Defer the real work in updateCompositingLayers unt..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1675/
Patch Set: 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
« no previous file with comments | « Source/core/rendering/CompositedLayerMapping.cpp ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 }
125 #endif 125 #endif
126 126
127 return result; 127 return result;
128 } 128 }
129 129
130 #ifndef NDEBUG 130 #ifndef NDEBUG
131 // Handy function to call from gdb while debugging mismatched point/rect errors. 131 // Handy function to call from gdb while debugging mismatched point/rect errors.
132 void RenderGeometryMap::dumpSteps() 132 void RenderGeometryMap::dumpSteps()
133 { 133 {
134 fprintf(stderr, "RenderGeometryMap::dumpSteps accumulatedOffset=%d,%d\n", m_ accumulatedOffset.width().toInt(), m_accumulatedOffset.height().toInt()); 134 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))) { 148 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() & & (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) {
149 result = rect; 149 result = rect;
150 result.move(m_accumulatedOffset); 150 result.move(m_accumulatedOffset);
151 } else { 151 } else {
152 TransformState transformState(TransformState::ApplyTransformDirection, r ect.center(), rect); 152 TransformState transformState(TransformState::ApplyTransformDirection, r ect.center(), rect);
153 mapToContainer(transformState, container); 153 mapToContainer(transformState, container);
154 result = transformState.lastPlanarQuad().boundingBox(); 154 result = transformState.lastPlanarQuad().boundingBox();
155 } 155 }
156 156
157 #if !ASSERT_DISABLED 157 #if !ASSERT_DISABLED
158 const RenderObject* lastRenderer = m_mapping.last().m_renderer; 158 if (m_mapping.size() > 0) {
159 const RenderLayer* layer = lastRenderer->enclosingLayer(); 159 const RenderObject* lastRenderer = m_mapping.last().m_renderer;
160 const RenderLayer* layer = lastRenderer->enclosingLayer();
160 161
161 // Bounds for invisible layers are intentionally not calculated, and are 162 // Bounds for invisible layers are intentionally not calculated, and are
162 // therefore not necessarily expected to be correct here. This is ok, 163 // therefore not necessarily expected to be correct here. This is ok,
163 // because they will be recomputed if the layer becomes visible. 164 // because they will be recomputed if the layer becomes visible.
164 if (!layer || !layer->subtreeIsInvisible()) { 165 if (!layer || !layer->subtreeIsInvisible()) {
165 FloatRect rendererMappedResult = lastRenderer->localToContainerQuad(rect , container, m_mapCoordinatesFlags).boundingBox(); 166 FloatRect rendererMappedResult = lastRenderer->localToContainerQuad( rect, container, m_mapCoordinatesFlags).boundingBox();
166 167
167 // Inspector creates renderers with negative width <https://bugs.webkit. org/show_bug.cgi?id=87194>. 168 // Inspector creates renderers with negative width <https://bugs.web kit.org/show_bug.cgi?id=87194>.
168 // Taking FloatQuad bounds avoids spurious assertions because of that. 169 // Taking FloatQuad bounds avoids spurious assertions because of tha t.
169 ASSERT(enclosingIntRect(rendererMappedResult) == enclosingIntRect(FloatQ uad(result).boundingBox())); 170 ASSERT(enclosingIntRect(rendererMappedResult) == enclosingIntRect(Fl oatQuad(result).boundingBox()));
170 // if (enclosingIntRect(rendererMappedResult) != enclosingIntRect(FloatQu ad(result).boundingBox())) 171 }
171 // fprintf(stderr, "Mismatched rects\n");
172 } 172 }
173 #endif 173 #endif
174 174
175 return result; 175 return result;
176 } 176 }
177 177
178 void RenderGeometryMap::pushMappingsToAncestor(const RenderObject* renderer, con st RenderLayerModelObject* ancestorRenderer) 178 void RenderGeometryMap::pushMappingsToAncestor(const RenderObject* renderer, con st RenderLayerModelObject* ancestorRenderer)
179 { 179 {
180 // We need to push mappings in reverse order here, so do insertions rather t han appends. 180 // We need to push mappings in reverse order here, so do insertions rather t han appends.
181 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size() ); 181 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size() );
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 // "topmost" (to preserve original behavior). 330 // "topmost" (to preserve original behavior).
331 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries)) 331 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries))
332 return true; 332 return true;
333 333
334 Frame* thisFrame = renderer->frame(); 334 Frame* thisFrame = renderer->frame();
335 return thisFrame == thisFrame->page()->mainFrame(); 335 return thisFrame == thisFrame->page()->mainFrame();
336 } 336 }
337 #endif 337 #endif
338 338
339 } // namespace WebCore 339 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/CompositedLayerMapping.cpp ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698