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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2095013003: Changes in DisplayItemClient for spv2 paint invalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes to DisplayItemClient Created 4 years, 5 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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 { 109 {
110 m_layoutObject.setNeedsLayoutIsForbidden(true); 110 m_layoutObject.setNeedsLayoutIsForbidden(true);
111 } 111 }
112 112
113 LayoutObject::SetLayoutNeededForbiddenScope::~SetLayoutNeededForbiddenScope() 113 LayoutObject::SetLayoutNeededForbiddenScope::~SetLayoutNeededForbiddenScope()
114 { 114 {
115 m_layoutObject.setNeedsLayoutIsForbidden(m_preexistingForbidden); 115 m_layoutObject.setNeedsLayoutIsForbidden(m_preexistingForbidden);
116 } 116 }
117 #endif 117 #endif
118 118
119 struct SameSizeAsLayoutObject { 119 struct SameSizeAsLayoutObject : DisplayItemClient {
120 virtual ~SameSizeAsLayoutObject() { } // Allocate vtable pointer. 120 virtual ~SameSizeAsLayoutObject() { } // Allocate vtable pointer.
121 LayoutPoint position;
122 LayoutRect rect;
121 void* pointers[6]; 123 void* pointers[6];
122 #if ENABLE(ASSERT) 124 #if ENABLE(ASSERT)
123 unsigned m_debugBitfields : 2; 125 unsigned m_debugBitfields : 2;
124 #endif 126 #endif
125 unsigned m_bitfields; 127 unsigned m_bitfields;
126 unsigned m_bitfields2; 128 unsigned m_bitfields2;
127 LayoutRect rect; // Stores the previous paint invalidation rect.
128 LayoutPoint position; // Stores the previous position from the paint invalid ation container.
129 DisplayItemCacheGeneration cacheGeneration;
chrishtr 2016/06/27 21:09:08 Won't m_cacheGenerationOrInvalidationReason still
Xianzhu 2016/06/27 21:34:54 Yes, it's still there.
130 }; 129 };
131 130
132 static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject), "LayoutObj ect should stay small"); 131 static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject), "LayoutObj ect should stay small");
133 132
134 bool LayoutObject::s_affectsParentBlock = false; 133 bool LayoutObject::s_affectsParentBlock = false;
135 134
136 typedef HashMap<const LayoutObject*, LayoutRect> SelectionPaintInvalidationMap; 135 typedef HashMap<const LayoutObject*, LayoutRect> SelectionPaintInvalidationMap;
137 static SelectionPaintInvalidationMap* selectionPaintInvalidationMap = nullptr; 136 static SelectionPaintInvalidationMap* selectionPaintInvalidationMap = nullptr;
138 137
139 // The pointer to paint properties is implemented as a global hash map temporari ly, 138 // The pointer to paint properties is implemented as a global hash map temporari ly,
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 paintInvalidationContainer.setBackingNeedsPaintInvalidationInRect(dirtyR ect, invalidationReason, *this); 1191 paintInvalidationContainer.setBackingNeedsPaintInvalidationInRect(dirtyR ect, invalidationReason, *this);
1193 } 1192 }
1194 1193
1195 void LayoutObject::invalidateDisplayItemClient(const DisplayItemClient& client, PaintInvalidationReason reason) const 1194 void LayoutObject::invalidateDisplayItemClient(const DisplayItemClient& client, PaintInvalidationReason reason) const
1196 { 1195 {
1197 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs Repaint is set. 1196 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs Repaint is set.
1198 // Don't set the flag here because getting enclosingSelfPaintLayer has cost and the caller can use 1197 // Don't set the flag here because getting enclosingSelfPaintLayer has cost and the caller can use
1199 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t o reduce the cost. 1198 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t o reduce the cost.
1200 DCHECK(!paintingLayer() || paintingLayer()->needsRepaint()); 1199 DCHECK(!paintingLayer() || paintingLayer()->needsRepaint());
1201 1200
1202 client.setDisplayItemsUncached(); 1201 client.setDisplayItemsUncached(reason);
1203 1202
1204 if (FrameView* frameView = this->frameView()) 1203 if (FrameView* frameView = this->frameView())
1205 frameView->trackObjectPaintInvalidation(client, reason); 1204 frameView->trackObjectPaintInvalidation(client, reason);
1206 } 1205 }
1207 1206
1208 void LayoutObject::setPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(co nst PaintInvalidationState& paintInvalidationState, const DisplayItemClient& cli ent, PaintInvalidationReason reason) const 1207 void LayoutObject::setPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(co nst PaintInvalidationState& paintInvalidationState, const DisplayItemClient& cli ent, PaintInvalidationReason reason) const
1209 { 1208 {
1210 paintInvalidationState.paintingLayer().setNeedsRepaint(); 1209 paintInvalidationState.paintingLayer().setNeedsRepaint();
1211 invalidateDisplayItemClient(client, reason); 1210 invalidateDisplayItemClient(client, reason);
1212 } 1211 }
(...skipping 2440 matching lines...) Expand 10 before | Expand all | Expand 10 after
3653 const blink::LayoutObject* root = object1; 3652 const blink::LayoutObject* root = object1;
3654 while (root->parent()) 3653 while (root->parent())
3655 root = root->parent(); 3654 root = root->parent();
3656 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3655 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3657 } else { 3656 } else {
3658 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3657 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3659 } 3658 }
3660 } 3659 }
3661 3660
3662 #endif 3661 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698