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

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

Issue 2727223002: Round the subpixel accumulation used for composited scrolling content (Closed)
Patch Set: Round the subpixel accumulation in PaintLayerPainter for scrolling contents. Created 3 years, 9 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
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/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "core/layout/LayoutView.h" 8 #include "core/layout/LayoutView.h"
9 #include "core/paint/ClipPathClipper.h" 9 #include "core/paint/ClipPathClipper.h"
10 #include "core/paint/FilterPainter.h" 10 #include "core/paint/FilterPainter.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 m_paintLayer.layoutObject().view()->frame()->shouldThrottleRendering()) 318 m_paintLayer.layoutObject().view()->frame()->shouldThrottleRendering())
319 return result; 319 return result;
320 320
321 // Ensure our lists are up to date. 321 // Ensure our lists are up to date.
322 m_paintLayer.stackingNode()->updateLayerListsIfNeeded(); 322 m_paintLayer.stackingNode()->updateLayerListsIfNeeded();
323 323
324 LayoutSize subpixelAccumulation = 324 LayoutSize subpixelAccumulation =
325 m_paintLayer.compositingState() == PaintsIntoOwnBacking 325 m_paintLayer.compositingState() == PaintsIntoOwnBacking
326 ? m_paintLayer.subpixelAccumulation() 326 ? m_paintLayer.subpixelAccumulation()
327 : paintingInfoArg.subPixelAccumulation; 327 : paintingInfoArg.subPixelAccumulation;
328 // The composited scrolling contents layer position rounds the subpixel
329 // accumulation.
330 if (isPaintingScrollingContent)
331 subpixelAccumulation = LayoutSize(roundedIntSize(subpixelAccumulation));
flackr 2017/03/14 21:07:19 I found where we seem to first make the incorrect
328 ShouldRespectOverflowClipType respectOverflowClip = 332 ShouldRespectOverflowClipType respectOverflowClip =
329 shouldRespectOverflowClip(paintFlags, m_paintLayer.layoutObject()); 333 shouldRespectOverflowClip(paintFlags, m_paintLayer.layoutObject());
330 334
331 Optional<SubsequenceRecorder> subsequenceRecorder; 335 Optional<SubsequenceRecorder> subsequenceRecorder;
332 bool shouldClearEmptyPaintPhaseFlags = false; 336 bool shouldClearEmptyPaintPhaseFlags = false;
333 if (shouldCreateSubsequence(m_paintLayer, context, paintingInfoArg, 337 if (shouldCreateSubsequence(m_paintLayer, context, paintingInfoArg,
334 paintFlags)) { 338 paintFlags)) {
335 if (!shouldRepaintSubsequence(m_paintLayer, paintingInfoArg, 339 if (!shouldRepaintSubsequence(m_paintLayer, paintingInfoArg,
336 respectOverflowClip, subpixelAccumulation, 340 respectOverflowClip, subpixelAccumulation,
337 shouldClearEmptyPaintPhaseFlags) && 341 shouldClearEmptyPaintPhaseFlags) &&
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 context, layoutObject, PaintPhaseClippingMask)) 1213 context, layoutObject, PaintPhaseClippingMask))
1210 return; 1214 return;
1211 1215
1212 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); 1216 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
1213 LayoutObjectDrawingRecorder drawingRecorder( 1217 LayoutObjectDrawingRecorder drawingRecorder(
1214 context, layoutObject, PaintPhaseClippingMask, snappedClipRect); 1218 context, layoutObject, PaintPhaseClippingMask, snappedClipRect);
1215 context.fillRect(snappedClipRect, Color::black); 1219 context.fillRect(snappedClipRect, Color::black);
1216 } 1220 }
1217 1221
1218 } // namespace blink 1222 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-fractional-offset-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698