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

Side by Side Diff: Source/core/paint/ReplacedPainter.cpp

Issue 1197843004: Allocate a drawing recorder locally to BoxPainter code in the mask phase. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
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 "config.h" 5 #include "config.h"
6 #include "core/paint/ReplacedPainter.h" 6 #include "core/paint/ReplacedPainter.h"
7 7
8 #include "core/layout/LayoutReplaced.h" 8 #include "core/layout/LayoutReplaced.h"
9 #include "core/paint/BoxPainter.h" 9 #include "core/paint/BoxPainter.h"
10 #include "core/paint/DeprecatedPaintLayer.h" 10 #include "core/paint/DeprecatedPaintLayer.h"
(...skipping 13 matching lines...) Expand all
24 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutReplaced.location(); 24 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutReplaced.location();
25 LayoutRect paintRect(adjustedPaintOffset, m_layoutReplaced.size()); 25 LayoutRect paintRect(adjustedPaintOffset, m_layoutReplaced.size());
26 26
27 LayoutRect visualOverflowRect(m_layoutReplaced.visualOverflowRect()); 27 LayoutRect visualOverflowRect(m_layoutReplaced.visualOverflowRect());
28 visualOverflowRect.moveBy(adjustedPaintOffset); 28 visualOverflowRect.moveBy(adjustedPaintOffset);
29 29
30 if (m_layoutReplaced.hasBoxDecorationBackground() && (paintInfo.phase == Pai ntPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 30 if (m_layoutReplaced.hasBoxDecorationBackground() && (paintInfo.phase == Pai ntPhaseForeground || paintInfo.phase == PaintPhaseSelection))
31 m_layoutReplaced.paintBoxDecorationBackground(paintInfo, adjustedPaintOf fset); 31 m_layoutReplaced.paintBoxDecorationBackground(paintInfo, adjustedPaintOf fset);
32 32
33 if (paintInfo.phase == PaintPhaseMask) { 33 if (paintInfo.phase == PaintPhaseMask) {
34 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout Replaced, paintInfo.phase, visualOverflowRect); 34 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset);
35 if (!drawingRecorder.canUseCachedDrawing())
36 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset);
37 return; 35 return;
38 } 36 }
39 37
40 if (paintInfo.phase == PaintPhaseClippingMask && (!m_layoutReplaced.hasLayer () || !m_layoutReplaced.layer()->hasCompositedClippingMask())) 38 if (paintInfo.phase == PaintPhaseClippingMask && (!m_layoutReplaced.hasLayer () || !m_layoutReplaced.layer()->hasCompositedClippingMask()))
41 return; 39 return;
42 40
43 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel fOutline) { 41 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel fOutline) {
44 if (m_layoutReplaced.styleRef().outlineWidth()) 42 if (m_layoutReplaced.styleRef().outlineWidth())
45 ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, paintRect, v isualOverflowRect); 43 ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, paintRect, v isualOverflowRect);
46 return; 44 return;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting Rect); 94 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting Rect);
97 95
98 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); 96 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect);
99 if (drawingRecorder.canUseCachedDrawing()) 97 if (drawingRecorder.canUseCachedDrawing())
100 return; 98 return;
101 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s electionBackgroundColor()); 99 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s electionBackgroundColor());
102 } 100 }
103 } 101 }
104 102
105 } // namespace blink 103 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698