Commit b0246be6 authored by schenney's avatar schenney Committed by Commit bot

Add mask layer and offsetFromLayoutObject info to GraphicsLayer JSON

R=ajuma
BUG=672077
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2555283002
Cr-Commit-Position: refs/heads/master@{#437549}
parent ee8618f9
......@@ -12,7 +12,14 @@
"bounds": [400, 200],
"contentsOpaque": true,
"drawsContent": true,
"backgroundColor": "#000000"
"backgroundColor": "#000000",
"maskLayer": [
{
"name": "Mask Layer",
"bounds": [400, 200],
"drawsContent": true
}
]
}
]
}
......
......@@ -14,7 +14,14 @@
},
{
"name": "Child Containment Layer",
"bounds": [300, 300]
"bounds": [300, 300],
"maskLayer": [
{
"name": "Child Clipping Mask Layer",
"bounds": [300, 300],
"drawsContent": true
}
]
},
{
"name": "Ancestor Clipping Layer",
......
......@@ -53,10 +53,11 @@ FilterPainter::FilterPainter(PaintLayer& layer,
DCHECK(m_layoutObject);
if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius())
if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius()) {
m_clipRecorder = WTF::wrapUnique(new LayerClipRecorder(
context, *layer.layoutObject(), DisplayItem::kClipLayerFilter, clipRect,
&paintingInfo, LayoutPoint(), paintFlags));
}
if (!context.getPaintController().displayItemConstructionIsDisabled()) {
CompositorFilterOperations compositorFilterOperations =
......
......@@ -648,6 +648,12 @@ std::unique_ptr<JSONObject> GraphicsLayer::layerAsJSONInternal(
if (m_position != FloatPoint())
json->setArray("position", pointAsJSONArray(m_position));
if (flags & LayerTreeIncludesDebugInfo &&
m_offsetFromLayoutObject != DoubleSize()) {
json->setArray("offsetFromLayoutObject",
sizeAsJSONArray(m_offsetFromLayoutObject));
}
if (m_hasTransformOrigin &&
m_transformOrigin !=
FloatPoint3D(m_size.width() * 0.5f, m_size.height() * 0.5f, 0))
......@@ -768,6 +774,24 @@ std::unique_ptr<JSONObject> GraphicsLayer::layerAsJSONInternal(
json->setArray("squashingDisallowedReasons",
std::move(squashingDisallowedReasonsJSON));
}
if (m_maskLayer) {
std::unique_ptr<JSONArray> maskLayerJSON = JSONArray::create();
maskLayerJSON->pushObject(
m_maskLayer->layerAsJSONInternal(flags, renderingContextMap));
json->setArray("maskLayer", std::move(maskLayerJSON));
}
if (m_contentsClippingMaskLayer) {
std::unique_ptr<JSONArray> contentsClippingMaskLayerJSON =
JSONArray::create();
contentsClippingMaskLayerJSON->pushObject(
m_contentsClippingMaskLayer->layerAsJSONInternal(flags,
renderingContextMap));
json->setArray("contentsClippingMaskLayer",
std::move(contentsClippingMaskLayerJSON));
}
return json;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment