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

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 remove subpixel adjustment for transformed fragments. Created 3 years, 7 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
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 8504021eea4c5e77618401dfd9af5fa839648687..9a190866b3fa96f731d6bf53f4959e15689d6159 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());
@@ -329,10 +331,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());
@@ -341,7 +339,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_))
@@ -362,7 +361,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))
@@ -418,8 +417,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;
@@ -1241,6 +1238,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());

Powered by Google App Engine
This is Rietveld 408576698