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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2819923003: [SPInvalidation, SPv2] Compute paint offset for paginated content (Closed)
Patch Set: none Created 3 years, 8 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
OLDNEW
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/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "core/layout/LayoutView.h" 8 #include "core/layout/LayoutView.h"
9 #include "core/paint/ClipPathClipper.h" 9 #include "core/paint/ClipPathClipper.h"
10 #include "core/paint/FilterPainter.h" 10 #include "core/paint/FilterPainter.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 paint_layer_.ConvertToLayerCoords(local_painting_info.root_layer, 435 paint_layer_.ConvertToLayerCoords(local_painting_info.root_layer,
436 offset_to_clipper); 436 offset_to_clipper);
437 local_painting_info.paint_dirty_rect.MoveBy(offset_to_clipper); 437 local_painting_info.paint_dirty_rect.MoveBy(offset_to_clipper);
438 } 438 }
439 439
440 PaintLayer::GeometryMapperOption geometry_mapper_option = 440 PaintLayer::GeometryMapperOption geometry_mapper_option =
441 PaintLayer::kDoNotUseGeometryMapper; 441 PaintLayer::kDoNotUseGeometryMapper;
442 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) 442 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
443 geometry_mapper_option = PaintLayer::kUseGeometryMapper; 443 geometry_mapper_option = PaintLayer::kUseGeometryMapper;
444 444
445 // TODO(trchen): We haven't decided how to handle visual fragmentation with 445 if (fragment_policy == kForceSingleFragment) {
446 // SPv2. Related thread
447 // https://groups.google.com/a/chromium.org/forum/#!topic/graphics-dev/81XuW Ff-mxM
448 if (fragment_policy == kForceSingleFragment ||
449 RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
450 paint_layer_for_fragments->AppendSingleFragmentIgnoringPagination( 446 paint_layer_for_fragments->AppendSingleFragmentIgnoringPagination(
451 layer_fragments, local_painting_info.root_layer, 447 layer_fragments, local_painting_info.root_layer,
452 local_painting_info.paint_dirty_rect, cache_slot, 448 local_painting_info.paint_dirty_rect, cache_slot,
453 geometry_mapper_option, kIgnorePlatformOverlayScrollbarSize, 449 geometry_mapper_option, kIgnorePlatformOverlayScrollbarSize,
454 respect_overflow_clip, &offset_from_root, 450 respect_overflow_clip, &offset_from_root,
455 local_painting_info.sub_pixel_accumulation); 451 local_painting_info.sub_pixel_accumulation);
456 } else if (IsFixedPositionObjectInPagedMedia()) { 452 } else if (IsFixedPositionObjectInPagedMedia()) {
457 PaintLayerFragments single_fragment; 453 PaintLayerFragments single_fragment;
458 paint_layer_for_fragments->AppendSingleFragmentIgnoringPagination( 454 paint_layer_for_fragments->AppendSingleFragmentIgnoringPagination(
459 single_fragment, local_painting_info.root_layer, 455 single_fragment, local_painting_info.root_layer,
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 // We know that the mask just needs the area bounded by the clip rects to be 979 // We know that the mask just needs the area bounded by the clip rects to be
984 // filled with black. 980 // filled with black.
985 if (clip_recorder && phase == kPaintPhaseClippingMask) { 981 if (clip_recorder && phase == kPaintPhaseClippingMask) {
986 FillMaskingFragment(context, clip_rect); 982 FillMaskingFragment(context, clip_rect);
987 return; 983 return;
988 } 984 }
989 985
990 LayoutRect new_cull_rect(clip_rect.Rect()); 986 LayoutRect new_cull_rect(clip_rect.Rect());
991 Optional<ScrollRecorder> scroll_recorder; 987 Optional<ScrollRecorder> scroll_recorder;
992 LayoutPoint paint_offset = -paint_layer_.LayoutBoxLocation(); 988 LayoutPoint paint_offset = -paint_layer_.LayoutBoxLocation();
993 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 989 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
990 !paint_layer_.EnclosingPaginationLayer()) {
994 paint_offset += paint_layer_.GetLayoutObject().PaintOffset(); 991 paint_offset += paint_layer_.GetLayoutObject().PaintOffset();
995 new_cull_rect.Move(painting_info.scroll_offset_accumulation); 992 new_cull_rect.Move(painting_info.scroll_offset_accumulation);
996 } else { 993 } else {
997 paint_offset += ToSize(fragment.layer_bounds.Location()); 994 paint_offset += ToSize(fragment.layer_bounds.Location());
998 if (!painting_info.scroll_offset_accumulation.IsZero()) { 995 if (!painting_info.scroll_offset_accumulation.IsZero()) {
999 // As a descendant of the root layer, m_paintLayer's painting is not 996 // As a descendant of the root layer, m_paintLayer's painting is not
1000 // controlled by the ScrollRecorders created by BlockPainter of the 997 // controlled by the ScrollRecorders created by BlockPainter of the
1001 // ancestor layers up to the root layer, so we need to issue 998 // ancestor layers up to the root layer, so we need to issue
1002 // ScrollRecorder for this layer seperately, with the scroll offset 999 // ScrollRecorder for this layer seperately, with the scroll offset
1003 // accumulated from the root layer to the parent of this layer, to get the 1000 // accumulated from the root layer to the parent of this layer, to get the
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 context, layout_object, kPaintPhaseClippingMask)) 1215 context, layout_object, kPaintPhaseClippingMask))
1219 return; 1216 return;
1220 1217
1221 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect()); 1218 IntRect snapped_clip_rect = PixelSnappedIntRect(clip_rect.Rect());
1222 LayoutObjectDrawingRecorder drawing_recorder( 1219 LayoutObjectDrawingRecorder drawing_recorder(
1223 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect); 1220 context, layout_object, kPaintPhaseClippingMask, snapped_clip_rect);
1224 context.FillRect(snapped_clip_rect, Color::kBlack); 1221 context.FillRect(snapped_clip_rect, Color::kBlack);
1225 } 1222 }
1226 1223
1227 } // namespace blink 1224 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698