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

Unified Diff: Source/core/inspector/InspectorTimelineAgent.cpp

Issue 16896007: Timeline: add support for deferred canvas rasterization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorTimelineAgent.h ('k') | Source/core/platform/PlatformInstrumentation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorTimelineAgent.cpp
diff --git a/Source/core/inspector/InspectorTimelineAgent.cpp b/Source/core/inspector/InspectorTimelineAgent.cpp
index 09db80d4f67f51487045cae4e615be43d1a3ce72..506bc1afe4db6271025efe7f184ac40b93b2d3b9 100644
--- a/Source/core/inspector/InspectorTimelineAgent.cpp
+++ b/Source/core/inspector/InspectorTimelineAgent.cpp
@@ -369,6 +369,16 @@ void InspectorTimelineAgent::willPaint(RenderObject* renderer)
pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Paint, true, frame, true);
}
+void InspectorTimelineAgent::willUpdateLayer(int)
+{
+ enablePlatformInstrumentation();
+}
+
+void InspectorTimelineAgent::didUpdateLayer()
+{
+ disablePlatformInstrumentation();
+}
+
void InspectorTimelineAgent::didPaint(RenderObject* renderer, GraphicsContext*, const LayoutRect& clipRect)
{
TimelineRecordEntry& entry = m_recordStack.last();
@@ -409,6 +419,16 @@ void InspectorTimelineAgent::didResizeImage()
didCompleteCurrentRecord(TimelineRecordType::ResizeImage);
}
+void InspectorTimelineAgent::willRasterizeCanvas()
+{
+ pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Rasterize, false, 0);
+}
+
+void InspectorTimelineAgent::didRasterizeCanvas()
+{
+ didCompleteCurrentRecord(TimelineRecordType::Rasterize);
+}
+
void InspectorTimelineAgent::willComposite()
{
pushCurrentRecord(InspectorObject::create(), TimelineRecordType::CompositeLayers, false, 0);
@@ -712,10 +732,7 @@ void InspectorTimelineAgent::didCompleteCurrentRecord(const String& type)
// An empty stack could merely mean that the timeline agent was turned on in the middle of
// an event. Don't treat as an error.
if (!m_recordStack.isEmpty()) {
- if (m_platformInstrumentationClientInstalledAtStackDepth == m_recordStack.size()) {
- m_platformInstrumentationClientInstalledAtStackDepth = 0;
- PlatformInstrumentation::setClient(0);
- }
+ disablePlatformInstrumentation();
pushGCEventRecords();
TimelineRecordEntry entry = m_recordStack.last();
@@ -770,9 +787,23 @@ void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data,
RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0, type);
setFrameIdentifier(record.get(), frame);
m_recordStack.append(TimelineRecordEntry(record.release(), data, InspectorArray::create(), type, getUsedHeapSize()));
- if (hasLowLevelDetails && !m_platformInstrumentationClientInstalledAtStackDepth && !PlatformInstrumentation::hasClient()) {
- m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.size();
- PlatformInstrumentation::setClient(this);
+ if (hasLowLevelDetails)
+ enablePlatformInstrumentation();
+}
+
+void InspectorTimelineAgent::enablePlatformInstrumentation()
+{
+ if (m_platformInstrumentationClientInstalledAtStackDepth || PlatformInstrumentation::hasClient())
+ return;
+ m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.size();
+ PlatformInstrumentation::setClient(this);
+}
+
+void InspectorTimelineAgent::disablePlatformInstrumentation()
+{
+ if (m_platformInstrumentationClientInstalledAtStackDepth == m_recordStack.size()) {
+ m_platformInstrumentationClientInstalledAtStackDepth = 0;
+ PlatformInstrumentation::setClient(0);
}
}
« no previous file with comments | « Source/core/inspector/InspectorTimelineAgent.h ('k') | Source/core/platform/PlatformInstrumentation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698