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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 | 72 |
73 void ContentLayerDelegate::paintContents( | 73 void ContentLayerDelegate::paintContents( |
74 WebDisplayItemList* webDisplayItemList, WebContentLayerClient::PaintingContr
olSetting paintingControl) | 74 WebDisplayItemList* webDisplayItemList, WebContentLayerClient::PaintingContr
olSetting paintingControl) |
75 { | 75 { |
76 TRACE_EVENT0("blink,benchmark", "ContentLayerDelegate::paintContents"); | 76 TRACE_EVENT0("blink,benchmark", "ContentLayerDelegate::paintContents"); |
77 | 77 |
78 PaintController& paintController = m_graphicsLayer->paintController(); | 78 PaintController& paintController = m_graphicsLayer->paintController(); |
79 paintController.setDisplayItemConstructionIsDisabled( | 79 paintController.setDisplayItemConstructionIsDisabled( |
80 paintingControl == WebContentLayerClient::DisplayListConstructionDisable
d); | 80 paintingControl == WebContentLayerClient::DisplayListConstructionDisable
d); |
| 81 paintController.setSubsequenceCachingIsDisabled( |
| 82 paintingControl == WebContentLayerClient::SubsequenceCachingDisabled); |
81 | 83 |
82 // We also disable caching when Painting or Construction are disabled. In bo
th cases we would like | 84 // We also disable caching when Painting or Construction are disabled. In bo
th cases we would like |
83 // to compare assuming the full cost of recording, not the cost of re-using
cached content. | 85 // to compare assuming the full cost of recording, not the cost of re-using
cached content. |
84 if (paintingControl != WebContentLayerClient::PaintDefaultBehavior) | 86 if (paintingControl != WebContentLayerClient::PaintDefaultBehavior |
| 87 && paintingControl != WebContentLayerClient::SubsequenceCachingDisabled) |
85 paintController.invalidateAll(); | 88 paintController.invalidateAll(); |
86 | 89 |
87 GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisable
d; | 90 GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisable
d; |
88 if (paintingControl == WebContentLayerClient::DisplayListPaintingDisabled | 91 if (paintingControl == WebContentLayerClient::DisplayListPaintingDisabled |
89 || paintingControl == WebContentLayerClient::DisplayListConstructionDisa
bled) | 92 || paintingControl == WebContentLayerClient::DisplayListConstructionDisa
bled) |
90 disabledMode = GraphicsContext::FullyDisabled; | 93 disabledMode = GraphicsContext::FullyDisabled; |
91 | 94 |
92 m_graphicsLayer->paint(nullptr, disabledMode); | 95 m_graphicsLayer->paint(nullptr, disabledMode); |
93 paintArtifactToWebDisplayItemList(webDisplayItemList, paintController.paintA
rtifact(), paintableRegion()); | 96 paintArtifactToWebDisplayItemList(webDisplayItemList, paintController.paintA
rtifact(), paintableRegion()); |
94 paintController.setDisplayItemConstructionIsDisabled(false); | 97 paintController.setDisplayItemConstructionIsDisabled(false); |
| 98 paintController.setSubsequenceCachingIsDisabled(false); |
95 } | 99 } |
96 | 100 |
97 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const | 101 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const |
98 { | 102 { |
99 return m_graphicsLayer->paintController().approximateUnsharedMemoryUsage(); | 103 return m_graphicsLayer->paintController().approximateUnsharedMemoryUsage(); |
100 } | 104 } |
101 | 105 |
102 } // namespace blink | 106 } // namespace blink |
OLD | NEW |