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

Side by Side 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, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/ReplicaPainter.h ('k') | Source/core/rendering/RenderReplica.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/paint/ReplicaPainter.h"
7
8 #include "core/rendering/GraphicsContextAnnotator.h"
9 #include "core/rendering/PaintInfo.h"
10 #include "core/rendering/RenderLayer.h"
11 #include "core/rendering/RenderReplica.h"
12
13 namespace blink {
14
15 void ReplicaPainter::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
16 {
17 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderReplica);
18
19 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Mask)
20 return;
21
22 LayoutPoint adjustedPaintOffset = paintOffset + m_renderReplica.location();
23
24 if (paintInfo.phase == PaintPhaseForeground) {
25 // Turn around and paint the parent layer. Use temporary clipRects, so t hat the layer doesn't end up caching clip rects
26 // computing using the wrong rootLayer
27 RenderLayer* rootPaintingLayer = m_renderReplica.layer()->transform() ? m_renderReplica.layer()->parent() : m_renderReplica.layer()->enclosingTransforme dAncestor();
28 LayerPaintingInfo paintingInfo(rootPaintingLayer, paintInfo.rect, PaintB ehaviorNormal, LayoutSize(), 0);
29 PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTr ansform | PaintLayerUncachedClipRects | PaintLayerPaintingReflection;
30 m_renderReplica.layer()->parent()->paintLayer(paintInfo.context, paintin gInfo, flags);
31 } else if (paintInfo.phase == PaintPhaseMask) {
32 m_renderReplica.paintMask(paintInfo, adjustedPaintOffset);
33 }
34 }
35
36 } // namespace blink
OLDNEW
« 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