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

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

Issue 2672983003: Implements PrintBrowser mode. (Closed)
Patch Set: Add tests and respond to comments Created 3 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/PaintInvalidator.h" 5 #include "core/paint/PaintInvalidator.h"
6 6
7 #include "core/editing/FrameSelection.h" 7 #include "core/editing/FrameSelection.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 DCHECK(context.treeBuilderContext.current.paintOffset == 384 DCHECK(context.treeBuilderContext.current.paintOffset ==
385 object.paintOffset()); 385 object.paintOffset());
386 386
387 if (!context.forcedSubtreeInvalidationFlags && 387 if (!context.forcedSubtreeInvalidationFlags &&
388 !object 388 !object
389 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()) 389 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState())
390 return; 390 return;
391 391
392 updatePaintingLayer(object, context); 392 updatePaintingLayer(object, context);
393 393
394 if (object.document().printing()) 394 if (object.document().printing() &&
395 !RuntimeEnabledFeatures::printBrowserEnabled())
395 return; // Don't invalidate paints if we're printing. 396 return; // Don't invalidate paints if we're printing.
396 397
397 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), 398 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"),
398 "PaintInvalidator::invalidatePaintIfNeeded()", "object", 399 "PaintInvalidator::invalidatePaintIfNeeded()", "object",
399 object.debugName().ascii()); 400 object.debugName().ascii());
400 401
401 updateContext(object, context); 402 updateContext(object, context);
402 403
403 if (!object 404 if (!object
404 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() && 405 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() &&
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; 446 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate;
446 } 447 }
447 448
448 void PaintInvalidator::processPendingDelayedPaintInvalidations() { 449 void PaintInvalidator::processPendingDelayedPaintInvalidations() {
449 for (auto target : m_pendingDelayedPaintInvalidations) 450 for (auto target : m_pendingDelayedPaintInvalidations)
450 target->getMutableForPainting().setShouldDoFullPaintInvalidation( 451 target->getMutableForPainting().setShouldDoFullPaintInvalidation(
451 PaintInvalidationDelayedFull); 452 PaintInvalidationDelayedFull);
452 } 453 }
453 454
454 } // namespace blink 455 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698