| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 void ContentLayerDelegate::paintContents( | 78 void ContentLayerDelegate::paintContents( |
| 79 WebDisplayItemList* webDisplayItemList, const WebRect& clip, | 79 WebDisplayItemList* webDisplayItemList, const WebRect& clip, |
| 80 WebContentLayerClient::PaintingControlSetting paintingControl) | 80 WebContentLayerClient::PaintingControlSetting paintingControl) |
| 81 { | 81 { |
| 82 TRACE_EVENT1("blink,benchmark", "ContentLayerDelegate::paintContents", "clip
_rect", toTracedValue(clip)); | 82 TRACE_EVENT1("blink,benchmark", "ContentLayerDelegate::paintContents", "clip
_rect", toTracedValue(clip)); |
| 83 | 83 |
| 84 // TODO(pdr): Remove when slimming paint v2 is further along. This is only | 84 // TODO(pdr): Remove when slimming paint v2 is further along. This is only |
| 85 // here so the browser is usable during development and does not crash due | 85 // here so the browser is usable during development and does not crash due |
| 86 // to committing the new display items twice. | 86 // to committing the new display items twice. |
| 87 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) { | 87 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) { |
| 88 m_painter->displayItemList()->appendToWebDisplayItemList(webDisplayItemL
ist); | 88 m_painter->displayItemList()->paintArtifact().appendToWebDisplayItemList
(webDisplayItemList); |
| 89 return; | 89 return; |
| 90 } | 90 } |
| 91 | 91 |
| 92 DisplayItemList* displayItemList = m_painter->displayItemList(); | 92 DisplayItemList* displayItemList = m_painter->displayItemList(); |
| 93 ASSERT(displayItemList); | 93 ASSERT(displayItemList); |
| 94 displayItemList->setDisplayItemConstructionIsDisabled( | 94 displayItemList->setDisplayItemConstructionIsDisabled( |
| 95 paintingControl == WebContentLayerClient::DisplayListConstructionDisable
d); | 95 paintingControl == WebContentLayerClient::DisplayListConstructionDisable
d); |
| 96 | 96 |
| 97 // We also disable caching when Painting or Construction are disabled. In bo
th cases we would like | 97 // We also disable caching when Painting or Construction are disabled. In bo
th cases we would like |
| 98 // to compare assuming the full cost of recording, not the cost of re-using
cached content. | 98 // to compare assuming the full cost of recording, not the cost of re-using
cached content. |
| 99 if (paintingControl != WebContentLayerClient::PaintDefaultBehavior) | 99 if (paintingControl != WebContentLayerClient::PaintDefaultBehavior) |
| 100 displayItemList->invalidateAll(); | 100 displayItemList->invalidateAll(); |
| 101 | 101 |
| 102 GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisable
d; | 102 GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisable
d; |
| 103 if (paintingControl == WebContentLayerClient::DisplayListPaintingDisabled | 103 if (paintingControl == WebContentLayerClient::DisplayListPaintingDisabled |
| 104 || paintingControl == WebContentLayerClient::DisplayListConstructionDisa
bled) | 104 || paintingControl == WebContentLayerClient::DisplayListConstructionDisa
bled) |
| 105 disabledMode = GraphicsContext::FullyDisabled; | 105 disabledMode = GraphicsContext::FullyDisabled; |
| 106 GraphicsContext context(displayItemList, disabledMode); | 106 GraphicsContext context(displayItemList, disabledMode); |
| 107 | 107 |
| 108 m_painter->paint(context, clip); | 108 m_painter->paint(context, clip); |
| 109 | 109 |
| 110 displayItemList->commitNewDisplayItemsAndAppendToWebDisplayItemList(webDispl
ayItemList); | 110 displayItemList->commitNewDisplayItems(); |
| 111 displayItemList->paintArtifact().appendToWebDisplayItemList(webDisplayItemLi
st); |
| 111 } | 112 } |
| 112 | 113 |
| 113 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const | 114 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const |
| 114 { | 115 { |
| 115 return m_painter->displayItemList()->approximateUnsharedMemoryUsage(); | 116 return m_painter->displayItemList()->approximateUnsharedMemoryUsage(); |
| 116 } | 117 } |
| 117 | 118 |
| 118 } // namespace blink | 119 } // namespace blink |
| OLD | NEW |