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

Side by Side Diff: third_party/WebKit/Source/core/paint/ReplicaPainter.cpp

Issue 1982943002: Drag images should paint descendants that are painting siblings of the dragged element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comments & rebase Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPaintingInfo.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/ReplicaPainter.h" 5 #include "core/paint/ReplicaPainter.h"
6 6
7 #include "core/layout/LayoutReplica.h" 7 #include "core/layout/LayoutReplica.h"
8 #include "core/paint/LayoutObjectDrawingRecorder.h" 8 #include "core/paint/LayoutObjectDrawingRecorder.h"
9 #include "core/paint/PaintInfo.h" 9 #include "core/paint/PaintInfo.h"
10 #include "core/paint/PaintLayer.h" 10 #include "core/paint/PaintLayer.h"
11 #include "core/paint/PaintLayerPainter.h" 11 #include "core/paint/PaintLayerPainter.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 void ReplicaPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintO ffset) 15 void ReplicaPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintO ffset)
16 { 16 {
17 // PaintLayerReflectionInfo should have set a transform on the LayoutReplica . 17 // PaintLayerReflectionInfo should have set a transform on the LayoutReplica .
18 // Without it, we won't paint the reflection correctly. 18 // Without it, we won't paint the reflection correctly.
19 ASSERT(m_layoutReplica.layer()->transform()); 19 ASSERT(m_layoutReplica.layer()->transform());
20 20
21 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Mask) 21 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Mask)
22 return; 22 return;
23 23
24 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutReplica.location(); 24 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutReplica.location();
25 25
26 if (paintInfo.phase == PaintPhaseForeground) { 26 if (paintInfo.phase == PaintPhaseForeground) {
27 // Turn around and paint the parent layer. Use temporary clipRects, so t hat the layer doesn't end up caching clip rects 27 // Turn around and paint the parent layer. Use temporary clipRects, so t hat the layer doesn't end up caching clip rects
28 // computing using the wrong rootLayer 28 // computing using the wrong rootLayer
29 PaintLayer* rootPaintingLayer = m_layoutReplica.layer()->parent(); 29 PaintLayer* rootPaintingLayer = m_layoutReplica.layer()->parent();
30 PaintLayerPaintingInfo paintingInfo(rootPaintingLayer, LayoutRect(paintI nfo.cullRect().m_rect), GlobalPaintNormalPhase, LayoutSize(), 0); 30 PaintLayerPaintingInfo paintingInfo(rootPaintingLayer, LayoutRect(paintI nfo.cullRect().m_rect), GlobalPaintNormalPhase, LayoutSize());
31 PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTr ansform | PaintLayerUncachedClipRects | PaintLayerPaintingReflection; 31 PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTr ansform | PaintLayerUncachedClipRects | PaintLayerPaintingReflection;
32 PaintLayerPainter(*m_layoutReplica.layer()->parent()).paintLayer(paintIn fo.context, paintingInfo, flags); 32 PaintLayerPainter(*m_layoutReplica.layer()->parent()).paintLayer(paintIn fo.context, paintingInfo, flags);
33 } else if (paintInfo.phase == PaintPhaseMask) { 33 } else if (paintInfo.phase == PaintPhaseMask) {
34 m_layoutReplica.paintMask(paintInfo, adjustedPaintOffset); 34 m_layoutReplica.paintMask(paintInfo, adjustedPaintOffset);
35 } 35 }
36 } 36 }
37 37
38 } // namespace blink 38 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPaintingInfo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698