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

Unified Diff: Source/core/platform/graphics/GraphicsLayer.cpp

Issue 16688004: Large canvas does not honor containing div's border radius (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Replaced explicit baselines with NeedsRebaseline Created 7 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
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.h ('k') | Source/core/platform/graphics/GraphicsLayerClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/GraphicsLayer.cpp
diff --git a/Source/core/platform/graphics/GraphicsLayer.cpp b/Source/core/platform/graphics/GraphicsLayer.cpp
index 6bae3b2b6188dfe0bdf56538530d2ae3c76a3c06..cee01d3af9f2a62aae63278968e4f0ce02b3ab21 100644
--- a/Source/core/platform/graphics/GraphicsLayer.cpp
+++ b/Source/core/platform/graphics/GraphicsLayer.cpp
@@ -98,6 +98,7 @@ GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
, m_contentsOrientation(CompositingCoordinatesTopDown)
, m_parent(0)
, m_maskLayer(0)
+ , m_contentsClippingMaskLayer(0)
, m_replicaLayer(0)
, m_replicatedLayer(0)
, m_paintCount(0)
@@ -431,6 +432,15 @@ void GraphicsLayer::updateContentsRect()
contentsLayer->setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y()));
contentsLayer->setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height()));
+
+ if (m_contentsClippingMaskLayer) {
+ if (m_contentsClippingMaskLayer->size() != m_contentsRect.size()) {
+ m_contentsClippingMaskLayer->setSize(m_contentsRect.size());
+ m_contentsClippingMaskLayer->setNeedsDisplay();
+ }
+ m_contentsClippingMaskLayer->setPosition(FloatPoint());
+ m_contentsClippingMaskLayer->setOffsetFromRenderer(offsetFromRenderer() + IntSize(m_contentsRect.location().x(), m_contentsRect.location().y()));
+ }
}
static HashSet<int>* s_registeredLayerSet;
@@ -496,6 +506,8 @@ void GraphicsLayer::setupContentsLayer(WebLayer* contentsLayer)
// Insert the content layer first. Video elements require this, because they have
// shadow content that must display in front of the video.
m_layer->layer()->insertChild(m_contentsLayer, 0);
+ WebLayer* borderWebLayer = m_contentsClippingMaskLayer ? m_contentsClippingMaskLayer->platformLayer() : 0;
+ m_contentsLayer->setMaskLayer(borderWebLayer);
}
}
@@ -704,6 +716,10 @@ void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeFlags fl
writeIndent(ts, indent + 2);
ts << "GraphicsLayerPaintMask\n";
}
+ if (paintingPhase() & GraphicsLayerPaintChildClippingMask) {
+ writeIndent(ts, indent + 2);
+ ts << "GraphicsLayerPaintChildClippingMask\n";
+ }
if (paintingPhase() & GraphicsLayerPaintOverflowContents) {
writeIndent(ts, indent + 2);
ts << "GraphicsLayerPaintOverflowContents\n";
@@ -876,6 +892,18 @@ void GraphicsLayer::setMaskLayer(GraphicsLayer* maskLayer)
m_layer->layer()->setMaskLayer(maskWebLayer);
}
+void GraphicsLayer::setContentsClippingMaskLayer(GraphicsLayer* contentsClippingMaskLayer)
+{
+ if (contentsClippingMaskLayer == m_contentsClippingMaskLayer)
+ return;
+
+ m_contentsClippingMaskLayer = contentsClippingMaskLayer;
+ WebLayer* contentsClippingMaskWebLayer = m_contentsClippingMaskLayer ? m_contentsClippingMaskLayer->platformLayer() : 0;
+ if (hasContentsLayer())
+ contentsLayer()->setMaskLayer(contentsClippingMaskWebLayer);
+ updateContentsRect();
+}
+
void GraphicsLayer::setBackfaceVisibility(bool visible)
{
m_backfaceVisibility = visible;
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.h ('k') | Source/core/platform/graphics/GraphicsLayerClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698