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

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

Issue 1552693002: Add paint testing mode subsequence_caching_disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@RemoveSyncPaint
Patch Set: Rebase on origin/master Created 4 years, 11 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « cc/playback/display_list_recording_source.cc ('k') | third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698