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/PaintLayerPainter.h" | 5 #include "core/paint/PaintLayerPainter.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
9 #include "core/layout/LayoutBlock.h" | 9 #include "core/layout/LayoutBlock.h" |
10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 } | 363 } |
364 | 364 |
365 bool selectionOnly = localPaintingInfo.getGlobalPaintFlags() & GlobalPaintSe
lectionOnly; | 365 bool selectionOnly = localPaintingInfo.getGlobalPaintFlags() & GlobalPaintSe
lectionOnly; |
366 | 366 |
367 { // Begin block for the lifetime of any filter. | 367 { // Begin block for the lifetime of any filter. |
368 FilterPainter filterPainter(m_paintLayer, context, offsetFromRoot, layer
Fragments.isEmpty() ? ClipRect() : layerFragments[0].backgroundRect, localPainti
ngInfo, paintFlags, | 368 FilterPainter filterPainter(m_paintLayer, context, offsetFromRoot, layer
Fragments.isEmpty() ? ClipRect() : layerFragments[0].backgroundRect, localPainti
ngInfo, paintFlags, |
369 rootRelativeBounds, rootRelativeBoundsComputed); | 369 rootRelativeBounds, rootRelativeBoundsComputed); |
370 | 370 |
371 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; | 371 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; |
372 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 372 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
373 ObjectPaintProperties* objectPaintProperties = m_paintLayer.layoutOb
ject()->objectPaintProperties(); | 373 const ObjectPaintProperties* objectPaintProperties = m_paintLayer.la
youtObject()->objectPaintProperties(); |
374 ASSERT(objectPaintProperties && objectPaintProperties->localBorderBo
xProperties()); | 374 ASSERT(objectPaintProperties && objectPaintProperties->localBorderBo
xProperties()); |
375 PaintChunkProperties properties(context.getPaintController().current
PaintChunkProperties()); | 375 PaintChunkProperties properties(context.getPaintController().current
PaintChunkProperties()); |
376 auto& localBorderBoxProperties = *objectPaintProperties->localBorder
BoxProperties(); | 376 auto& localBorderBoxProperties = *objectPaintProperties->localBorder
BoxProperties(); |
377 properties.transform = localBorderBoxProperties.propertyTreeState.tr
ansform; | 377 properties.transform = localBorderBoxProperties.propertyTreeState.tr
ansform; |
378 properties.clip = localBorderBoxProperties.propertyTreeState.clip; | 378 properties.clip = localBorderBoxProperties.propertyTreeState.clip; |
379 properties.effect = localBorderBoxProperties.propertyTreeState.effec
t; | 379 properties.effect = localBorderBoxProperties.propertyTreeState.effec
t; |
380 properties.backfaceHidden = m_paintLayer.layoutObject()->hasHiddenBa
ckface(); | 380 properties.backfaceHidden = m_paintLayer.layoutObject()->hasHiddenBa
ckface(); |
381 scopedPaintChunkProperties.emplace(context.getPaintController(), m_p
aintLayer, properties); | 381 scopedPaintChunkProperties.emplace(context.getPaintController(), m_p
aintLayer, properties); |
382 } | 382 } |
383 | 383 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 break; | 686 break; |
687 } | 687 } |
688 | 688 |
689 clipRecorder.emplace(context, *m_paintLayer.layoutObject(), clipType, cl
ipRect, &paintingInfo, fragment.paginationOffset, paintFlags, clippingRule); | 689 clipRecorder.emplace(context, *m_paintLayer.layoutObject(), clipType, cl
ipRect, &paintingInfo, fragment.paginationOffset, paintFlags, clippingRule); |
690 } | 690 } |
691 | 691 |
692 LayoutRect newCullRect(clipRect.rect()); | 692 LayoutRect newCullRect(clipRect.rect()); |
693 Optional<ScrollRecorder> scrollRecorder; | 693 Optional<ScrollRecorder> scrollRecorder; |
694 LayoutPoint paintOffset = -m_paintLayer.layoutBoxLocation(); | 694 LayoutPoint paintOffset = -m_paintLayer.layoutBoxLocation(); |
695 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 695 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
696 ObjectPaintProperties* objectPaintProperties = m_paintLayer.layoutObject
()->objectPaintProperties(); | 696 const ObjectPaintProperties* objectPaintProperties = m_paintLayer.layout
Object()->objectPaintProperties(); |
697 ASSERT(objectPaintProperties && objectPaintProperties->localBorderBoxPro
perties()); | 697 ASSERT(objectPaintProperties && objectPaintProperties->localBorderBoxPro
perties()); |
698 paintOffset += toSize(objectPaintProperties->localBorderBoxProperties()-
>paintOffset); | 698 paintOffset += toSize(objectPaintProperties->localBorderBoxProperties()-
>paintOffset); |
699 } else { | 699 } else { |
700 paintOffset += toSize(fragment.layerBounds.location()); | 700 paintOffset += toSize(fragment.layerBounds.location()); |
701 if (!paintingInfo.scrollOffsetAccumulation.isZero()) { | 701 if (!paintingInfo.scrollOffsetAccumulation.isZero()) { |
702 // As a descendant of the root layer, m_paintLayer's painting is not
controlled by the ScrollRecorders | 702 // As a descendant of the root layer, m_paintLayer's painting is not
controlled by the ScrollRecorders |
703 // created by BlockPainter of the ancestor layers up to the root lay
er, so we need to issue ScrollRecorder | 703 // created by BlockPainter of the ancestor layers up to the root lay
er, so we need to issue ScrollRecorder |
704 // for this layer seperately, with the scroll offset accumulated fro
m the root layer to the parent of this | 704 // for this layer seperately, with the scroll offset accumulated fro
m the root layer to the parent of this |
705 // layer, to get the same result as ScrollRecorder in BlockPainter. | 705 // layer, to get the same result as ScrollRecorder in BlockPainter. |
706 paintOffset += paintingInfo.scrollOffsetAccumulation; | 706 paintOffset += paintingInfo.scrollOffsetAccumulation; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 809 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
810 return; | 810 return; |
811 | 811 |
812 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 812 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
813 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 813 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
814 | 814 |
815 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 815 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
816 } | 816 } |
817 | 817 |
818 } // namespace blink | 818 } // namespace blink |
OLD | NEW |