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

Side by Side Diff: sky/engine/core/rendering/RenderLayer.cpp

Issue 878303002: Remove more scrolling code from Sky (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
« no previous file with comments | « sky/engine/core/rendering/RenderLayer.h ('k') | sky/engine/core/rendering/RenderObject.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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 layer->m_hasSelfPaintingLayerDescendantDirty = true; 170 layer->m_hasSelfPaintingLayerDescendantDirty = true;
171 // If we have reached a self-painting layer, we know our parent should h ave a self-painting descendant 171 // If we have reached a self-painting layer, we know our parent should h ave a self-painting descendant
172 // in this case, there is no need to dirty our ancestors further. 172 // in this case, there is no need to dirty our ancestors further.
173 if (layer->isSelfPaintingLayer()) { 173 if (layer->isSelfPaintingLayer()) {
174 ASSERT(!parent() || parent()->m_hasSelfPaintingLayerDescendantDirty || parent()->m_hasSelfPaintingLayerDescendant); 174 ASSERT(!parent() || parent()->m_hasSelfPaintingLayerDescendantDirty || parent()->m_hasSelfPaintingLayerDescendant);
175 break; 175 break;
176 } 176 }
177 } 177 }
178 } 178 }
179 179
180 bool RenderLayer::scrollsWithRespectTo(const RenderLayer* other) const
181 {
182 return ancestorScrollingLayer() != other->ancestorScrollingLayer();
183 }
184
185 void RenderLayer::updateTransformationMatrix() 180 void RenderLayer::updateTransformationMatrix()
186 { 181 {
187 if (m_transform) { 182 if (m_transform) {
188 RenderBox* box = renderBox(); 183 RenderBox* box = renderBox();
189 ASSERT(box); 184 ASSERT(box);
190 m_transform->makeIdentity(); 185 m_transform->makeIdentity();
191 box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRec t().size(), RenderStyle::IncludeTransformOrigin); 186 box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRec t().size(), RenderStyle::IncludeTransformOrigin);
192 makeMatrixRenderable(*m_transform); 187 makeMatrixRenderable(*m_transform);
193 } 188 }
194 } 189 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 localPoint += toRenderBox(curr)->locationOffset(); 349 localPoint += toRenderBox(curr)->locationOffset();
355 } 350 }
356 curr = curr->parent(); 351 curr = curr->parent();
357 } 352 }
358 } 353 }
359 354
360 // Subtract our parent's scroll offset. 355 // Subtract our parent's scroll offset.
361 if (renderer()->isOutOfFlowPositioned() && enclosingPositionedAncestor()) { 356 if (renderer()->isOutOfFlowPositioned() && enclosingPositionedAncestor()) {
362 RenderLayer* positionedParent = enclosingPositionedAncestor(); 357 RenderLayer* positionedParent = enclosingPositionedAncestor();
363 358
364 // For positioned layers, we subtract out the enclosing positioned layer 's scroll offset.
365 if (positionedParent->renderer()->hasOverflowClip()) {
366 LayoutSize offset = positionedParent->renderBox()->scrolledContentOf fset();
367 localPoint -= offset;
368 }
369
370 if (positionedParent->renderer()->isRelPositioned() && positionedParent- >renderer()->isRenderInline()) { 359 if (positionedParent->renderer()->isRelPositioned() && positionedParent- >renderer()->isRenderInline()) {
371 LayoutSize offset = toRenderInline(positionedParent->renderer())->of fsetForInFlowPositionedInline(*toRenderBox(renderer())); 360 LayoutSize offset = toRenderInline(positionedParent->renderer())->of fsetForInFlowPositionedInline(*toRenderBox(renderer()));
372 localPoint += offset; 361 localPoint += offset;
373 } 362 }
374 } else if (parent()) {
375 if (parent()->renderer()->hasOverflowClip()) {
376 IntSize scrollOffset = parent()->renderBox()->scrolledContentOffset( );
377 localPoint -= scrollOffset;
378 }
379 } 363 }
380 364
381 localPoint.move(offsetForInFlowPosition()); 365 localPoint.move(offsetForInFlowPosition());
382 366
383 // FIXME: We'd really like to just get rid of the concept of a layer rectang le and rely on the renderers. 367 // FIXME: We'd really like to just get rid of the concept of a layer rectang le and rely on the renderers.
384 localPoint -= inlineBoundingBoxOffset; 368 localPoint -= inlineBoundingBoxOffset;
385 369
386 return localPoint; 370 return localPoint;
387 } 371 }
388 372
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 } 1767 }
1784 } 1768 }
1785 1769
1786 void showLayerTree(const blink::RenderObject* renderer) 1770 void showLayerTree(const blink::RenderObject* renderer)
1787 { 1771 {
1788 if (!renderer) 1772 if (!renderer)
1789 return; 1773 return;
1790 showLayerTree(renderer->enclosingLayer()); 1774 showLayerTree(renderer->enclosingLayer());
1791 } 1775 }
1792 #endif 1776 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderLayer.h ('k') | sky/engine/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698