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

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

Issue 1497873002: Make DisplayItemClient an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 5 years 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 LayoutObject::SetLayoutNeededForbiddenScope::~SetLayoutNeededForbiddenScope() 127 LayoutObject::SetLayoutNeededForbiddenScope::~SetLayoutNeededForbiddenScope()
128 { 128 {
129 m_layoutObject.setNeedsLayoutIsForbidden(m_preexistingForbidden); 129 m_layoutObject.setNeedsLayoutIsForbidden(m_preexistingForbidden);
130 } 130 }
131 #endif 131 #endif
132 132
133 struct SameSizeAsLayoutObject { 133 struct SameSizeAsLayoutObject {
134 virtual ~SameSizeAsLayoutObject() { } // Allocate vtable pointer. 134 virtual ~SameSizeAsLayoutObject() { } // Allocate vtable pointer.
135 void* pointers[5]; 135 void* pointers[6];
136 #if ENABLE(ASSERT) 136 #if ENABLE(ASSERT)
137 unsigned m_debugBitfields : 2; 137 unsigned m_debugBitfields : 2;
138 #endif 138 #endif
139 unsigned m_bitfields; 139 unsigned m_bitfields;
140 unsigned m_bitfields2; 140 unsigned m_bitfields2;
141 LayoutRect rect; // Stores the previous paint invalidation rect. 141 LayoutRect rect; // Stores the previous paint invalidation rect.
142 LayoutPoint position; // Stores the previous position from the paint invalid ation container. 142 LayoutPoint position; // Stores the previous position from the paint invalid ation container.
143 }; 143 };
144 144
145 static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject), "LayoutObj ect should stay small"); 145 static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject), "LayoutObj ect should stay small");
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 1227
1228 // This conditional handles situations where non-rooted (and hence non-compo sited) frames are 1228 // This conditional handles situations where non-rooted (and hence non-compo sited) frames are
1229 // painted, such as SVG images. 1229 // painted, such as SVG images.
1230 if (!paintInvalidationContainer.isPaintInvalidationContainer()) 1230 if (!paintInvalidationContainer.isPaintInvalidationContainer())
1231 invalidatePaintRectangleOnWindow(paintInvalidationContainer, enclosingIn tRect(dirtyRect)); 1231 invalidatePaintRectangleOnWindow(paintInvalidationContainer, enclosingIn tRect(dirtyRect));
1232 1232
1233 if (paintInvalidationContainer.view()->usesCompositing() && paintInvalidatio nContainer.isPaintInvalidationContainer()) 1233 if (paintInvalidationContainer.view()->usesCompositing() && paintInvalidatio nContainer.isPaintInvalidationContainer())
1234 paintInvalidationContainer.setBackingNeedsPaintInvalidationInRect(dirtyR ect, invalidationReason); 1234 paintInvalidationContainer.setBackingNeedsPaintInvalidationInRect(dirtyR ect, invalidationReason);
1235 } 1235 }
1236 1236
1237 void LayoutObject::invalidateDisplayItemClient(const DisplayItemClientWrapper& d isplayItemClient) const 1237 void LayoutObject::invalidateDisplayItemClient(const DisplayItemClient& displayI temClient) const
1238 { 1238 {
1239 // TODO(wangxianzhu): Ensure correct bounds for the client will be or has be en passed to PaintController. crbug.com/547119. 1239 // TODO(wangxianzhu): Ensure correct bounds for the client will be or has be en passed to PaintController. crbug.com/547119.
1240 // Not using enclosingCompositedContainer() directly because this object may be in an orphaned subtree. 1240 // Not using enclosingCompositedContainer() directly because this object may be in an orphaned subtree.
1241 if (PaintLayer* enclosingLayer = this->enclosingLayer()) { 1241 if (PaintLayer* enclosingLayer = this->enclosingLayer()) {
1242 // This is valid because we want to invalidate the client in the display item list of the current backing. 1242 // This is valid because we want to invalidate the client in the display item list of the current backing.
1243 DisableCompositingQueryAsserts disabler; 1243 DisableCompositingQueryAsserts disabler;
1244 if (const PaintLayer* paintInvalidationLayer = enclosingLayer->enclosing LayerForPaintInvalidationCrossingFrameBoundaries()) 1244 if (const PaintLayer* paintInvalidationLayer = enclosingLayer->enclosing LayerForPaintInvalidationCrossingFrameBoundaries())
1245 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO nBacking(displayItemClient, PaintInvalidationFull, nullptr); 1245 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO nBacking(displayItemClient, PaintInvalidationFull, nullptr);
1246 enclosingLayer->setNeedsRepaint(); 1246 enclosingLayer->setNeedsRepaint();
1247 } 1247 }
(...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after
3499 const blink::LayoutObject* root = object1; 3499 const blink::LayoutObject* root = object1;
3500 while (root->parent()) 3500 while (root->parent())
3501 root = root->parent(); 3501 root = root->parent();
3502 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3502 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3503 } else { 3503 } else {
3504 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3504 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3505 } 3505 }
3506 } 3506 }
3507 3507
3508 #endif 3508 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698