OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/paint/BackgroundImageGeometry.h" | 5 #include "core/paint/BackgroundImageGeometry.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/layout/LayoutBox.h" | 8 #include "core/layout/LayoutBox.h" |
9 #include "core/layout/LayoutBoxModelObject.h" | 9 #include "core/layout/LayoutBoxModelObject.h" |
10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 paintRect.size() - LayoutSize(left + right, top + bottom); | 387 paintRect.size() - LayoutSize(left + right, top + bottom); |
388 } | 388 } |
389 } else { | 389 } else { |
390 setHasNonLocalGeometry(); | 390 setHasNonLocalGeometry(); |
391 | 391 |
392 LayoutRect viewportRect = obj.viewRect(); | 392 LayoutRect viewportRect = obj.viewRect(); |
393 if (fixedBackgroundPaintsInLocalCoordinates(obj, globalPaintFlags)) { | 393 if (fixedBackgroundPaintsInLocalCoordinates(obj, globalPaintFlags)) { |
394 viewportRect.setLocation(LayoutPoint()); | 394 viewportRect.setLocation(LayoutPoint()); |
395 } else { | 395 } else { |
396 if (FrameView* frameView = obj.view()->frameView()) | 396 if (FrameView* frameView = obj.view()->frameView()) |
397 viewportRect.setLocation(frameView->scrollPosition()); | 397 viewportRect.setLocation(IntPoint(frameView->scrollOffsetInt())); |
398 // Compensate the translations created by ScrollRecorders. | 398 // Compensate the translations created by ScrollRecorders. |
399 // TODO(trchen): Fix this for SP phase 2. crbug.com/529963. | 399 // TODO(trchen): Fix this for SP phase 2. crbug.com/529963. |
400 viewportRect.moveBy( | 400 viewportRect.moveBy( |
401 accumulatedScrollOffsetForFixedBackground(obj, paintContainer)); | 401 accumulatedScrollOffsetForFixedBackground(obj, paintContainer)); |
402 } | 402 } |
403 | 403 |
404 if (paintContainer) | 404 if (paintContainer) |
405 viewportRect.moveBy( | 405 viewportRect.moveBy( |
406 LayoutPoint(-paintContainer->localToAbsolute(FloatPoint()))); | 406 LayoutPoint(-paintContainer->localToAbsolute(FloatPoint()))); |
407 | 407 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 useFixedAttachment(paintRect.location()); | 522 useFixedAttachment(paintRect.location()); |
523 | 523 |
524 // Clip the final output rect to the paint rect | 524 // Clip the final output rect to the paint rect |
525 m_destRect.intersect(paintRect); | 525 m_destRect.intersect(paintRect); |
526 | 526 |
527 // Snap as-yet unsnapped values. | 527 // Snap as-yet unsnapped values. |
528 setDestRect(LayoutRect(pixelSnappedIntRect(m_destRect))); | 528 setDestRect(LayoutRect(pixelSnappedIntRect(m_destRect))); |
529 } | 529 } |
530 | 530 |
531 } // namespace blink | 531 } // namespace blink |
OLD | NEW |