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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1393083003: Implement interest rects for synchronized paint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 2453 matching lines...) Expand 10 before | Expand all | Expand 10 after
2464 2464
2465 // A null graphics layer can occur for painting of SVG images that are not p arented into the main frame tree. 2465 // A null graphics layer can occur for painting of SVG images that are not p arented into the main frame tree.
2466 if (rootGraphicsLayer) { 2466 if (rootGraphicsLayer) {
2467 synchronizedPaintRecursively(rootGraphicsLayer, interestRect); 2467 synchronizedPaintRecursively(rootGraphicsLayer, interestRect);
2468 } 2468 }
2469 lifecycle().advanceTo(DocumentLifecycle::PaintClean); 2469 lifecycle().advanceTo(DocumentLifecycle::PaintClean);
2470 } 2470 }
2471 2471
2472 void FrameView::synchronizedPaintRecursively(GraphicsLayer* graphicsLayer, const LayoutRect& interestRect) 2472 void FrameView::synchronizedPaintRecursively(GraphicsLayer* graphicsLayer, const LayoutRect& interestRect)
2473 { 2473 {
2474 if (graphicsLayer->needsDisplay()) { 2474 GraphicsContext context(graphicsLayer->displayItemList());
2475 // TODO(chrishtr): implement interest rects.
2476 GraphicsContext context(graphicsLayer->displayItemList());
2477 graphicsLayer->paint(context, roundedIntRect(interestRect));
2478 2475
2476 // TODO(chrishtr): fix unit tests to not inject one-off interest rects.
2477 if (IntRect(interestRect) != LayoutRect::infiniteIntRect()) {
wkorman 2015/10/09 19:46:31 There's a LayoutRect::infiniteRect() that returns
chrishtr 2015/10/09 20:54:52 Done.
2478 if (graphicsLayer->needsDisplay()) {
2479 graphicsLayer->paint(context, roundedIntRect(interestRect));
2480
2481 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
2482 graphicsLayer->commitIfNeeded();
2483 }
2484 } else {
2485 graphicsLayer->paintIfNeeded(context);
2479 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) 2486 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
2480 graphicsLayer->commitIfNeeded(); 2487 graphicsLayer->commitIfNeeded();
2481 } 2488 }
2482 2489
2483 for (auto& child : graphicsLayer->children()) { 2490 for (auto& child : graphicsLayer->children()) {
2484 if (child) 2491 if (child)
2485 synchronizedPaintRecursively(child, interestRect); 2492 synchronizedPaintRecursively(child, interestRect);
2486 } 2493 }
2487 } 2494 }
2488 2495
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
3921 3928
3922 if (!graphicsLayer) 3929 if (!graphicsLayer)
3923 return; 3930 return;
3924 3931
3925 PaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentLayoutObjec t(), paintInvalidationContainer, viewRect); 3932 PaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentLayoutObjec t(), paintInvalidationContainer, viewRect);
3926 3933
3927 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); 3934 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect)));
3928 } 3935 }
3929 3936
3930 } // namespace blink 3937 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698