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

Issue 1363613002: Save previous paint offset in LayoutObject (Closed)

Created:
5 years, 3 months ago by Xianzhu
Modified:
5 years, 3 months ago
Reviewers:
pdr.
CC:
blink-reviews, blink-reviews-layout_chromium.org, blink-reviews-paint_chromium.org, Rik, danakj, dshwang, drott+blinkwatch_chromium.org, krit, eae+blinkwatch, f(malita), jbroman, jchaffraix+rendering, Justin Novosad, leviw+renderwatch, pdr+graphicswatchlist_chromium.org, pdr+renderingwatchlist_chromium.org, rwlbuis, Stephen Chennney, slimming-paint-reviews_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Save previous paint offset in LayoutObject BUG=508383

Patch Set 1 #

Patch Set 2 : Enable SlimmingPaintOffsetCaching #

Patch Set 3 : #

Total comments: 4

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Total comments: 4

Patch Set 8 : Merge repo #

Patch Set 9 : No union (many compilers don't allow constructors); Fix a typo perhaps caused by switching to combiā€¦ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -107 lines) Patch
M third_party/WebKit/Source/core/layout/LayoutObject.h View 1 2 3 4 5 6 7 8 3 chunks +17 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.cpp View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/BlockPainter.cpp View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/InlineFlowBoxPainter.cpp View 1 2 3 4 5 6 7 3 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/paint/InlinePainter.cpp View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp View 1 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/paint/LayoutObjectDrawingRecorder.h View 1 2 3 4 5 6 7 8 4 chunks +8 lines, -39 lines 0 comments Download
M third_party/WebKit/Source/core/paint/LineBoxListPainter.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/LineBoxListPainter.cpp View 1 2 3 4 5 6 7 2 chunks +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.h View 1 2 3 4 5 6 7 3 chunks +0 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp View 1 2 3 4 5 6 7 3 chunks +0 lines, -40 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 7 (1 generated)
Xianzhu
Patch Set 2 is with slimmingPaintOffsetCaching enabled by default. It produced many text mismatches for ...
5 years, 3 months ago (2015-09-22 22:39:52 UTC) #2
pdr.
https://codereview.chromium.org/1363613002/diff/2/LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html File LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html (right): https://codereview.chromium.org/1363613002/diff/2/LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html#newcode26 LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html:26: "InlineTextBox 'Lorem ipsum'", I wouldn't have expected diffs when ...
5 years, 3 months ago (2015-09-22 22:44:44 UTC) #3
Xianzhu
https://codereview.chromium.org/1363613002/diff/2/LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html File LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html (right): https://codereview.chromium.org/1363613002/diff/2/LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html#newcode26 LayoutTests/paint/invalidation/spv2/multicol-as-paint-container.html:26: "InlineTextBox 'Lorem ipsum'", On 2015/09/22 22:44:44, pdr wrote: > ...
5 years, 3 months ago (2015-09-23 18:43:19 UTC) #4
pdr.
https://codereview.chromium.org/1363613002/diff/110001/Source/core/layout/LayoutObject.h File Source/core/layout/LayoutObject.h (right): https://codereview.chromium.org/1363613002/diff/110001/Source/core/layout/LayoutObject.h#newcode1144 Source/core/layout/LayoutObject.h:1144: return /*m_previousPaintOffset != uninitializedPaintOffset() && */m_previousPaintOffset != newPaintOffset; Oops ...
5 years, 3 months ago (2015-09-23 19:55:47 UTC) #5
Xianzhu
https://codereview.chromium.org/1363613002/diff/110001/Source/core/layout/LayoutObject.h File Source/core/layout/LayoutObject.h (right): https://codereview.chromium.org/1363613002/diff/110001/Source/core/layout/LayoutObject.h#newcode1144 Source/core/layout/LayoutObject.h:1144: return /*m_previousPaintOffset != uninitializedPaintOffset() && */m_previousPaintOffset != newPaintOffset; On ...
5 years, 3 months ago (2015-09-23 21:39:45 UTC) #6
pdr.
5 years, 3 months ago (2015-09-23 22:32:34 UTC) #7
On 2015/09/23 at 21:39:45, wangxianzhu wrote:
>
https://codereview.chromium.org/1363613002/diff/110001/Source/core/layout/Lay...
> File Source/core/layout/LayoutObject.h (right):
> 
>
https://codereview.chromium.org/1363613002/diff/110001/Source/core/layout/Lay...
> Source/core/layout/LayoutObject.h:1144: return /*m_previousPaintOffset !=
uninitializedPaintOffset() && */m_previousPaintOffset != newPaintOffset;
> On 2015/09/23 19:55:47, pdr wrote:
> > Oops
> 
> Done.
> 
>
https://codereview.chromium.org/1363613002/diff/110001/Source/core/paint/Layo...
> File Source/core/paint/LayoutObjectDrawingRecorder.h (right):
> 
>
https://codereview.chromium.org/1363613002/diff/110001/Source/core/paint/Layo...
> Source/core/paint/LayoutObjectDrawingRecorder.h:65: static void
updatePaintOffsetIfNeeded(DisplayItemList* displayItemList, const LayoutObject&
layoutObject, const LayoutPoint& paintOffset)
> On 2015/09/23 19:55:47, pdr wrote:
> > WDYT about changing this LayoutObject to be non-const so we can remove the
> > mutable on previous paint offset?
> 
> I think making LayoutObject const for painters can avoid unexpected mutation
during painting.
> 
> I would leave the following discussion for later CLs:
> 
> Perhaps we can make the mutable part of LayoutObject more explicit for
painting, e.g.:
> 
> In LayoutObject:
>   class MutableForPainting {
>   public:
>       void setPreviousPaintOffset() { m_layoutObject.setPreviousPaintOffset();
}
>       ...
>   private:
>       friend class LayoutObject;
>       MutableForPainting(const LayoutObject& layoutObject)
>           : m_layoutObject(const_cast<LayoutObject&>(layoutObject) {}
>       LayoutObject& m_layoutObject;
>   };
> 
>   MutableForPainting mutableForPainting() const {
>       ASSERT(lifecycle is in painting);
>       return MutableForPainting(this);
>   }
> 
> In Painter:
>   layoutObject.mutableForPainting().setPreviousPaintOffset();
> 
> wdyt?

I think this is a good idea, and no need to do this immediately.

Nice patch, LGTM

Powered by Google App Engine
This is Rietveld 408576698