Changeset 77546 in webkit
- Timestamp:
- Feb 3, 2011 3:38:42 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r77534 r77546 1 2011-02-03 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Change DidSetSize to take a LayerTreeContext parameter 6 https://bugs.webkit.org/show_bug.cgi?id=53724 7 8 Since SetSize can cause layout to happen, we need to pass along a layer tree context to 9 the DidSetSize message so the UI process can enter/exit accelerated compositing mode appropriately. 10 11 * Shared/LayerTreeContext.h: 12 * Shared/mac/LayerTreeContextMac.mm: 13 Add equality operators to LayerTreeContext. 14 15 * UIProcess/DrawingAreaProxy.h: 16 (WebKit::DrawingAreaProxy::didSetSize): 17 This now takes a LayerTreeContext parameter. 18 19 * UIProcess/DrawingAreaProxy.messages.in: 20 Add LayerTreeContext parameter. 21 22 * UIProcess/DrawingAreaProxyImpl.cpp: 23 Get rid of m_isInAcceleratedCompositingMode and use the current layer context instead. 24 25 (WebKit::DrawingAreaProxyImpl::paint): 26 Bail if the call to DidSetSize ended up entering accelerated compositing mode. 27 28 (WebKit::DrawingAreaProxyImpl::didSetSize): 29 If the new layer tree context is different, enter/exit accelerated compositing mode accordingly. 30 31 (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode): 32 (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode): 33 Update the layer tree context. 34 35 * UIProcess/DrawingAreaProxyImpl.h: 36 (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode): 37 Add simple getter. 38 39 * WebProcess/WebPage/DrawingAreaImpl.cpp: 40 (WebKit::DrawingAreaImpl::setSize): 41 Pass along the layer tree context. 42 1 43 2011-02-03 Anders Carlsson <andersca@apple.com> 2 44 -
trunk/Source/WebKit2/Shared/LayerTreeContext.h
r77534 r77546 51 51 }; 52 52 53 bool operator==(const LayerTreeContext&, const LayerTreeContext&); 54 55 inline bool operator!=(const LayerTreeContext& a, const LayerTreeContext& b) 56 { 57 return !(a == b); 58 } 59 53 60 }; 54 61 -
trunk/Source/WebKit2/Shared/mac/LayerTreeContextMac.mm
r77534 r77546 59 59 } 60 60 61 bool operator==(const LayerTreeContext& a, const LayerTreeContext& b) 62 { 63 return a.contextID == b.contextID; 64 } 65 61 66 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h
r77533 r77546 98 98 // FIXME: These should be pure virtual. 99 99 virtual void update(uint64_t sequenceNumber, const UpdateInfo&) { } 100 virtual void didSetSize(uint64_t sequenceNumber, const UpdateInfo& ) { }100 virtual void didSetSize(uint64_t sequenceNumber, const UpdateInfo&, const LayerTreeContext&) { } 101 101 #if USE(ACCELERATED_COMPOSITING) 102 102 virtual void enterAcceleratedCompositingMode(uint64_t sequenceNumber, const LayerTreeContext&) { } -
trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.messages.in
r77533 r77546 23 23 messages -> DrawingAreaProxy { 24 24 Update(uint64_t sequenceNumber, WebKit::UpdateInfo updateInfo) 25 DidSetSize(uint64_t sequenceNumber, WebKit::UpdateInfo updateInfo )25 DidSetSize(uint64_t sequenceNumber, WebKit::UpdateInfo updateInfo, WebKit::LayerTreeContext context) 26 26 27 27 #if USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
r77534 r77546 51 51 : DrawingAreaProxy(DrawingAreaInfo::Impl, webPageProxy) 52 52 , m_isWaitingForDidSetSize(false) 53 , m_isInAcceleratedCompositingMode(false)54 53 , m_lastDidSetSizeSequenceNumber(0) 55 54 { … … 67 66 return; 68 67 69 ASSERT(! m_isInAcceleratedCompositingMode);68 ASSERT(!isInAcceleratedCompositingMode()); 70 69 71 70 if (m_isWaitingForDidSetSize) { … … 80 79 } 81 80 81 // Dispatching DidSetSize could change the compositing mode, return if that happens. 82 if (isInAcceleratedCompositingMode()) 83 return; 84 82 85 m_backingStore->paint(context, rect); 83 86 unpaintedRegion.subtract(IntRect(IntPoint(), m_backingStore->size())); … … 142 145 } 143 146 144 void DrawingAreaProxyImpl::didSetSize(uint64_t sequenceNumber, const UpdateInfo& updateInfo )147 void DrawingAreaProxyImpl::didSetSize(uint64_t sequenceNumber, const UpdateInfo& updateInfo, const LayerTreeContext& layerTreeContext) 145 148 { 146 149 ASSERT(sequenceNumber > m_lastDidSetSizeSequenceNumber); … … 153 156 sendSetSize(); 154 157 155 if (m_isInAcceleratedCompositingMode) { 158 if (layerTreeContext != m_layerTreeContext) { 159 if (!m_layerTreeContext.isEmpty()) { 160 exitAcceleratedCompositingMode(); 161 ASSERT(m_layerTreeContext.isEmpty()); 162 } 163 164 if (!layerTreeContext.isEmpty()) { 165 enterAcceleratedCompositingMode(layerTreeContext); 166 ASSERT(layerTreeContext == m_layerTreeContext); 167 } 168 } 169 170 if (isInAcceleratedCompositingMode()) { 156 171 ASSERT(!m_backingStore); 157 172 return; … … 180 195 void DrawingAreaProxyImpl::incorporateUpdate(const UpdateInfo& updateInfo) 181 196 { 182 ASSERT(! m_isInAcceleratedCompositingMode);197 ASSERT(!isInAcceleratedCompositingMode()); 183 198 184 199 if (updateInfo.updateRectBounds.isEmpty()) … … 216 231 void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext) 217 232 { 218 ASSERT(!m_isInAcceleratedCompositingMode); 219 m_isInAcceleratedCompositingMode = true; 220 233 ASSERT(!isInAcceleratedCompositingMode()); 234 221 235 m_backingStore = nullptr; 236 m_layerTreeContext = layerTreeContext; 222 237 m_webPageProxy->enterAcceleratedCompositingMode(layerTreeContext); 223 238 } … … 225 240 void DrawingAreaProxyImpl::exitAcceleratedCompositingMode() 226 241 { 227 ASSERT( m_isInAcceleratedCompositingMode);228 m_isInAcceleratedCompositingMode = false; 229 242 ASSERT(isInAcceleratedCompositingMode()); 243 244 m_layerTreeContext = LayerTreeContext(); 230 245 m_webPageProxy->exitAcceleratedCompositingMode(); 231 246 } -
trunk/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
r77534 r77546 29 29 #include "BackingStore.h" 30 30 #include "DrawingAreaProxy.h" 31 #include "LayerTreeContext.h" 31 32 32 33 namespace WebKit { … … 56 57 // CoreIPC message handlers 57 58 virtual void update(uint64_t sequenceNumber, const UpdateInfo&); 58 virtual void didSetSize(uint64_t sequenceNumber, const UpdateInfo& );59 virtual void didSetSize(uint64_t sequenceNumber, const UpdateInfo&, const LayerTreeContext&); 59 60 virtual void enterAcceleratedCompositingMode(uint64_t sequenceNumber, const LayerTreeContext&); 60 61 virtual void exitAcceleratedCompositingMode(uint64_t sequenceNumber); … … 66 67 void exitAcceleratedCompositingMode(); 67 68 69 bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); } 70 71 // The current layer tree context. 72 LayerTreeContext m_layerTreeContext; 73 68 74 // Whether we've sent a SetSize message and are now waiting for a DidSetSize message. 69 75 // Used to throttle SetSize messages so we don't send them faster than the Web process can handle. 70 76 bool m_isWaitingForDidSetSize; 71 72 // Whether we're in accelerated compositing mode or not.73 bool m_isInAcceleratedCompositingMode;74 77 75 78 // The sequence number of the last DidSetSize message -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
r77533 r77546 184 184 185 185 UpdateInfo updateInfo; 186 LayerTreeContext layerTreeContext; 187 188 if (m_layerTreeHost) 189 layerTreeContext = m_layerTreeHost->layerTreeContext(); 186 190 187 191 if (m_isPaintingSuspended || m_layerTreeHost) { … … 190 194 display(updateInfo); 191 195 192 m_webPage->send(Messages::DrawingAreaProxy::DidSetSize(generateSequenceNumber(), updateInfo ));196 m_webPage->send(Messages::DrawingAreaProxy::DidSetSize(generateSequenceNumber(), updateInfo, layerTreeContext)); 193 197 194 198 m_inSetSize = false;
Note: See TracChangeset
for help on using the changeset viewer.