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

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

Issue 681023002: Remove a bunch of frame-level scrolling machinery. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/RenderView.h ('k') | sky/engine/platform/scroll/ScrollAnimator.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 void RenderView::mapLocalToContainer(const RenderLayerModelObject* paintInvalida tionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* w asFixed, const PaintInvalidationState* paintInvalidationState) const 194 void RenderView::mapLocalToContainer(const RenderLayerModelObject* paintInvalida tionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* w asFixed, const PaintInvalidationState* paintInvalidationState) const
195 { 195 {
196 ASSERT_UNUSED(wasFixed, !wasFixed || *wasFixed == static_cast<bool>(mode & I sFixed)); 196 ASSERT_UNUSED(wasFixed, !wasFixed || *wasFixed == static_cast<bool>(mode & I sFixed));
197 197
198 if (!paintInvalidationContainer && mode & UseTransforms && shouldUseTransfor mFromContainer(0)) { 198 if (!paintInvalidationContainer && mode & UseTransforms && shouldUseTransfor mFromContainer(0)) {
199 TransformationMatrix t; 199 TransformationMatrix t;
200 getTransformFromContainer(0, LayoutSize(), t); 200 getTransformFromContainer(0, LayoutSize(), t);
201 transformState.applyTransform(t); 201 transformState.applyTransform(t);
202 } 202 }
203
204 if (mode & IsFixed && m_frameView)
205 transformState.move(m_frameView->scrollOffsetForFixedPosition());
206
207 if (paintInvalidationContainer == this)
208 return;
209 } 203 }
210 204
211 const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObj ect* ancestorToStopAt, RenderGeometryMap& geometryMap) const 205 const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObj ect* ancestorToStopAt, RenderGeometryMap& geometryMap) const
212 { 206 {
207 // FIXME(sky): Can we remove offsetForFixedPosition?
213 LayoutSize offsetForFixedPosition; 208 LayoutSize offsetForFixedPosition;
214 LayoutSize offset; 209 LayoutSize offset;
215 RenderObject* container = 0; 210 RenderObject* container = 0;
216 211
217 if (m_frameView)
218 offsetForFixedPosition = m_frameView->scrollOffsetForFixedPosition();
219
220 // If a container was specified, and was not 0 or the RenderView, then we 212 // If a container was specified, and was not 0 or the RenderView, then we
221 // should have found it by now unless we're traversing to a parent document. 213 // should have found it by now unless we're traversing to a parent document.
222 ASSERT_ARG(ancestorToStopAt, !ancestorToStopAt || ancestorToStopAt == this | | container); 214 ASSERT_ARG(ancestorToStopAt, !ancestorToStopAt || ancestorToStopAt == this | | container);
223 215
224 if ((!ancestorToStopAt || container) && shouldUseTransformFromContainer(cont ainer)) { 216 if ((!ancestorToStopAt || container) && shouldUseTransformFromContainer(cont ainer)) {
225 TransformationMatrix t; 217 TransformationMatrix t;
226 getTransformFromContainer(container, LayoutSize(), t); 218 getTransformFromContainer(container, LayoutSize(), t);
227 geometryMap.push(this, t, false, false, false, true, offsetForFixedPosit ion); 219 geometryMap.push(this, t, false, false, false, true, offsetForFixedPosit ion);
228 } else { 220 } else {
229 geometryMap.push(this, offset, false, false, false, false, offsetForFixe dPosition); 221 geometryMap.push(this, offset, false, false, false, false, offsetForFixe dPosition);
230 } 222 }
231 223
232 return container; 224 return container;
233 } 225 }
234 226
235 void RenderView::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformStat e& transformState) const 227 void RenderView::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformStat e& transformState) const
236 { 228 {
237 if (mode & IsFixed && m_frameView)
238 transformState.move(m_frameView->scrollOffsetForFixedPosition());
239
240 if (mode & UseTransforms && shouldUseTransformFromContainer(0)) { 229 if (mode & UseTransforms && shouldUseTransformFromContainer(0)) {
241 TransformationMatrix t; 230 TransformationMatrix t;
242 getTransformFromContainer(0, LayoutSize(), t); 231 getTransformFromContainer(0, LayoutSize(), t);
243 transformState.applyTransform(t); 232 transformState.applyTransform(t);
244 } 233 }
245 } 234 }
246 235
247 void RenderView::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layout Point&) const 236 void RenderView::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layout Point&) const
248 { 237 {
249 // Record the entire size of the contents of the frame. Note that we don't j ust 238 // Record the entire size of the contents of the frame. Note that we don't j ust
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 { 342 {
354 setShouldDoFullPaintInvalidation(true); 343 setShouldDoFullPaintInvalidation(true);
355 344
356 // The only way we know how to hit these ASSERTS below this point is via the Chromium OS login screen. 345 // The only way we know how to hit these ASSERTS below this point is via the Chromium OS login screen.
357 DisableCompositingQueryAsserts disabler; 346 DisableCompositingQueryAsserts disabler;
358 347
359 if (compositor()->inCompositingMode()) 348 if (compositor()->inCompositingMode())
360 compositor()->fullyInvalidatePaint(); 349 compositor()->fullyInvalidatePaint();
361 } 350 }
362 351
363 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* inv alidationState) const 352 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* sta te) const
364 {
365 mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, IsNotFix edPosition, invalidationState);
366 }
367
368 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, ViewportConstrainedPosition viewp ortConstraint, const PaintInvalidationState* state) const
369 { 353 {
370 if (style()->isFlippedBlocksWritingMode()) { 354 if (style()->isFlippedBlocksWritingMode()) {
371 // We have to flip by hand since the view's logical height has not been determined. We 355 // We have to flip by hand since the view's logical height has not been determined. We
372 // can use the viewport width and height. 356 // can use the viewport width and height.
373 if (style()->isHorizontalWritingMode()) 357 if (style()->isHorizontalWritingMode())
374 rect.setY(viewHeight() - rect.maxY()); 358 rect.setY(viewHeight() - rect.maxY());
375 else 359 else
376 rect.setX(viewWidth() - rect.maxX()); 360 rect.setX(viewWidth() - rect.maxX());
377 } 361 }
378 362
379 if (viewportConstraint == IsFixedPosition && m_frameView) {
380 rect.move(m_frameView->scrollOffsetForFixedPosition());
381 }
382
383 // Apply our transform if we have one (because of full page zooming). 363 // Apply our transform if we have one (because of full page zooming).
384 if (!paintInvalidationContainer && layer() && layer()->transform()) 364 if (!paintInvalidationContainer && layer() && layer()->transform())
385 rect = layer()->transform()->mapRect(rect); 365 rect = layer()->transform()->mapRect(rect);
386 } 366 }
387 367
388 368
389 void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumu latedOffset) const 369 void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumu latedOffset) const
390 { 370 {
391 rects.append(pixelSnappedIntRect(accumulatedOffset, layer()->size())); 371 rects.append(pixelSnappedIntRect(accumulatedOffset, layer()->size()));
392 } 372 }
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 return viewWidth(IncludeScrollbars) / scale; 794 return viewWidth(IncludeScrollbars) / scale;
815 } 795 }
816 796
817 double RenderView::layoutViewportHeight() const 797 double RenderView::layoutViewportHeight() const
818 { 798 {
819 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; 799 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1;
820 return viewHeight(IncludeScrollbars) / scale; 800 return viewHeight(IncludeScrollbars) / scale;
821 } 801 }
822 802
823 } // namespace blink 803 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderView.h ('k') | sky/engine/platform/scroll/ScrollAnimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698