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

Unified Diff: Source/core/paint/ReplicaPainter.cpp

Issue 602973005: Move painting code from RenderReplica to ReplicaPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix 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
« no previous file with comments | « Source/core/paint/ReplicaPainter.h ('k') | Source/core/rendering/RenderReplica.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/ReplicaPainter.cpp
diff --git a/Source/core/paint/ReplicaPainter.cpp b/Source/core/paint/ReplicaPainter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2df4d3dae970a97959361ed4280ee7bbdc2f844e
--- /dev/null
+++ b/Source/core/paint/ReplicaPainter.cpp
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/paint/ReplicaPainter.h"
+
+#include "core/rendering/GraphicsContextAnnotator.h"
+#include "core/rendering/PaintInfo.h"
+#include "core/rendering/RenderLayer.h"
+#include "core/rendering/RenderReplica.h"
+
+namespace blink {
+
+void ReplicaPainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+{
+ ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderReplica);
+
+ if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseMask)
+ return;
+
+ LayoutPoint adjustedPaintOffset = paintOffset + m_renderReplica.location();
+
+ if (paintInfo.phase == PaintPhaseForeground) {
+ // Turn around and paint the parent layer. Use temporary clipRects, so that the layer doesn't end up caching clip rects
+ // computing using the wrong rootLayer
+ RenderLayer* rootPaintingLayer = m_renderReplica.layer()->transform() ? m_renderReplica.layer()->parent() : m_renderReplica.layer()->enclosingTransformedAncestor();
+ LayerPaintingInfo paintingInfo(rootPaintingLayer, paintInfo.rect, PaintBehaviorNormal, LayoutSize(), 0);
+ PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTransform | PaintLayerUncachedClipRects | PaintLayerPaintingReflection;
+ m_renderReplica.layer()->parent()->paintLayer(paintInfo.context, paintingInfo, flags);
+ } else if (paintInfo.phase == PaintPhaseMask) {
+ m_renderReplica.paintMask(paintInfo, adjustedPaintOffset);
+ }
+}
+
+} // namespace blink
« no previous file with comments | « Source/core/paint/ReplicaPainter.h ('k') | Source/core/rendering/RenderReplica.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698