| OLD | NEW |
| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 #endif | 132 #endif |
| 133 | 133 |
| 134 bool RenderView::shouldDoFullPaintInvalidationForNextLayout() const | 134 bool RenderView::shouldDoFullPaintInvalidationForNextLayout() const |
| 135 { | 135 { |
| 136 // It's hard to predict here which of full paint invalidation or per-descend
ant paint invalidation costs less. | 136 // It's hard to predict here which of full paint invalidation or per-descend
ant paint invalidation costs less. |
| 137 // For vertical writing mode or width change it's more likely that per-desce
ndant paint invalidation | 137 // For vertical writing mode or width change it's more likely that per-desce
ndant paint invalidation |
| 138 // eventually turns out to be full paint invalidation but with the cost to h
andle more layout states | 138 // eventually turns out to be full paint invalidation but with the cost to h
andle more layout states |
| 139 // and discrete paint invalidation rects, so marking full paint invalidation
here is more likely to cost less. | 139 // and discrete paint invalidation rects, so marking full paint invalidation
here is more likely to cost less. |
| 140 // Otherwise, per-descendant paint invalidation is more likely to avoid unne
cessary full paint invalidation. | 140 // Otherwise, per-descendant paint invalidation is more likely to avoid unne
cessary full paint invalidation. |
| 141 | 141 |
| 142 if (!style()->isHorizontalWritingMode() || width() != viewWidth()) | 142 if (width() != viewWidth()) |
| 143 return true; | 143 return true; |
| 144 | 144 |
| 145 if (height() != viewHeight()) { | 145 if (height() != viewHeight()) { |
| 146 if (RenderObject* backgroundRenderer = this->backgroundRenderer()) { | 146 if (RenderObject* backgroundRenderer = this->backgroundRenderer()) { |
| 147 // When background-attachment is 'fixed', we treat the viewport (ins
tead of the 'root' | 147 // When background-attachment is 'fixed', we treat the viewport (ins
tead of the 'root' |
| 148 // i.e. html or body) as the background positioning area, and we sho
uld full paint invalidation | 148 // i.e. html or body) as the background positioning area, and we sho
uld full paint invalidation |
| 149 // viewport resize if the background image is not composited and nee
ds full paint invalidation on | 149 // viewport resize if the background image is not composited and nee
ds full paint invalidation on |
| 150 // background positioning area resize. | 150 // background positioning area resize. |
| 151 if (!m_compositor || !m_compositor->needsFixedRootBackgroundLayer(la
yer())) { | 151 if (!m_compositor || !m_compositor->needsFixedRootBackgroundLayer(la
yer())) { |
| 152 if (backgroundRenderer->style()->hasFixedBackgroundImage() | 152 if (backgroundRenderer->style()->hasFixedBackgroundImage() |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 | 339 |
| 340 // The only way we know how to hit these ASSERTS below this point is via the
Chromium OS login screen. | 340 // The only way we know how to hit these ASSERTS below this point is via the
Chromium OS login screen. |
| 341 DisableCompositingQueryAsserts disabler; | 341 DisableCompositingQueryAsserts disabler; |
| 342 | 342 |
| 343 if (compositor()->inCompositingMode()) | 343 if (compositor()->inCompositingMode()) |
| 344 compositor()->fullyInvalidatePaint(); | 344 compositor()->fullyInvalidatePaint(); |
| 345 } | 345 } |
| 346 | 346 |
| 347 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* sta
te) const | 347 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* sta
te) const |
| 348 { | 348 { |
| 349 if (style()->isFlippedBlocksWritingMode()) { | |
| 350 // We have to flip by hand since the view's logical height has not been
determined. We | |
| 351 // can use the viewport width and height. | |
| 352 if (style()->isHorizontalWritingMode()) | |
| 353 rect.setY(viewHeight() - rect.maxY()); | |
| 354 else | |
| 355 rect.setX(viewWidth() - rect.maxX()); | |
| 356 } | |
| 357 | |
| 358 // Apply our transform if we have one (because of full page zooming). | 349 // Apply our transform if we have one (because of full page zooming). |
| 359 if (!paintInvalidationContainer && layer() && layer()->transform()) | 350 if (!paintInvalidationContainer && layer() && layer()->transform()) |
| 360 rect = layer()->transform()->mapRect(rect); | 351 rect = layer()->transform()->mapRect(rect); |
| 361 } | 352 } |
| 362 | 353 |
| 363 | 354 |
| 364 void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumu
latedOffset) const | 355 void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumu
latedOffset) const |
| 365 { | 356 { |
| 366 rects.append(pixelSnappedIntRect(accumulatedOffset, layer()->size())); | 357 rects.append(pixelSnappedIntRect(accumulatedOffset, layer()->size())); |
| 367 } | 358 } |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 return viewWidth(IncludeScrollbars) / scale; | 771 return viewWidth(IncludeScrollbars) / scale; |
| 781 } | 772 } |
| 782 | 773 |
| 783 double RenderView::layoutViewportHeight() const | 774 double RenderView::layoutViewportHeight() const |
| 784 { | 775 { |
| 785 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; | 776 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; |
| 786 return viewHeight(IncludeScrollbars) / scale; | 777 return viewHeight(IncludeScrollbars) / scale; |
| 787 } | 778 } |
| 788 | 779 |
| 789 } // namespace blink | 780 } // namespace blink |
| OLD | NEW |