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

Side by Side Diff: Source/platform/graphics/ContentLayerDelegate.cpp

Issue 1287093004: Slimming Paint phase 2 compositing algorithm plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address reviewer comments Created 5 years, 4 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 void ContentLayerDelegate::paintContents( 85 void ContentLayerDelegate::paintContents(
86 WebDisplayItemList* webDisplayItemList, const WebRect& clip, 86 WebDisplayItemList* webDisplayItemList, const WebRect& clip,
87 WebContentLayerClient::PaintingControlSetting paintingControl) 87 WebContentLayerClient::PaintingControlSetting paintingControl)
88 { 88 {
89 TRACE_EVENT1("blink,benchmark", "ContentLayerDelegate::paintContents", "clip _rect", toTracedValue(clip)); 89 TRACE_EVENT1("blink,benchmark", "ContentLayerDelegate::paintContents", "clip _rect", toTracedValue(clip));
90 90
91 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); 91 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
92 92
93 // TODO: Remove this when slimming paint v2 is further along. This is only
chrishtr 2015/08/13 21:33:16 TODO(pdr)
pdr. 2015/08/14 00:10:29 Done
94 // here so the browser is usable during development and does not crash due
95 // to committing the new display items twice.
96 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
97 if (m_painter->displayItemList()) {
98 for (auto& displayItem : m_painter->displayItemList()->displayItems( ))
99 displayItem.appendToWebDisplayItemList(webDisplayItemList);
100 }
101 return;
102 }
103
93 DisplayItemList* displayItemList = m_painter->displayItemList(); 104 DisplayItemList* displayItemList = m_painter->displayItemList();
94 ASSERT(displayItemList); 105 ASSERT(displayItemList);
95 displayItemList->setDisplayItemConstructionIsDisabled( 106 displayItemList->setDisplayItemConstructionIsDisabled(
96 paintingControl == WebContentLayerClient::DisplayListConstructionDisable d); 107 paintingControl == WebContentLayerClient::DisplayListConstructionDisable d);
97 108
98 // We also disable caching when Painting or Construction are disabled. In bo th cases we would like 109 // We also disable caching when Painting or Construction are disabled. In bo th cases we would like
99 // to compare assuming the full cost of recording, not the cost of re-using cached content. 110 // to compare assuming the full cost of recording, not the cost of re-using cached content.
100 if (paintingControl != WebContentLayerClient::PaintDefaultBehavior) 111 if (paintingControl != WebContentLayerClient::PaintDefaultBehavior)
101 displayItemList->invalidateAll(); 112 displayItemList->invalidateAll();
102 113
103 GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisable d; 114 GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisable d;
104 if (paintingControl == WebContentLayerClient::DisplayListPaintingDisabled 115 if (paintingControl == WebContentLayerClient::DisplayListPaintingDisabled
105 || paintingControl == WebContentLayerClient::DisplayListConstructionDisa bled) 116 || paintingControl == WebContentLayerClient::DisplayListConstructionDisa bled)
106 disabledMode = GraphicsContext::FullyDisabled; 117 disabledMode = GraphicsContext::FullyDisabled;
107 GraphicsContext context(displayItemList, disabledMode); 118 GraphicsContext context(displayItemList, disabledMode);
108 119
109 m_painter->paint(context, clip); 120 m_painter->paint(context, clip);
110 121
111 displayItemList->commitNewDisplayItemsAndAppendToWebDisplayItemList(webDispl ayItemList); 122 displayItemList->commitNewDisplayItemsAndAppendToWebDisplayItemList(webDispl ayItemList);
112 } 123 }
113 124
114 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const 125 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const
115 { 126 {
116 return m_painter->displayItemList()->approximateUnsharedMemoryUsage(); 127 return m_painter->displayItemList()->approximateUnsharedMemoryUsage();
117 } 128 }
118 129
119 } // namespace blink 130 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698