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

Side by Side Diff: Source/core/rendering/RenderView.cpp

Issue 390193003: [not for review] Add Draw entries to window Performance Timeline (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Git pull syncup Created 6 years, 3 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
« no previous file with comments | « Source/core/rendering/RenderView.h ('k') | Source/core/timing/Performance.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // short-circuit on full-paint invalidation. 435 // short-circuit on full-paint invalidation.
436 LayoutRect dirtyRect = viewRect(); 436 LayoutRect dirtyRect = viewRect();
437 if (doingFullPaintInvalidation() && !dirtyRect.isEmpty()) { 437 if (doingFullPaintInvalidation() && !dirtyRect.isEmpty()) {
438 const RenderLayerModelObject* paintInvalidationContainer = &paintInvalid ationState.paintInvalidationContainer(); 438 const RenderLayerModelObject* paintInvalidationContainer = &paintInvalid ationState.paintInvalidationContainer();
439 mapRectToPaintInvalidationBacking(paintInvalidationContainer, dirtyRect, &paintInvalidationState); 439 mapRectToPaintInvalidationBacking(paintInvalidationContainer, dirtyRect, &paintInvalidationState);
440 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, Inv alidationFull); 440 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, Inv alidationFull);
441 } 441 }
442 RenderBlock::invalidateTreeIfNeeded(paintInvalidationState); 442 RenderBlock::invalidateTreeIfNeeded(paintInvalidationState);
443 } 443 }
444 444
445 LayoutRect RenderView::rectForPaintInvalidation(const LayoutRect* paintInvalidat ionRectPtr) const
446 {
447 LayoutRect paintInvalidationRect =
448 paintInvalidationRectPtr ? *paintInvalidationRectPtr : viewRect();
449 Element* owner = document().ownerElement();
450 if (document().printing() || !m_frameView
451 || layer()->compositingState() == PaintsIntoOwnBacking || !owner)
452 return paintInvalidationRect;
453 if (RenderBox* obj = owner->renderBox()) {
454 // Intersect the viewport with the paint invalidation rect.
455 LayoutRect viewRectangle = viewRect();
456 LayoutRect rectToInvalidate = intersection(paintInvalidationRect, viewRe ctangle);
457
458 // Adjust for scroll offset of the view.
459 rectToInvalidate.moveBy(-viewRectangle.location());
460
461 // Adjust for frame border.
462 rectToInvalidate.moveBy(obj->contentBoxRect().location());
463 return rectToInvalidate;
464 }
465 return paintInvalidationRect;
466 }
467
445 void RenderView::invalidatePaintForRectangle(const LayoutRect& paintInvalidation Rect) const 468 void RenderView::invalidatePaintForRectangle(const LayoutRect& paintInvalidation Rect) const
446 { 469 {
447 ASSERT(!paintInvalidationRect.isEmpty()); 470 ASSERT(!paintInvalidationRect.isEmpty());
448 471
449 if (document().printing() || !m_frameView) 472 if (document().printing() || !m_frameView)
450 return; 473 return;
451 474
452 ASSERT(layer()->compositingState() == PaintsIntoOwnBacking || !frame()->owne rRenderer()); 475 ASSERT(layer()->compositingState() == PaintsIntoOwnBacking || !frame()->owne rRenderer());
453 476
454 if (layer()->compositingState() == PaintsIntoOwnBacking) { 477 if (layer()->compositingState() == PaintsIntoOwnBacking) {
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 return viewWidth(IncludeScrollbars) / scale; 1025 return viewWidth(IncludeScrollbars) / scale;
1003 } 1026 }
1004 1027
1005 double RenderView::layoutViewportHeight() const 1028 double RenderView::layoutViewportHeight() const
1006 { 1029 {
1007 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; 1030 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1;
1008 return viewHeight(IncludeScrollbars) / scale; 1031 return viewHeight(IncludeScrollbars) / scale;
1009 } 1032 }
1010 1033
1011 } // namespace blink 1034 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderView.h ('k') | Source/core/timing/Performance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698