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

Unified Diff: Source/core/rendering/compositing/CompositingLayerAssigner.cpp

Issue 565793003: [Invalidation Tracking] Add trace events for compositor based invalidations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: squashed -> squashing Created 6 years, 3 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
Index: Source/core/rendering/compositing/CompositingLayerAssigner.cpp
diff --git a/Source/core/rendering/compositing/CompositingLayerAssigner.cpp b/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
index f835c9a7e2d28857ee6f3fbd3c56e5c29499c47e..1f3fbb0b875e1041eaf979cdfffa406f5911030e 100644
--- a/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
+++ b/Source/core/rendering/compositing/CompositingLayerAssigner.cpp
@@ -27,6 +27,7 @@
#include "config.h"
#include "core/rendering/compositing/CompositingLayerAssigner.h"
+#include "core/inspector/InspectorTraceEvents.h"
#include "core/rendering/compositing/CompositedLayerMapping.h"
#include "platform/TraceEvent.h"
@@ -47,7 +48,7 @@ CompositingLayerAssigner::~CompositingLayerAssigner()
{
}
-void CompositingLayerAssigner::assign(RenderLayer* updateRoot, Vector<RenderLayer*>& layersNeedingPaintInvalidation)
+void CompositingLayerAssigner::assign(RenderLayer* updateRoot, LayersNeedingPaintInvalidation& layersNeedingPaintInvalidation)
{
TRACE_EVENT0("blink", "CompositingLayerAssigner::assign");
@@ -172,7 +173,7 @@ CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const
}
void CompositingLayerAssigner::updateSquashingAssignment(RenderLayer* layer, SquashingState& squashingState, const CompositingStateTransitionType compositedLayerUpdate,
- Vector<RenderLayer*>& layersNeedingPaintInvalidation)
+ LayersNeedingPaintInvalidation& layersNeedingPaintInvalidation)
{
// NOTE: In the future as we generalize this, the background of this layer may need to be assigned to a different backing than
// the squashed RenderLayer's own primary contents. This would happen when we have a composited negative z-index element that needs
@@ -195,7 +196,7 @@ void CompositingLayerAssigner::updateSquashingAssignment(RenderLayer* layer, Squ
layer->clipper().clearClipRectsIncludingDescendants();
// Issue a paint invalidation, since |layer| may have been added to an already-existing squashing layer.
- layersNeedingPaintInvalidation.append(layer);
+ layersNeedingPaintInvalidation.append(std::make_pair(layer, InspectorLayerInvalidationTrackingEvent::AddedToSquashingLayer));
m_layersChanged = true;
} else if (compositedLayerUpdate == RemoveFromSquashingLayer) {
if (layer->groupedMapping()) {
@@ -206,18 +207,18 @@ void CompositingLayerAssigner::updateSquashingAssignment(RenderLayer* layer, Squ
}
// If we need to issue paint invalidations, do so now that we've removed it from a squashed layer.
- layersNeedingPaintInvalidation.append(layer);
+ layersNeedingPaintInvalidation.append(std::make_pair(layer, InspectorLayerInvalidationTrackingEvent::RemovedFromSquashingLayer));
m_layersChanged = true;
layer->setLostGroupedMapping(false);
}
}
-void CompositingLayerAssigner::assignLayersToBackingsForReflectionLayer(RenderLayer* reflectionLayer, Vector<RenderLayer*>& layersNeedingPaintInvalidation)
+void CompositingLayerAssigner::assignLayersToBackingsForReflectionLayer(RenderLayer* reflectionLayer, LayersNeedingPaintInvalidation& layersNeedingPaintInvalidation)
{
CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(reflectionLayer);
if (compositedLayerUpdate != NoCompositingStateChange) {
- layersNeedingPaintInvalidation.append(reflectionLayer);
+ layersNeedingPaintInvalidation.append(std::make_pair(reflectionLayer, InspectorLayerInvalidationTrackingEvent::ReflectionLayerChanged));
m_layersChanged = true;
m_compositor->allocateOrClearCompositedLayerMapping(reflectionLayer, compositedLayerUpdate);
}
@@ -228,7 +229,7 @@ void CompositingLayerAssigner::assignLayersToBackingsForReflectionLayer(RenderLa
reflectionLayer->compositedLayerMapping()->updateGraphicsLayerConfiguration();
}
-void CompositingLayerAssigner::assignLayersToBackingsInternal(RenderLayer* layer, SquashingState& squashingState, Vector<RenderLayer*>& layersNeedingPaintInvalidation)
+void CompositingLayerAssigner::assignLayersToBackingsInternal(RenderLayer* layer, SquashingState& squashingState, LayersNeedingPaintInvalidation& layersNeedingPaintInvalidation)
{
if (m_layerSquashingEnabled && requiresSquashing(layer->compositingReasons())) {
CompositingReasons reasonsPreventingSquashing = getReasonsPreventingSquashing(layer, squashingState);
@@ -239,7 +240,7 @@ void CompositingLayerAssigner::assignLayersToBackingsInternal(RenderLayer* layer
CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(layer);
if (m_compositor->allocateOrClearCompositedLayerMapping(layer, compositedLayerUpdate)) {
- layersNeedingPaintInvalidation.append(layer);
+ layersNeedingPaintInvalidation.append(std::make_pair(layer, InspectorLayerInvalidationTrackingEvent::NewCompositedLayer));
m_layersChanged = true;
}

Powered by Google App Engine
This is Rietveld 408576698