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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2727223002: Round the subpixel accumulation used for composited scrolling content (Closed)
Patch Set: Merge and fix Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 2d0b917413a35611db9079fff8995dca642b36f9..9f9909c630febc58101727b7dd9bbe5cbc1ab67b 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -47,6 +47,8 @@ void PaintLayerPainter::Paint(GraphicsContext& context,
const LayoutRect& damage_rect,
const GlobalPaintFlags global_paint_flags,
PaintLayerFlags paint_flags) {
+ DCHECK(paint_layer_.GetCompositingState() != kPaintsIntoOwnBacking ||
+ paint_layer_.SubpixelAccumulation().IsZero());
PaintLayerPaintingInfo painting_info(
&paint_layer_, LayoutRect(EnclosingIntRect(damage_rect)),
global_paint_flags, LayoutSize());
@@ -324,10 +326,6 @@ PaintResult PaintLayerPainter::PaintLayerContents(
// Ensure our lists are up to date.
paint_layer_.StackingNode()->UpdateLayerListsIfNeeded();
- LayoutSize subpixel_accumulation =
- paint_layer_.GetCompositingState() == kPaintsIntoOwnBacking
- ? paint_layer_.SubpixelAccumulation()
- : painting_info_arg.sub_pixel_accumulation;
ShouldRespectOverflowClipType respect_overflow_clip =
ShouldRespectOverflowClip(paint_flags, paint_layer_.GetLayoutObject());
@@ -336,7 +334,8 @@ PaintResult PaintLayerPainter::PaintLayerContents(
if (ShouldCreateSubsequence(paint_layer_, context, painting_info_arg,
paint_flags)) {
if (!ShouldRepaintSubsequence(paint_layer_, painting_info_arg,
- respect_overflow_clip, subpixel_accumulation,
+ respect_overflow_clip,
+ painting_info_arg.sub_pixel_accumulation,
should_clear_empty_paint_phase_flags) &&
SubsequenceRecorder::UseCachedSubsequenceIfPossible(context,
paint_layer_))
@@ -357,7 +356,7 @@ PaintResult PaintLayerPainter::PaintLayerContents(
LayoutPoint offset_from_root;
paint_layer_.ConvertToLayerCoords(painting_info.root_layer, offset_from_root);
- offset_from_root.Move(subpixel_accumulation);
+ offset_from_root.Move(painting_info_arg.sub_pixel_accumulation);
LayoutRect bounds = paint_layer_.PhysicalBoundingBox(offset_from_root);
if (!painting_info.paint_dirty_rect.Contains(bounds))
@@ -413,8 +412,6 @@ PaintResult PaintLayerPainter::PaintLayerContents(
}
PaintLayerPaintingInfo local_painting_info(painting_info);
- local_painting_info.sub_pixel_accumulation = subpixel_accumulation;
-
bool should_paint_content = paint_layer_.HasVisibleContent() &&
is_self_painting_layer &&
!is_painting_overlay_scrollbars;
@@ -823,7 +820,9 @@ PaintResult PaintLayerPainter::PaintFragmentByApplyingTransform(
IntPoint rounded_delta = RoundedIntPoint(delta);
transform.PostTranslate(rounded_delta.X(), rounded_delta.Y());
LayoutSize adjusted_sub_pixel_accumulation =
- painting_info.sub_pixel_accumulation + (delta - rounded_delta);
+ paint_layer_.GetCompositingState() == kPaintsIntoOwnBacking
chrishtr 2017/04/21 15:50:51 Why is this change needed?
flackr 2017/05/04 17:38:41 This was to make the code behave the same as befor
+ ? paint_layer_.SubpixelAccumulation()
+ : painting_info.sub_pixel_accumulation + (delta - rounded_delta);
// TODO(jbroman): Put the real transform origin here, instead of using a
// matrix with the origin baked in.
@@ -1226,6 +1225,8 @@ void PaintLayerPainter::PaintOverlayScrollbars(
if (!paint_layer_.ContainsDirtyOverlayScrollbars())
return;
+ DCHECK(paint_layer_.GetCompositingState() != kPaintsIntoOwnBacking ||
+ paint_layer_.SubpixelAccumulation().IsZero());
PaintLayerPaintingInfo painting_info(
&paint_layer_, LayoutRect(EnclosingIntRect(damage_rect)), paint_flags,
LayoutSize());
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698