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

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

Issue 778653002: Pixel-snap the bounds in BoxPainter::boundsForDrawingRecorder (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « LayoutTests/TestExpectations ('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 "config.h" 5 #include "config.h"
6 #include "core/paint/BoxPainter.h" 6 #include "core/paint/BoxPainter.h"
7 7
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/html/HTMLFrameOwnerElement.h" 10 #include "core/html/HTMLFrameOwnerElement.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 { 54 {
55 LayoutRect bounds; 55 LayoutRect bounds;
56 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 56 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
57 if (m_renderBox.isDocumentElement()) { 57 if (m_renderBox.isDocumentElement()) {
58 // The document element is specified to paint its background infinit ely. 58 // The document element is specified to paint its background infinit ely.
59 bounds = m_renderBox.view()->backgroundRect(&m_renderBox); 59 bounds = m_renderBox.view()->backgroundRect(&m_renderBox);
60 } else { 60 } else {
61 // Use the visual overflow rect here, because it will include overfl ow introduced by the theme. 61 // Use the visual overflow rect here, because it will include overfl ow introduced by the theme.
62 bounds = m_renderBox.visualOverflowRect(); 62 bounds = m_renderBox.visualOverflowRect();
63 bounds.moveBy(paintOffset); 63 bounds.moveBy(paintOffset);
64 bounds = pixelSnappedIntRect(bounds);
64 } 65 }
65 } 66 }
66 return bounds; 67 return bounds;
67 } 68 }
68 69
69 void BoxPainter::paintBoxDecorationBackgroundWithRect(const PaintInfo& paintInfo , const LayoutPoint& paintOffset, const LayoutRect& paintRect) 70 void BoxPainter::paintBoxDecorationBackgroundWithRect(const PaintInfo& paintInfo , const LayoutPoint& paintOffset, const LayoutRect& paintRect)
70 { 71 {
71 RenderStyle* style = m_renderBox.style(); 72 RenderStyle* style = m_renderBox.style();
72 BoxDecorationData boxDecorationData(*style, m_renderBox.canRenderBorderImage (), m_renderBox.backgroundHasOpaqueTopLayer(), m_renderBox.backgroundShouldAlway sBeClipped(), paintInfo.context); 73 BoxDecorationData boxDecorationData(*style, m_renderBox.canRenderBorderImage (), m_renderBox.backgroundHasOpaqueTopLayer(), m_renderBox.backgroundShouldAlway sBeClipped(), paintInfo.context);
73 74
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 2171
2171 FloatPoint secondQuad[4]; 2172 FloatPoint secondQuad[4];
2172 secondQuad[0] = quad[0]; 2173 secondQuad[0] = quad[0];
2173 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); 2174 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy);
2174 secondQuad[2] = quad[2]; 2175 secondQuad[2] = quad[2];
2175 secondQuad[3] = quad[3]; 2176 secondQuad[3] = quad[3];
2176 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); 2177 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches);
2177 } 2178 }
2178 2179
2179 } // namespace blink 2180 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698