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

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

Issue 2782343002: Store local border box property cache outside ObjectPaintProperties (Closed)
Patch Set: 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 PaintResult PaintLayerPainter::paintLayerContents( 261 PaintResult PaintLayerPainter::paintLayerContents(
262 GraphicsContext& context, 262 GraphicsContext& context,
263 const PaintLayerPaintingInfo& paintingInfoArg, 263 const PaintLayerPaintingInfo& paintingInfoArg,
264 PaintLayerFlags paintFlags, 264 PaintLayerFlags paintFlags,
265 FragmentPolicy fragmentPolicy) { 265 FragmentPolicy fragmentPolicy) {
266 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties; 266 Optional<ScopedPaintChunkProperties> scopedPaintChunkProperties;
267 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && 267 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
268 RuntimeEnabledFeatures::rootLayerScrollingEnabled() && 268 RuntimeEnabledFeatures::rootLayerScrollingEnabled() &&
269 m_paintLayer.layoutObject().isLayoutView()) { 269 m_paintLayer.layoutObject().isLayoutView()) {
270 const auto* objectPaintProperties = 270 const auto* localBorderBoxProperties =
271 m_paintLayer.layoutObject().paintProperties(); 271 m_paintLayer.layoutObject().localBorderBoxProperties();
272 DCHECK(objectPaintProperties && 272 DCHECK(localBorderBoxProperties);
273 objectPaintProperties->localBorderBoxProperties());
274 PaintChunkProperties properties( 273 PaintChunkProperties properties(
275 context.getPaintController().currentPaintChunkProperties()); 274 context.getPaintController().currentPaintChunkProperties());
276 properties.propertyTreeState = 275 properties.propertyTreeState = *localBorderBoxProperties;
277 *objectPaintProperties->localBorderBoxProperties();
278 properties.backfaceHidden = m_paintLayer.layoutObject().hasHiddenBackface(); 276 properties.backfaceHidden = m_paintLayer.layoutObject().hasHiddenBackface();
279 scopedPaintChunkProperties.emplace(context.getPaintController(), 277 scopedPaintChunkProperties.emplace(context.getPaintController(),
280 m_paintLayer, properties); 278 m_paintLayer, properties);
281 } 279 }
282 280
283 DCHECK(m_paintLayer.isSelfPaintingLayer() || 281 DCHECK(m_paintLayer.isSelfPaintingLayer() ||
284 m_paintLayer.hasSelfPaintingLayerDescendant()); 282 m_paintLayer.hasSelfPaintingLayerDescendant());
285 DCHECK(!(paintFlags & PaintLayerAppliedTransform)); 283 DCHECK(!(paintFlags & PaintLayerAppliedTransform));
286 284
287 bool isSelfPaintingLayer = m_paintLayer.isSelfPaintingLayer(); 285 bool isSelfPaintingLayer = m_paintLayer.isSelfPaintingLayer();
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 } 487 }
490 488
491 Optional<ScopedPaintChunkProperties> contentScopedPaintChunkProperties; 489 Optional<ScopedPaintChunkProperties> contentScopedPaintChunkProperties;
492 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && 490 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
493 !scopedPaintChunkProperties.has_value()) { 491 !scopedPaintChunkProperties.has_value()) {
494 // If layoutObject() is a LayoutView and root layer scrolling is enabled, 492 // If layoutObject() is a LayoutView and root layer scrolling is enabled,
495 // the LayoutView's paint properties will already have been applied at 493 // the LayoutView's paint properties will already have been applied at
496 // the top of this method, in scopedPaintChunkProperties. 494 // the top of this method, in scopedPaintChunkProperties.
497 DCHECK(!(RuntimeEnabledFeatures::rootLayerScrollingEnabled() && 495 DCHECK(!(RuntimeEnabledFeatures::rootLayerScrollingEnabled() &&
498 m_paintLayer.layoutObject().isLayoutView())); 496 m_paintLayer.layoutObject().isLayoutView()));
499 const auto* objectPaintProperties = 497 const auto* localBorderBoxProperties =
500 m_paintLayer.layoutObject().paintProperties(); 498 m_paintLayer.layoutObject().localBorderBoxProperties();
501 DCHECK(objectPaintProperties && 499 DCHECK(localBorderBoxProperties);
502 objectPaintProperties->localBorderBoxProperties());
503 PaintChunkProperties properties( 500 PaintChunkProperties properties(
504 context.getPaintController().currentPaintChunkProperties()); 501 context.getPaintController().currentPaintChunkProperties());
505 properties.propertyTreeState = 502 properties.propertyTreeState = *localBorderBoxProperties;
506 *objectPaintProperties->localBorderBoxProperties();
507 properties.backfaceHidden = m_paintLayer.layoutObject().hasHiddenBackface(); 503 properties.backfaceHidden = m_paintLayer.layoutObject().hasHiddenBackface();
508 contentScopedPaintChunkProperties.emplace(context.getPaintController(), 504 contentScopedPaintChunkProperties.emplace(context.getPaintController(),
509 m_paintLayer, properties); 505 m_paintLayer, properties);
510 } 506 }
511 507
512 bool selectionOnly = 508 bool selectionOnly =
513 localPaintingInfo.getGlobalPaintFlags() & GlobalPaintSelectionOnly; 509 localPaintingInfo.getGlobalPaintFlags() & GlobalPaintSelectionOnly;
514 { // Begin block for the lifetime of any filter. 510 { // Begin block for the lifetime of any filter.
515 FilterPainter filterPainter(m_paintLayer, context, offsetFromRoot, 511 FilterPainter filterPainter(m_paintLayer, context, offsetFromRoot,
516 layerFragments.isEmpty() 512 layerFragments.isEmpty()
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 context, layoutObject, PaintPhaseClippingMask)) 1198 context, layoutObject, PaintPhaseClippingMask))
1203 return; 1199 return;
1204 1200
1205 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); 1201 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
1206 LayoutObjectDrawingRecorder drawingRecorder( 1202 LayoutObjectDrawingRecorder drawingRecorder(
1207 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); 1203 context, layoutObject, PaintPhaseClippingMask, snappedClipRect);
1208 context.fillRect(snappedClipRect, Color::black); 1204 context.fillRect(snappedClipRect, Color::black);
1209 } 1205 }
1210 1206
1211 } // namespace blink 1207 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698