Changeset 182985 in webkit
- Timestamp:
- Apr 18, 2015 12:39:13 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r182974 r182985 1 2015-04-18 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r181656): Animated tiled layers are missing content 4 https://bugs.webkit.org/show_bug.cgi?id=143911 5 rdar://problem/20596328 6 7 Reviewed by Darin Adler. 8 9 Test that animates a tiled layer, and checks that layer flushes occur while the 10 animation is running. 11 12 * compositing/animation/animation-backing-expected.txt: Added. 13 * compositing/animation/animation-backing.html: Added. 14 1 15 2015-04-17 Bem Jones-Bey <bjonesbe@adobe.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r182974 r182985 1 2015-04-18 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r181656): Animated tiled layers are missing content 4 https://bugs.webkit.org/show_bug.cgi?id=143911 5 rdar://problem/20596328 6 7 Reviewed by Darin Adler. 8 9 After r181656, all requestAnimationFrame was falling back to timers, and not 10 using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr 11 fumble. As a result, GraphicsLayerUpdater (which updates tiled layers during 12 animations) was failing to do any updates. 13 14 Replace this confusing Optional<> code with simpler code that just forces the 15 clients to make a DisplayRefreshMonitor if they can, first asking 16 ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor(). 17 18 Make lots of things into references, and use C++11 initialization in some places. 19 20 Add Internals API to allow a test to get the number of layer flushes that have 21 occurred. 22 23 * dom/ScriptedAnimationController.cpp: 24 (WebCore::ScriptedAnimationController::ScriptedAnimationController): 25 (WebCore::ScriptedAnimationController::windowScreenDidChange): 26 (WebCore::ScriptedAnimationController::scheduleAnimation): 27 (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor): 28 * dom/ScriptedAnimationController.h: 29 * page/ChromeClient.h: 30 * platform/graphics/DisplayRefreshMonitor.cpp: 31 (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): 32 (WebCore::DisplayRefreshMonitor::create): 33 (WebCore::DisplayRefreshMonitor::addClient): 34 (WebCore::DisplayRefreshMonitor::removeClient): 35 (WebCore::DisplayRefreshMonitor::displayDidRefresh): 36 * platform/graphics/DisplayRefreshMonitor.h: 37 * platform/graphics/DisplayRefreshMonitorClient.cpp: 38 (WebCore::DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient): 39 * platform/graphics/DisplayRefreshMonitorClient.h: 40 * platform/graphics/DisplayRefreshMonitorManager.cpp: 41 (WebCore::DisplayRefreshMonitorManager::createMonitorForClient): 42 (WebCore::DisplayRefreshMonitorManager::registerClient): 43 (WebCore::DisplayRefreshMonitorManager::unregisterClient): 44 (WebCore::DisplayRefreshMonitorManager::scheduleAnimation): 45 (WebCore::DisplayRefreshMonitorManager::displayDidRefresh): 46 (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange): 47 * platform/graphics/DisplayRefreshMonitorManager.h: 48 * platform/graphics/GraphicsLayerUpdater.cpp: 49 (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater): 50 (WebCore::GraphicsLayerUpdater::scheduleUpdate): 51 (WebCore::GraphicsLayerUpdater::screenDidChange): 52 (WebCore::GraphicsLayerUpdater::displayRefreshFired): 53 (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor): 54 * platform/graphics/GraphicsLayerUpdater.h: 55 * rendering/RenderLayerCompositor.cpp: 56 (WebCore::RenderLayerCompositor::RenderLayerCompositor): 57 (WebCore::RenderLayerCompositor::flushPendingLayerChanges): 58 (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh): 59 (WebCore::RenderLayerCompositor::flushLayersSoon): 60 (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor): 61 (WebCore::RenderLayerCompositor::startTrackingLayerFlushes): 62 (WebCore::RenderLayerCompositor::layerFlushCount): 63 * rendering/RenderLayerCompositor.h: 64 * testing/Internals.cpp: 65 (WebCore::Internals::startTrackingLayerFlushes): 66 (WebCore::Internals::layerFlushCount): 67 * testing/Internals.h: 68 * testing/Internals.idl: 69 1 70 2015-04-17 Bem Jones-Bey <bjonesbe@adobe.com> 2 71 -
trunk/Source/WebCore/dom/ScriptedAnimationController.cpp
r181656 r182985 52 52 ScriptedAnimationController::ScriptedAnimationController(Document* document, PlatformDisplayID displayID) 53 53 : m_document(document) 54 , m_nextCallbackId(0)55 , m_suspendCount(0)56 54 #if USE(REQUEST_ANIMATION_FRAME_TIMER) 57 55 , m_animationTimer(*this, &ScriptedAnimationController::animationTimerFired) 58 , m_lastAnimationFrameTimeMonotonic(0)59 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)60 , m_isUsingTimer(false)61 , m_isThrottled(false)62 #endif63 56 #endif 64 57 { … … 174 167 return; 175 168 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 176 DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, this);169 DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this); 177 170 #else 178 171 UNUSED_PARAM(displayID); … … 188 181 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 189 182 if (!m_isUsingTimer && !m_isThrottled) { 190 if (DisplayRefreshMonitorManager::sharedManager().scheduleAnimation( this))183 if (DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this)) 191 184 return; 192 185 … … 227 220 228 221 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 229 Optional<RefPtr<DisplayRefreshMonitor>> ScriptedAnimationController::createDisplayRefreshMonitor(PlatformDisplayID displayID) const222 RefPtr<DisplayRefreshMonitor> ScriptedAnimationController::createDisplayRefreshMonitor(PlatformDisplayID displayID) const 230 223 { 231 224 if (!m_document->page()) 232 return Optional<RefPtr<DisplayRefreshMonitor>>(nullptr); 233 return Optional<RefPtr<DisplayRefreshMonitor>>(m_document->page()->chrome().client().createDisplayRefreshMonitor(displayID)); 234 } 235 #endif 236 237 238 } 239 240 #endif 225 return nullptr; 226 227 if (auto monitor = m_document->page()->chrome().client().createDisplayRefreshMonitor(displayID)) 228 return monitor; 229 230 return DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor(displayID); 231 } 232 #endif 233 234 235 } 236 237 #endif -
trunk/Source/WebCore/dom/ScriptedAnimationController.h
r181656 r182985 79 79 80 80 Document* m_document; 81 CallbackId m_nextCallbackId ;82 int m_suspendCount ;81 CallbackId m_nextCallbackId { 0 }; 82 int m_suspendCount { 0 }; 83 83 84 84 void scheduleAnimation(); … … 87 87 void animationTimerFired(); 88 88 Timer m_animationTimer; 89 double m_lastAnimationFrameTimeMonotonic ;89 double m_lastAnimationFrameTimeMonotonic { 0 }; 90 90 91 91 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 92 92 // Override for DisplayRefreshMonitorClient 93 93 virtual void displayRefreshFired(double timestamp) override; 94 virtual Optional<RefPtr<DisplayRefreshMonitor>> createDisplayRefreshMonitor(PlatformDisplayID) const override;94 virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override; 95 95 96 bool m_isUsingTimer ;97 bool m_isThrottled ;96 bool m_isUsingTimer { false }; 97 bool m_isThrottled { false }; 98 98 #endif 99 99 #endif -
trunk/Source/WebCore/page/ChromeClient.h
r182860 r182985 287 287 288 288 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 289 virtual Optional<RefPtr<DisplayRefreshMonitor>> createDisplayRefreshMonitor(PlatformDisplayID) const { return Nullopt; }289 virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const { return nullptr; } 290 290 #endif 291 291 -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp
r182364 r182985 36 36 namespace WebCore { 37 37 38 RefPtr<DisplayRefreshMonitor> DisplayRefreshMonitor::create (DisplayRefreshMonitorClient* client)38 RefPtr<DisplayRefreshMonitor> DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor(PlatformDisplayID displayID) 39 39 { 40 PlatformDisplayID displayID = client->displayID();41 42 if (Optional<RefPtr<DisplayRefreshMonitor>> monitor = client->createDisplayRefreshMonitor(displayID))43 return monitor.value();44 45 // If ChromeClient returned Nullopt, we'll make one of the default type.46 47 40 #if PLATFORM(MAC) 48 41 return DisplayRefreshMonitorMac::create(displayID); … … 51 44 return DisplayRefreshMonitorIOS::create(displayID); 52 45 #endif 46 return nullptr; 47 } 48 49 RefPtr<DisplayRefreshMonitor> DisplayRefreshMonitor::create(DisplayRefreshMonitorClient& client) 50 { 51 return client.createDisplayRefreshMonitor(client.displayID()); 53 52 } 54 53 … … 74 73 } 75 74 76 void DisplayRefreshMonitor::addClient(DisplayRefreshMonitorClient *client)75 void DisplayRefreshMonitor::addClient(DisplayRefreshMonitorClient& client) 77 76 { 78 m_clients.add( client);77 m_clients.add(&client); 79 78 } 80 79 81 bool DisplayRefreshMonitor::removeClient(DisplayRefreshMonitorClient *client)80 bool DisplayRefreshMonitor::removeClient(DisplayRefreshMonitorClient& client) 82 81 { 83 82 if (m_clientsToBeNotified) 84 m_clientsToBeNotified->remove( client);85 return m_clients.remove( client);83 m_clientsToBeNotified->remove(&client); 84 return m_clients.remove(&client); 86 85 } 87 86 … … 127 126 } 128 127 129 DisplayRefreshMonitorManager::sharedManager().displayDidRefresh( this);128 DisplayRefreshMonitorManager::sharedManager().displayDidRefresh(*this); 130 129 } 131 130 -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h
r181656 r182985 42 42 class DisplayRefreshMonitor : public RefCounted<DisplayRefreshMonitor> { 43 43 public: 44 static RefPtr<DisplayRefreshMonitor> create(DisplayRefreshMonitorClient *);44 static RefPtr<DisplayRefreshMonitor> create(DisplayRefreshMonitorClient&); 45 45 WEBCORE_EXPORT virtual ~DisplayRefreshMonitor(); 46 46 … … 51 51 52 52 bool hasClients() const { return m_clients.size(); } 53 void addClient(DisplayRefreshMonitorClient *);54 bool removeClient(DisplayRefreshMonitorClient *);53 void addClient(DisplayRefreshMonitorClient&); 54 bool removeClient(DisplayRefreshMonitorClient&); 55 55 56 56 PlatformDisplayID displayID() const { return m_displayID; } … … 74 74 75 75 Mutex& mutex() { return m_mutex; } 76 77 static RefPtr<DisplayRefreshMonitor> createDefaultDisplayRefreshMonitor(PlatformDisplayID); 76 78 77 79 protected: -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.cpp
r169299 r182985 42 42 DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient() 43 43 { 44 DisplayRefreshMonitorManager::sharedManager().unregisterClient( this);44 DisplayRefreshMonitorManager::sharedManager().unregisterClient(*this); 45 45 } 46 46 -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h
r181656 r182985 45 45 virtual void displayRefreshFired(double timestamp) = 0; 46 46 47 // Returning nullopt indicates that WebCore should create whatever DisplayRefreshMonitor it deems 48 // most appropriate for the current platform. Returning nullptr indicates that we should not try to 49 // create a DisplayRefreshMonitor at all (and should instead fall back to using a timer). 50 virtual Optional<RefPtr<DisplayRefreshMonitor>> createDisplayRefreshMonitor(PlatformDisplayID) const = 0; 47 virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const = 0; 51 48 52 49 PlatformDisplayID displayID() const { return m_displayID; } -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp
r181656 r182985 45 45 } 46 46 47 DisplayRefreshMonitor* DisplayRefreshMonitorManager::createMonitorForClient(DisplayRefreshMonitorClient *client)47 DisplayRefreshMonitor* DisplayRefreshMonitorManager::createMonitorForClient(DisplayRefreshMonitorClient& client) 48 48 { 49 PlatformDisplayID clientDisplayID = client ->displayID();49 PlatformDisplayID clientDisplayID = client.displayID(); 50 50 for (const RefPtr<DisplayRefreshMonitor>& monitor : m_monitors) { 51 51 if (monitor->displayID() != clientDisplayID) … … 58 58 if (!monitor) 59 59 return nullptr; 60 60 61 monitor->addClient(client); 61 62 DisplayRefreshMonitor* result = monitor.get(); … … 64 65 } 65 66 66 void DisplayRefreshMonitorManager::registerClient(DisplayRefreshMonitorClient *client)67 void DisplayRefreshMonitorManager::registerClient(DisplayRefreshMonitorClient& client) 67 68 { 68 if (!client ->hasDisplayID())69 if (!client.hasDisplayID()) 69 70 return; 70 71 … … 72 73 } 73 74 74 void DisplayRefreshMonitorManager::unregisterClient(DisplayRefreshMonitorClient *client)75 void DisplayRefreshMonitorManager::unregisterClient(DisplayRefreshMonitorClient& client) 75 76 { 76 if (!client ->hasDisplayID())77 if (!client.hasDisplayID()) 77 78 return; 78 79 79 PlatformDisplayID clientDisplayID = client ->displayID();80 PlatformDisplayID clientDisplayID = client.displayID(); 80 81 for (size_t i = 0; i < m_monitors.size(); ++i) { 81 82 RefPtr<DisplayRefreshMonitor> monitor = m_monitors[i]; … … 90 91 } 91 92 92 bool DisplayRefreshMonitorManager::scheduleAnimation(DisplayRefreshMonitorClient *client)93 bool DisplayRefreshMonitorManager::scheduleAnimation(DisplayRefreshMonitorClient& client) 93 94 { 94 if (!client ->hasDisplayID())95 if (!client.hasDisplayID()) 95 96 return false; 96 97 … … 99 100 return false; 100 101 101 client ->setIsScheduled(true);102 client.setIsScheduled(true); 102 103 return monitor->requestRefreshCallback(); 103 104 } 104 105 105 void DisplayRefreshMonitorManager::displayDidRefresh(DisplayRefreshMonitor *monitor)106 void DisplayRefreshMonitorManager::displayDidRefresh(DisplayRefreshMonitor& monitor) 106 107 { 107 if (!monitor ->shouldBeTerminated())108 if (!monitor.shouldBeTerminated()) 108 109 return; 109 110 110 size_t monitorIndex = m_monitors.find( monitor);111 size_t monitorIndex = m_monitors.find(&monitor); 111 112 ASSERT(monitorIndex != notFound); 112 113 m_monitors.remove(monitorIndex); 113 114 } 114 115 115 void DisplayRefreshMonitorManager::windowScreenDidChange(PlatformDisplayID displayID, DisplayRefreshMonitorClient *client)116 void DisplayRefreshMonitorManager::windowScreenDidChange(PlatformDisplayID displayID, DisplayRefreshMonitorClient& client) 116 117 { 117 if (client ->hasDisplayID() && client->displayID() == displayID)118 if (client.hasDisplayID() && client.displayID() == displayID) 118 119 return; 119 120 120 121 unregisterClient(client); 121 client ->setDisplayID(displayID);122 client.setDisplayID(displayID); 122 123 registerClient(client); 123 if (client ->isScheduled())124 if (client.isScheduled()) 124 125 scheduleAnimation(client); 125 126 } -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h
r181656 r182985 42 42 static DisplayRefreshMonitorManager& sharedManager(); 43 43 44 void registerClient(DisplayRefreshMonitorClient *);45 void unregisterClient(DisplayRefreshMonitorClient *);44 void registerClient(DisplayRefreshMonitorClient&); 45 void unregisterClient(DisplayRefreshMonitorClient&); 46 46 47 bool scheduleAnimation(DisplayRefreshMonitorClient *);48 void windowScreenDidChange(PlatformDisplayID, DisplayRefreshMonitorClient *);47 bool scheduleAnimation(DisplayRefreshMonitorClient&); 48 void windowScreenDidChange(PlatformDisplayID, DisplayRefreshMonitorClient&); 49 49 50 50 private: 51 51 friend class DisplayRefreshMonitor; 52 void displayDidRefresh(DisplayRefreshMonitor *);52 void displayDidRefresh(DisplayRefreshMonitor&); 53 53 54 54 DisplayRefreshMonitorManager() { } 55 55 virtual ~DisplayRefreshMonitorManager(); 56 56 57 DisplayRefreshMonitor* createMonitorForClient(DisplayRefreshMonitorClient *);57 DisplayRefreshMonitor* createMonitorForClient(DisplayRefreshMonitorClient&); 58 58 59 59 Vector<RefPtr<DisplayRefreshMonitor>> m_monitors; -
trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp
r181656 r182985 32 32 namespace WebCore { 33 33 34 GraphicsLayerUpdater::GraphicsLayerUpdater(GraphicsLayerUpdaterClient *client, PlatformDisplayID displayID)34 GraphicsLayerUpdater::GraphicsLayerUpdater(GraphicsLayerUpdaterClient& client, PlatformDisplayID displayID) 35 35 : m_client(client) 36 , m_scheduled(false)37 36 { 38 37 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 39 DisplayRefreshMonitorManager::sharedManager().registerClient( this);40 DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, this);41 DisplayRefreshMonitorManager::sharedManager().scheduleAnimation( this);38 DisplayRefreshMonitorManager::sharedManager().registerClient(*this); 39 DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this); 40 DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this); 42 41 #else 43 42 UNUSED_PARAM(displayID); … … 56 55 57 56 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 58 DisplayRefreshMonitorManager::sharedManager().scheduleAnimation( this);57 DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this); 59 58 #endif 60 59 m_scheduled = true; … … 64 63 { 65 64 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 66 DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, this);65 DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this); 67 66 #else 68 67 UNUSED_PARAM(displayID); … … 76 75 m_scheduled = false; 77 76 78 if (m_client) 79 m_client->flushLayersSoon(this); 77 m_client.flushLayersSoon(*this); 80 78 } 81 79 #endif 82 80 83 81 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 84 Optional<RefPtr<DisplayRefreshMonitor>> GraphicsLayerUpdater::createDisplayRefreshMonitor(PlatformDisplayID displayID) const82 RefPtr<DisplayRefreshMonitor> GraphicsLayerUpdater::createDisplayRefreshMonitor(PlatformDisplayID displayID) const 85 83 { 86 if (!m_client) 87 return Optional<RefPtr<DisplayRefreshMonitor>>(nullptr); 88 return m_client->createDisplayRefreshMonitor(displayID); 84 return m_client.createDisplayRefreshMonitor(displayID); 89 85 } 90 86 #endif -
trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h
r181656 r182985 37 37 public: 38 38 virtual ~GraphicsLayerUpdaterClient() { } 39 virtual void flushLayersSoon(GraphicsLayerUpdater *) = 0;39 virtual void flushLayersSoon(GraphicsLayerUpdater&) = 0; 40 40 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 41 virtual Optional<RefPtr<DisplayRefreshMonitor>> createDisplayRefreshMonitor(PlatformDisplayID) const = 0;41 virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const = 0; 42 42 #endif 43 43 }; … … 49 49 { 50 50 public: 51 GraphicsLayerUpdater(GraphicsLayerUpdaterClient *, PlatformDisplayID);51 GraphicsLayerUpdater(GraphicsLayerUpdaterClient&, PlatformDisplayID); 52 52 virtual ~GraphicsLayerUpdater(); 53 53 … … 56 56 57 57 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 58 virtual Optional<RefPtr<DisplayRefreshMonitor>> createDisplayRefreshMonitor(PlatformDisplayID) const override;58 virtual RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override; 59 59 #endif 60 60 … … 64 64 #endif 65 65 66 GraphicsLayerUpdaterClient *m_client;67 bool m_scheduled ;66 GraphicsLayerUpdaterClient& m_client; 67 bool m_scheduled { false }; 68 68 }; 69 69 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r182809 r182985 281 281 , m_hasAcceleratedCompositing(true) 282 282 , m_compositingTriggers(static_cast<ChromeClient::CompositingTriggerFlags>(ChromeClient::AllTriggers)) 283 , m_compositedLayerCount(0)284 283 , m_showDebugBorders(false) 285 284 , m_showRepaintCounter(false) … … 294 293 , m_subframeScrollLayersNeedReattach(false) 295 294 , m_isTrackingRepaints(false) 296 , m_layersWithTiledBackingCount(0)297 295 , m_rootLayerAttachment(RootLayerUnattached) 298 296 , m_layerFlushTimer(*this, &RenderLayerCompositor::layerFlushTimerFired) … … 301 299 , m_hasPendingLayerFlush(false) 302 300 , m_paintRelatedMilestonesTimer(*this, &RenderLayerCompositor::paintRelatedMilestonesTimerFired) 303 #if !LOG_DISABLED304 , m_rootLayerUpdateCount(0)305 , m_obligateCompositedLayerCount(0)306 , m_secondaryCompositedLayerCount(0)307 , m_obligatoryBackingStoreBytes(0)308 , m_secondaryBackingStoreBytes(0)309 #endif310 301 { 311 302 } … … 492 483 #endif 493 484 485 ++m_layerFlushCount; 494 486 startLayerFlushTimerIfNeeded(); 495 487 } … … 609 601 displayID = page->chrome().displayID(); 610 602 611 m_layerUpdater = std::make_unique<GraphicsLayerUpdater>( this, displayID);603 m_layerUpdater = std::make_unique<GraphicsLayerUpdater>(*this, displayID); 612 604 } 613 605 … … 615 607 } 616 608 617 void RenderLayerCompositor::flushLayersSoon(GraphicsLayerUpdater *)609 void RenderLayerCompositor::flushLayersSoon(GraphicsLayerUpdater&) 618 610 { 619 611 scheduleLayerFlush(true); … … 4172 4164 4173 4165 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 4174 Optional<RefPtr<DisplayRefreshMonitor>> RenderLayerCompositor::createDisplayRefreshMonitor(PlatformDisplayID displayID) const4166 RefPtr<DisplayRefreshMonitor> RenderLayerCompositor::createDisplayRefreshMonitor(PlatformDisplayID displayID) const 4175 4167 { 4176 4168 Frame& frame = m_renderView.frameView().frame(); 4177 4169 Page* page = frame.page(); 4178 4170 if (!page) 4179 return Optional<RefPtr<DisplayRefreshMonitor>>(nullptr); 4180 4181 return Optional<RefPtr<DisplayRefreshMonitor>>(page->chrome().client().createDisplayRefreshMonitor(displayID)); 4182 } 4183 #endif 4171 return nullptr; 4172 4173 if (auto monitor = page->chrome().client().createDisplayRefreshMonitor(displayID)) 4174 return monitor; 4175 4176 return DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor(displayID); 4177 } 4178 #endif 4179 4180 void RenderLayerCompositor::startTrackingLayerFlushes() 4181 { 4182 m_layerFlushCount = 0; 4183 } 4184 4185 unsigned RenderLayerCompositor::layerFlushCount() const 4186 { 4187 return m_layerFlushCount; 4188 } 4184 4189 4185 4190 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r182809 r182985 308 308 Color rootExtendedBackgroundColor() const { return m_rootExtendedBackgroundColor; } 309 309 310 // For testing. 311 WEBCORE_EXPORT void startTrackingLayerFlushes(); 312 WEBCORE_EXPORT unsigned layerFlushCount() const; 313 310 314 private: 311 315 class OverlapMap; … … 320 324 321 325 // GraphicsLayerUpdaterClient implementation 322 virtual void flushLayersSoon(GraphicsLayerUpdater *) override;326 virtual void flushLayersSoon(GraphicsLayerUpdater&) override; 323 327 324 328 // Whether the given RL needs a compositing layer. … … 400 404 401 405 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 402 Optional<RefPtr<DisplayRefreshMonitor>> createDisplayRefreshMonitor(PlatformDisplayID) const override;406 RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override; 403 407 #endif 404 408 … … 474 478 ChromeClient::CompositingTriggerFlags m_compositingTriggers; 475 479 476 int m_compositedLayerCount;477 480 bool m_showDebugBorders; 478 481 bool m_showRepaintCounter; … … 493 496 bool m_isTrackingRepaints; // Used for testing. 494 497 495 unsigned m_layersWithTiledBackingCount; 498 int m_compositedLayerCount { 0 }; 499 unsigned m_layersWithTiledBackingCount { 0 }; 500 unsigned m_layerFlushCount { 0 }; 496 501 497 502 RootLayerAttachment m_rootLayerAttachment; … … 534 539 535 540 #if !LOG_DISABLED 536 int m_rootLayerUpdateCount ;537 int m_obligateCompositedLayerCount ; // count of layer that have to be composited.538 int m_secondaryCompositedLayerCount ; // count of layers that have to be composited because of stacking or overlap.539 double m_obligatoryBackingStoreBytes ;540 double m_secondaryBackingStoreBytes ;541 int m_rootLayerUpdateCount { 0 }; 542 int m_obligateCompositedLayerCount { 0 }; // count of layer that have to be composited. 543 int m_secondaryCompositedLayerCount { 0 }; // count of layers that have to be composited because of stacking or overlap. 544 double m_obligatoryBackingStoreBytes { 0 }; 545 double m_secondaryBackingStoreBytes { 0 }; 541 546 #endif 542 547 -
trunk/Source/WebCore/testing/Internals.cpp
r182449 r182985 91 91 #include "Range.h" 92 92 #include "RenderEmbeddedObject.h" 93 #include "RenderLayerCompositor.h" 93 94 #include "RenderMenuList.h" 94 95 #include "RenderTreeAsText.h" … … 2065 2066 FrameView* frameView = document->view(); 2066 2067 frameView->setTracksRepaints(false); 2068 } 2069 2070 void Internals::startTrackingLayerFlushes(ExceptionCode& ec) 2071 { 2072 Document* document = contextDocument(); 2073 if (!document || !document->renderView()) { 2074 ec = INVALID_ACCESS_ERR; 2075 return; 2076 } 2077 2078 document->renderView()->compositor().startTrackingLayerFlushes(); 2079 } 2080 2081 unsigned long Internals::layerFlushCount(ExceptionCode& ec) 2082 { 2083 Document* document = contextDocument(); 2084 if (!document || !document->renderView()) { 2085 ec = INVALID_ACCESS_ERR; 2086 return 0; 2087 } 2088 2089 return document->renderView()->compositor().layerFlushCount(); 2067 2090 } 2068 2091 -
trunk/Source/WebCore/testing/Internals.h
r182351 r182985 295 295 void startTrackingRepaints(ExceptionCode&); 296 296 void stopTrackingRepaints(ExceptionCode&); 297 298 void startTrackingLayerFlushes(ExceptionCode&); 299 unsigned long layerFlushCount(ExceptionCode&); 300 297 301 void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(ExceptionCode&); 298 302 void updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*, ExceptionCode&); -
trunk/Source/WebCore/testing/Internals.idl
r182351 r182985 272 272 [RaisesException] void stopTrackingRepaints(); 273 273 274 [RaisesException] void startTrackingLayerFlushes(); 275 [RaisesException] unsigned long layerFlushCount(); 276 274 277 // Query if a timer is currently throttled, to debug timer throttling. 275 278 [RaisesException] boolean isTimerThrottled(long timerHandle); -
trunk/Source/WebKit2/ChangeLog
r182984 r182985 1 2015-04-18 Simon Fraser <simon.fraser@apple.com> 2 3 REGRESSION (r181656): Animated tiled layers are missing content 4 https://bugs.webkit.org/show_bug.cgi?id=143911 5 rdar://problem/20596328 6 7 Reviewed by Darin Adler. 8 9 After r181656, all requestAnimationFrame was falling back to timers, and not 10 using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr 11 fumble. 12 13 Replace this confusing Optional<> code with simpler code that just forces the 14 clients to make a DisplayRefreshMonitor if they can, first asking 15 ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor(). 16 17 Make lots of things into references, and use C++11 initialization in some places. 18 19 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 20 (WebKit::WebChromeClient::createDisplayRefreshMonitor): 21 * WebProcess/WebCoreSupport/WebChromeClient.h: 22 1 23 2015-04-18 Dan Bernstein <mitz@apple.com> 2 24 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r182860 r182985 851 851 852 852 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 853 Optional<RefPtr<WebCore::DisplayRefreshMonitor>> WebChromeClient::createDisplayRefreshMonitor(PlatformDisplayID displayID) const854 { 855 return Optional<RefPtr<WebCore::DisplayRefreshMonitor>>(m_page->drawingArea()->createDisplayRefreshMonitor(displayID));853 RefPtr<WebCore::DisplayRefreshMonitor> WebChromeClient::createDisplayRefreshMonitor(PlatformDisplayID displayID) const 854 { 855 return m_page->drawingArea()->createDisplayRefreshMonitor(displayID); 856 856 } 857 857 #endif -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r182860 r182985 218 218 219 219 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 220 virtual Optional<RefPtr<WebCore::DisplayRefreshMonitor>> createDisplayRefreshMonitor(PlatformDisplayID) const override;220 virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const override; 221 221 #endif 222 222 -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.cpp
r179409 r182985 97 97 98 98 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 99 PassRefPtr<WebCore::DisplayRefreshMonitor> DrawingArea::createDisplayRefreshMonitor(PlatformDisplayID)99 RefPtr<WebCore::DisplayRefreshMonitor> DrawingArea::createDisplayRefreshMonitor(PlatformDisplayID) 100 100 { 101 101 return nullptr; -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
r180924 r182985 107 107 108 108 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 109 virtual PassRefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID);109 virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID); 110 110 #endif 111 111 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
r177104 r182985 72 72 virtual void addTransactionCallbackID(uint64_t callbackID) override; 73 73 74 virtual PassRefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) override;74 virtual RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) override; 75 75 void willDestroyDisplayRefreshMonitor(WebCore::DisplayRefreshMonitor*); 76 76 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
r180031 r182985 109 109 } 110 110 111 PassRefPtr<DisplayRefreshMonitor> RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor(PlatformDisplayID displayID)111 RefPtr<DisplayRefreshMonitor> RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor(PlatformDisplayID displayID) 112 112 { 113 113 RefPtr<RemoteLayerTreeDisplayRefreshMonitor> monitor = RemoteLayerTreeDisplayRefreshMonitor::create(displayID, *this);
Note: See TracChangeset
for help on using the changeset viewer.