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

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: Rebase 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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 1222
1223 // This conditional handles situations where non-rooted (and hence non-compo sited) frames are 1223 // This conditional handles situations where non-rooted (and hence non-compo sited) frames are
1224 // painted, such as SVG images. 1224 // painted, such as SVG images.
1225 if (!paintInvalidationContainer.isPaintInvalidationContainer()) 1225 if (!paintInvalidationContainer.isPaintInvalidationContainer())
1226 invalidatePaintRectangleOnWindow(paintInvalidationContainer, enclosingIn tRect(dirtyRect)); 1226 invalidatePaintRectangleOnWindow(paintInvalidationContainer, enclosingIn tRect(dirtyRect));
1227 1227
1228 if (paintInvalidationContainer.view()->usesCompositing() && paintInvalidatio nContainer.isPaintInvalidationContainer()) 1228 if (paintInvalidationContainer.view()->usesCompositing() && paintInvalidatio nContainer.isPaintInvalidationContainer())
1229 paintInvalidationContainer.setBackingNeedsPaintInvalidationInRect(dirtyR ect, invalidationReason); 1229 paintInvalidationContainer.setBackingNeedsPaintInvalidationInRect(dirtyR ect, invalidationReason);
1230 } 1230 }
1231 1231
1232 void LayoutObject::invalidateDisplayItemClient(const DisplayItemClientWrapper& d isplayItemClient) const 1232 void LayoutObject::invalidateDisplayItemClient(const DisplayItemClient& displayI temClient) const
1233 { 1233 {
1234 // TODO(wangxianzhu): Ensure correct bounds for the client will be or has be en passed to PaintController. crbug.com/547119. 1234 // TODO(wangxianzhu): Ensure correct bounds for the client will be or has be en passed to PaintController. crbug.com/547119.
1235 // Not using enclosingCompositedContainer() directly because this object may be in an orphaned subtree. 1235 // Not using enclosingCompositedContainer() directly because this object may be in an orphaned subtree.
1236 if (PaintLayer* enclosingLayer = this->enclosingLayer()) { 1236 if (PaintLayer* enclosingLayer = this->enclosingLayer()) {
1237 // This is valid because we want to invalidate the client in the display item list of the current backing. 1237 // This is valid because we want to invalidate the client in the display item list of the current backing.
1238 DisableCompositingQueryAsserts disabler; 1238 DisableCompositingQueryAsserts disabler;
1239 if (const PaintLayer* paintInvalidationLayer = enclosingLayer->enclosing LayerForPaintInvalidationCrossingFrameBoundaries()) 1239 if (const PaintLayer* paintInvalidationLayer = enclosingLayer->enclosing LayerForPaintInvalidationCrossingFrameBoundaries())
1240 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO nBacking(displayItemClient, PaintInvalidationFull, nullptr); 1240 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO nBacking(displayItemClient, PaintInvalidationFull, nullptr);
1241 enclosingLayer->setNeedsRepaint(); 1241 enclosingLayer->setNeedsRepaint();
1242 } 1242 }
(...skipping 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after
3515 const blink::LayoutObject* root = object1; 3515 const blink::LayoutObject* root = object1;
3516 while (root->parent()) 3516 while (root->parent())
3517 root = root->parent(); 3517 root = root->parent();
3518 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3518 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3519 } else { 3519 } else {
3520 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3520 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3521 } 3521 }
3522 } 3522 }
3523 3523
3524 #endif 3524 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutScrollbarTheme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698