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

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

Issue 799563002: Use DrawingRecorder::canUseCachedDrawing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years 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/ImagePainter.cpp ('k') | Source/core/paint/InlinePainter.cpp » ('j') | 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 "config.h" 5 #include "config.h"
6 #include "core/paint/InlineFlowBoxPainter.h" 6 #include "core/paint/InlineFlowBoxPainter.h"
7 7
8 #include "core/paint/BoxPainter.h" 8 #include "core/paint/BoxPainter.h"
9 #include "core/paint/RenderDrawingRecorder.h" 9 #include "core/paint/RenderDrawingRecorder.h"
10 #include "core/rendering/InlineFlowBox.h" 10 #include "core/rendering/InlineFlowBox.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 if (containingBlockPaintsContinuationOutline) { 55 if (containingBlockPaintsContinuationOutline) {
56 // Add ourselves to the containing block of the entire continuat ion so that it can 56 // Add ourselves to the containing block of the entire continuat ion so that it can
57 // paint us atomically. 57 // paint us atomically.
58 cb->addContinuationWithOutline(toRenderInline(m_inlineFlowBox.re nderer().node()->renderer())); 58 cb->addContinuationWithOutline(toRenderInline(m_inlineFlowBox.re nderer().node()->renderer()));
59 } else if (!inlineFlow.isInlineElementContinuation()) { 59 } else if (!inlineFlow.isInlineElementContinuation()) {
60 paintInfo.outlineObjects()->add(&inlineFlow); 60 paintInfo.outlineObjects()->add(&inlineFlow);
61 } 61 }
62 } 62 }
63 } else if (paintInfo.phase == PaintPhaseMask) { 63 } else if (paintInfo.phase == PaintPhaseMask) {
64 RenderDrawingRecorder recorder(paintInfo.context, &m_inlineFlowBox.rende rer(), paintInfo.phase, pixelSnappedIntRect(overflowRect)); 64 RenderDrawingRecorder recorder(paintInfo.context, m_inlineFlowBox.render er(), paintInfo.phase, pixelSnappedIntRect(overflowRect));
65 paintMask(paintInfo, paintOffset); 65 if (!recorder.canUseCachedDrawing())
66 paintMask(paintInfo, paintOffset);
66 return; 67 return;
67 } else if (paintInfo.phase == PaintPhaseForeground) { 68 } else if (paintInfo.phase == PaintPhaseForeground) {
68 // Paint our background, border and box-shadow. 69 // Paint our background, border and box-shadow.
69 paintBoxDecorationBackground(paintInfo, paintOffset); 70 paintBoxDecorationBackground(paintInfo, paintOffset);
70 } 71 }
71 72
72 // Paint our children. 73 // Paint our children.
73 if (paintInfo.phase != PaintPhaseSelfOutline) { 74 if (paintInfo.phase != PaintPhaseSelfOutline) {
74 PaintInfo childInfo(paintInfo); 75 PaintInfo childInfo(paintInfo);
75 childInfo.phase = paintInfo.phase == PaintPhaseChildOutlines ? PaintPhas eOutline : paintInfo.phase; 76 childInfo.phase = paintInfo.phase == PaintPhaseChildOutlines ? PaintPhas eOutline : paintInfo.phase;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 206
206 LayoutRect frameRect = roundedFrameRectClampedToLineTopAndBottomIfNeeded(); 207 LayoutRect frameRect = roundedFrameRectClampedToLineTopAndBottomIfNeeded();
207 208
208 // Move x/y to our coordinates. 209 // Move x/y to our coordinates.
209 LayoutRect localRect(frameRect); 210 LayoutRect localRect(frameRect);
210 m_inlineFlowBox.flipForWritingMode(localRect); 211 m_inlineFlowBox.flipForWritingMode(localRect);
211 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); 212 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location();
212 213
213 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size()); 214 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size());
214 215
215 RenderDrawingRecorder recorder(paintInfo.context, &m_inlineFlowBox.renderer( ), paintInfo.phase, pixelSnappedIntRect(paintRect)); 216 RenderDrawingRecorder recorder(paintInfo.context, m_inlineFlowBox.renderer() , paintInfo.phase, pixelSnappedIntRect(paintRect));
217 if (recorder.canUseCachedDrawing())
218 return;
216 219
217 // Shadow comes first and is behind the background and border. 220 // Shadow comes first and is behind the background and border.
218 if (!m_inlineFlowBox.boxModelObject()->boxShadowShouldBeAppliedToBackground( BackgroundBleedNone, &m_inlineFlowBox)) 221 if (!m_inlineFlowBox.boxModelObject()->boxShadowShouldBeAppliedToBackground( BackgroundBleedNone, &m_inlineFlowBox))
219 paintBoxShadow(paintInfo, styleToUse, Normal, paintRect); 222 paintBoxShadow(paintInfo, styleToUse, Normal, paintRect);
220 223
221 Color backgroundColor = m_inlineFlowBox.renderer().resolveColor(styleToUse, CSSPropertyBackgroundColor); 224 Color backgroundColor = m_inlineFlowBox.renderer().resolveColor(styleToUse, CSSPropertyBackgroundColor);
222 paintFillLayers(paintInfo, backgroundColor, styleToUse->backgroundLayers(), paintRect); 225 paintFillLayers(paintInfo, backgroundColor, styleToUse->backgroundLayers(), paintRect);
223 paintBoxShadow(paintInfo, styleToUse, Inset, paintRect); 226 paintBoxShadow(paintInfo, styleToUse, Inset, paintRect);
224 227
225 // :first-line cannot be used to put borders on a line. Always paint borders with our 228 // :first-line cannot be used to put borders on a line. Always paint borders with our
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 rect.setHeight(logicalHeight); 330 rect.setHeight(logicalHeight);
328 } else { 331 } else {
329 rect.setX(logicalTop); 332 rect.setX(logicalTop);
330 rect.setWidth(logicalHeight); 333 rect.setWidth(logicalHeight);
331 } 334 }
332 } 335 }
333 return rect; 336 return rect;
334 } 337 }
335 338
336 } // namespace blink 339 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/ImagePainter.cpp ('k') | Source/core/paint/InlinePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698