Changeset 195156 in webkit
- Timestamp:
- Jan 15, 2016 3:57:41 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r195152 r195156 1 2016-01-10 Simon Fraser <simon.fraser@apple.com> 2 3 Make a way to test display-list drawing 4 https://bugs.webkit.org/show_bug.cgi?id=152956 5 6 Reviewed by Ryosuke Niwa. 7 8 Enable displaylists tests on Mac and iOS. 9 10 * TestExpectations: 11 * displaylists/layer-dispay-list-expected.txt: Added. 12 * displaylists/layer-dispay-list.html: Added. 13 * platform/ios-simulator/TestExpectations: 14 * platform/mac/TestExpectations: 15 1 16 2016-01-15 Ryosuke Niwa <rniwa@webkit.org> 2 17 -
trunk/LayoutTests/TestExpectations
r195087 r195156 12 12 accessibility/mac [ Skip ] 13 13 accessibility/win [ Skip ] 14 displaylists [ Skip ] 14 15 editing/mac [ Skip ] 15 16 editing/pasteboard/gtk [ Skip ] -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r195092 r195156 8 8 9 9 accessibility/ios-simulator [ Pass ] 10 displaylists [ Pass ] 10 11 quicklook [ Pass ] 11 12 http/tests/quicklook [ Pass ] -
trunk/LayoutTests/platform/mac/TestExpectations
r195147 r195156 8 8 9 9 accessibility/mac [ Pass ] 10 displaylists [ Pass ] 10 11 editing/mac [ Pass ] 11 12 fast/scrolling/latching [ Pass ] -
trunk/Source/WebCore/ChangeLog
r195154 r195156 1 2016-01-10 Simon Fraser <simon.fraser@apple.com> 2 3 Make a way to test display-list drawing 4 https://bugs.webkit.org/show_bug.cgi?id=152956 5 6 Reviewed by Ryosuke Niwa. 7 8 Make it possible to toggle display-list drawing for a given compositing 9 layer via internals, as well as getting a textual representation of the display 10 list, optionally including items with platform-specific behavior. 11 12 Add one test that uses this. 13 14 Test: displaylists/layer-dispay-list.html 15 16 * platform/graphics/GraphicsLayer.h: 17 (WebCore::GraphicsLayer::displayListAsText): 18 * platform/graphics/ca/GraphicsLayerCA.cpp: 19 (WebCore::GraphicsLayerCA::displayListAsText): 20 * platform/graphics/ca/GraphicsLayerCA.h: 21 * platform/graphics/displaylists/DisplayList.cpp: 22 (WebCore::DisplayList::DisplayList::shouldDumpForFlags): 23 (WebCore::DisplayList::DisplayList::asText): 24 * platform/graphics/displaylists/DisplayList.h: 25 * rendering/RenderLayerBacking.cpp: 26 (WebCore::RenderLayerBacking::setUsesDisplayListDrawing): 27 (WebCore::RenderLayerBacking::displayListAsText): 28 * rendering/RenderLayerBacking.h: 29 * testing/Internals.cpp: 30 (WebCore::Internals::setElementUsesDisplayListDrawing): 31 (WebCore::Internals::displayListForElement): 32 * testing/Internals.h: 33 * testing/Internals.idl: 34 1 35 2016-01-15 Olivier Blin <olivier.blin@softathome.com> 2 36 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r194825 r195156 55 55 class TransformationMatrix; 56 56 57 namespace DisplayList { 58 typedef unsigned AsTextFlags; 59 } 60 57 61 // Base class for animation values (also used for transitions). Here to 58 62 // represent values for properties being animated via the GraphicsLayer, … … 517 521 // pointers for the layers and timing data will be included in the returned string. 518 522 WEBCORE_EXPORT String layerTreeAsText(LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNormal) const; 523 524 // For testing. 525 WEBCORE_EXPORT virtual String displayListAsText(DisplayList::AsTextFlags) const { return String(); } 519 526 520 527 // Return an estimate of the backing store memory cost (in bytes). May be incorrect for tiled layers. -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r195142 r195156 3271 3271 } 3272 3272 3273 String GraphicsLayerCA::displayListAsText(DisplayList::AsTextFlags flags) const 3274 { 3275 if (!m_displayList) 3276 return String(); 3277 3278 return m_displayList->asText(flags); 3279 } 3280 3273 3281 void GraphicsLayerCA::setDebugBackgroundColor(const Color& color) 3274 3282 { -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r194825 r195156 208 208 WEBCORE_EXPORT virtual void setIsViewportConstrained(bool) override; 209 209 virtual bool isViewportConstrained() const override { return m_isViewportConstrained; } 210 211 WEBCORE_EXPORT virtual String displayListAsText(DisplayList::AsTextFlags) const override; 210 212 211 213 WEBCORE_EXPORT virtual double backingStoreMemoryEstimate() const override; -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp
r194814 r195156 59 59 } 60 60 61 bool DisplayList::shouldDumpForFlags(AsTextFlags flags, const Item& item) 62 { 63 switch (item.type()) { 64 case ItemType::SetState: 65 if (!(flags & AsTextFlag::IncludesPlatformOperations)) { 66 const auto& stateItem = downcast<SetState>(item); 67 // FIXME: for now, only drop the item if the only state-change flags are platform-specific. 68 if (stateItem.state().m_changeFlags == GraphicsContextState::ShouldSubpixelQuantizeFontsChange) 69 return false; 70 71 if (stateItem.state().m_changeFlags == GraphicsContextState::AntialiasedFontDilationEnabledChange) 72 return false; 73 74 if (stateItem.state().m_changeFlags == GraphicsContextState::ShouldSubpixelQuantizeFontsChange) 75 return false; 76 } 77 break; 78 #if USE(CG) 79 case ItemType::ApplyFillPattern: 80 case ItemType::ApplyStrokePattern: 81 if (!(flags & AsTextFlag::IncludesPlatformOperations)) 82 return false; 83 break; 84 #endif 85 default: 86 break; 87 } 88 return true; 89 } 90 91 String DisplayList::asText(AsTextFlags flags) const 92 { 93 TextStream stream; 94 size_t numItems = m_list.size(); 95 for (size_t i = 0; i < numItems; ++i) { 96 const auto& item = m_list[i].get(); 97 if (!shouldDumpForFlags(flags, item)) 98 continue; 99 100 TextStream::GroupScope scope(stream); 101 stream << item; 102 } 103 return stream.release(); 104 } 105 61 106 void DisplayList::dump(TextStream& ts) const 62 107 { -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.h
r194825 r195156 42 42 class Item; 43 43 44 enum AsTextFlag { 45 None = 0, 46 IncludesPlatformOperations = 1 << 0, 47 }; 48 49 typedef unsigned AsTextFlags; 50 44 51 class DisplayList { 45 52 WTF_MAKE_NONCOPYABLE(DisplayList); … … 65 72 size_t itemCount() const { return m_list.size(); } 66 73 size_t sizeInBytes() const; 74 75 String asText(AsTextFlags) const; 67 76 68 77 #if !defined(NDEBUG) || !LOG_DISABLED … … 77 86 return m_list.last().get(); 78 87 } 88 89 static bool shouldDumpForFlags(AsTextFlags, const Item&); 79 90 80 91 Vector<Ref<Item>>& list() { return m_list; } -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r194825 r195156 183 183 } 184 184 185 void RenderLayerBacking::setUsesDisplayListDrawing(bool usesDisplayListDrawing) 186 { 187 // Note that this only affects the primary layer. 188 if (usesDisplayListDrawing == m_graphicsLayer->usesDisplayListDrawing()) 189 return; 190 191 m_graphicsLayer->setUsesDisplayListDrawing(usesDisplayListDrawing); 192 if (m_graphicsLayer->drawsContent()) 193 m_graphicsLayer->setNeedsDisplay(); 194 } 195 196 String RenderLayerBacking::displayListAsText(DisplayList::AsTextFlags flags) const 197 { 198 return m_graphicsLayer->displayListAsText(flags); 199 } 200 185 201 void RenderLayerBacking::tiledBackingUsageChanged(const GraphicsLayer* layer, bool usingTiledBacking) 186 202 { -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r191680 r195156 241 241 // Return an estimate of the backing store area (in pixels) allocated by this object's GraphicsLayers. 242 242 WEBCORE_EXPORT double backingStoreMemoryEstimate() const; 243 244 // For testing only. 245 WEBCORE_EXPORT void setUsesDisplayListDrawing(bool); 246 WEBCORE_EXPORT String displayListAsText(DisplayList::AsTextFlags) const; 243 247 244 248 LayoutSize devicePixelFractionFromRenderer() const { return m_devicePixelFractionFromRenderer; } -
trunk/Source/WebCore/testing/Internals.cpp
r195154 r195156 44 44 #include "DOMStringList.h" 45 45 #include "DOMWindow.h" 46 #include "DisplayList.h" 46 47 #include "Document.h" 47 48 #include "DocumentMarker.h" … … 95 96 #include "Range.h" 96 97 #include "RenderEmbeddedObject.h" 98 #include "RenderLayerBacking.h" 97 99 #include "RenderLayerCompositor.h" 98 100 #include "RenderMenuList.h" … … 1972 1974 1973 1975 return page->nonFastScrollableRects(); 1976 } 1977 1978 void Internals::setElementUsesDisplayListDrawing(Element* element, bool usesDisplayListDrawing, ExceptionCode& ec) 1979 { 1980 Document* document = contextDocument(); 1981 if (!document || !document->renderView()) { 1982 ec = INVALID_ACCESS_ERR; 1983 return; 1984 } 1985 1986 if (!element || !element->renderer() || !element->renderer()->hasLayer()) { 1987 ec = INVALID_ACCESS_ERR; 1988 return; 1989 } 1990 1991 RenderLayer* layer = downcast<RenderLayerModelObject>(element->renderer())->layer(); 1992 if (!layer->isComposited()) { 1993 ec = INVALID_ACCESS_ERR; 1994 return; 1995 } 1996 1997 layer->backing()->setUsesDisplayListDrawing(usesDisplayListDrawing); 1998 } 1999 2000 String Internals::displayListForElement(Element* element, ExceptionCode& ec) 2001 { 2002 return displayListForElement(element, 0, ec); 2003 } 2004 2005 String Internals::displayListForElement(Element* element, unsigned flags, ExceptionCode& ec) 2006 { 2007 Document* document = contextDocument(); 2008 if (!document || !document->renderView()) { 2009 ec = INVALID_ACCESS_ERR; 2010 return String(); 2011 } 2012 2013 if (!element || !element->renderer() || !element->renderer()->hasLayer()) { 2014 ec = INVALID_ACCESS_ERR; 2015 return String(); 2016 } 2017 2018 RenderLayer* layer = downcast<RenderLayerModelObject>(element->renderer())->layer(); 2019 if (!layer->isComposited()) { 2020 ec = INVALID_ACCESS_ERR; 2021 return String(); 2022 } 2023 2024 DisplayList::AsTextFlags displayListFlags = 0; 2025 if (flags & DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS) 2026 displayListFlags |= DisplayList::AsTextFlag::IncludesPlatformOperations; 2027 2028 return layer->backing()->displayListAsText(displayListFlags); 1974 2029 } 1975 2030 -
trunk/Source/WebCore/testing/Internals.h
r194706 r195156 254 254 RefPtr<ClientRectList> nonFastScrollableRects(ExceptionCode&) const; 255 255 256 void setElementUsesDisplayListDrawing(Element*, bool usesDisplayListDrawing, ExceptionCode&); 257 258 enum { 259 // Values need to be kept in sync with Internals.idl. 260 DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1, 261 }; 262 String displayListForElement(Element*, unsigned flags, ExceptionCode&); 263 String displayListForElement(Element*, ExceptionCode&); 264 256 265 void garbageCollectDocumentResources(ExceptionCode&) const; 257 266 -
trunk/Source/WebCore/testing/Internals.idl
r194706 r195156 225 225 [RaisesException] DOMString repaintRectsAsText(); 226 226 227 // These throw if the element does not have a compositing layer. 228 [RaisesException] void setElementUsesDisplayListDrawing(Element element, boolean usesDisplayListDrawing); 229 230 // Flags for displayListForElement. 231 const unsigned short DISPLAY_LIST_INCLUDES_PLATFORM_OPERATIONS = 1; 232 [RaisesException] DOMString displayListForElement(Element element, optional unsigned short flags); 233 227 234 [RaisesException] void garbageCollectDocumentResources(); 228 235
Note: See TracChangeset
for help on using the changeset viewer.