Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | |
| 94 if (m_painter->displayItemList()) { | |
|
Xianzhu
2015/08/13 17:03:58
Add DisplayItemList::appendToWebDisplayItemList()
pdr.
2015/08/13 20:55:00
I'm afraid I don't understand. Can you rephrase yo
Xianzhu
2015/08/14 17:22:59
I meant to extract line 95-96 as DisplayItemList::
pdr.
2015/08/15 02:35:04
Ahh, good idea. I've separated this out as you sug
| |
| 95 for (auto& displayItem : m_painter->displayItemList()->displayItems( )) | |
| 96 displayItem.appendToWebDisplayItemList(webDisplayItemList); | |
| 97 } | |
| 98 return; | |
| 99 } | |
|
chrishtr
2015/08/13 17:28:32
Maybe we should just skip this glue code, which is
pdr.
2015/08/13 20:55:00
Added a comment that this code is temporary and ju
| |
| 100 | |
| 93 DisplayItemList* displayItemList = m_painter->displayItemList(); | 101 DisplayItemList* displayItemList = m_painter->displayItemList(); |
| 94 ASSERT(displayItemList); | 102 ASSERT(displayItemList); |
| 95 displayItemList->setDisplayItemConstructionIsDisabled( | 103 displayItemList->setDisplayItemConstructionIsDisabled( |
| 96 paintingControl == WebContentLayerClient::DisplayListConstructionDisable d); | 104 paintingControl == WebContentLayerClient::DisplayListConstructionDisable d); |
| 97 | 105 |
| 98 // We also disable caching when Painting or Construction are disabled. In bo th cases we would like | 106 // 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. | 107 // to compare assuming the full cost of recording, not the cost of re-using cached content. |
| 100 if (paintingControl != WebContentLayerClient::PaintDefaultBehavior) | 108 if (paintingControl != WebContentLayerClient::PaintDefaultBehavior) |
| 101 displayItemList->invalidateAll(); | 109 displayItemList->invalidateAll(); |
| 102 | 110 |
| 103 GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisable d; | 111 GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisable d; |
| 104 if (paintingControl == WebContentLayerClient::DisplayListPaintingDisabled | 112 if (paintingControl == WebContentLayerClient::DisplayListPaintingDisabled |
| 105 || paintingControl == WebContentLayerClient::DisplayListConstructionDisa bled) | 113 || paintingControl == WebContentLayerClient::DisplayListConstructionDisa bled) |
| 106 disabledMode = GraphicsContext::FullyDisabled; | 114 disabledMode = GraphicsContext::FullyDisabled; |
| 107 GraphicsContext context(displayItemList, disabledMode); | 115 GraphicsContext context(displayItemList, disabledMode); |
| 108 | 116 |
| 109 m_painter->paint(context, clip); | 117 m_painter->paint(context, clip); |
| 110 | 118 |
| 111 displayItemList->commitNewDisplayItemsAndAppendToWebDisplayItemList(webDispl ayItemList); | 119 displayItemList->commitNewDisplayItemsAndAppendToWebDisplayItemList(webDispl ayItemList); |
| 112 } | 120 } |
| 113 | 121 |
| 114 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const | 122 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const |
| 115 { | 123 { |
| 116 return m_painter->displayItemList()->approximateUnsharedMemoryUsage(); | 124 return m_painter->displayItemList()->approximateUnsharedMemoryUsage(); |
| 117 } | 125 } |
| 118 | 126 |
| 119 } // namespace blink | 127 } // namespace blink |
| OLD | NEW |