| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "CCSingleThreadProxy.h" | 7 #include "CCSingleThreadProxy.h" |
| 8 | 8 |
| 9 #include "CCDrawQuad.h" | 9 #include "CCDrawQuad.h" |
| 10 #include "CCGraphicsContext.h" | 10 #include "CCGraphicsContext.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 220 |
| 221 bool CCSingleThreadProxy::commitRequested() const | 221 bool CCSingleThreadProxy::commitRequested() const |
| 222 { | 222 { |
| 223 return false; | 223 return false; |
| 224 } | 224 } |
| 225 | 225 |
| 226 void CCSingleThreadProxy::didAddAnimation() | 226 void CCSingleThreadProxy::didAddAnimation() |
| 227 { | 227 { |
| 228 } | 228 } |
| 229 | 229 |
| 230 size_t CCSingleThreadProxy::maxPartialTextureUpdates() const |
| 231 { |
| 232 return std::numeric_limits<size_t>::max(); |
| 233 } |
| 234 |
| 230 void CCSingleThreadProxy::stop() | 235 void CCSingleThreadProxy::stop() |
| 231 { | 236 { |
| 232 TRACE_EVENT0("cc", "CCSingleThreadProxy::stop"); | 237 TRACE_EVENT0("cc", "CCSingleThreadProxy::stop"); |
| 233 ASSERT(CCProxy::isMainThread()); | 238 ASSERT(CCProxy::isMainThread()); |
| 234 { | 239 { |
| 235 DebugScopedSetMainThreadBlocked mainThreadBlocked; | 240 DebugScopedSetMainThreadBlocked mainThreadBlocked; |
| 236 DebugScopedSetImplThread impl; | 241 DebugScopedSetImplThread impl; |
| 237 | 242 |
| 238 if (!m_layerTreeHostImpl->contentsTexturesPurged()) | 243 if (!m_layerTreeHostImpl->contentsTexturesPurged()) |
| 239 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostI
mpl->resourceProvider()); | 244 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostI
mpl->resourceProvider()); |
| 240 m_layerTreeHostImpl.clear(); | 245 m_layerTreeHostImpl.clear(); |
| 241 } | 246 } |
| 242 m_layerTreeHost = 0; | 247 m_layerTreeHost = 0; |
| 243 } | 248 } |
| 244 | 249 |
| 250 void CCSingleThreadProxy::setNeedsRedrawOnImplThread() |
| 251 { |
| 252 m_layerTreeHost->scheduleComposite(); |
| 253 } |
| 254 |
| 255 void CCSingleThreadProxy::setNeedsCommitOnImplThread() |
| 256 { |
| 257 m_layerTreeHost->scheduleComposite(); |
| 258 } |
| 259 |
| 245 void CCSingleThreadProxy::postAnimationEventsToMainThreadOnImplThread(PassOwnPtr
<CCAnimationEventsVector> events, double wallClockTime) | 260 void CCSingleThreadProxy::postAnimationEventsToMainThreadOnImplThread(PassOwnPtr
<CCAnimationEventsVector> events, double wallClockTime) |
| 246 { | 261 { |
| 247 ASSERT(CCProxy::isImplThread()); | 262 ASSERT(CCProxy::isImplThread()); |
| 248 DebugScopedSetMainThread main; | 263 DebugScopedSetMainThread main; |
| 249 m_layerTreeHost->setAnimationEvents(events, wallClockTime); | 264 m_layerTreeHost->setAnimationEvents(events, wallClockTime); |
| 250 } | 265 } |
| 251 | 266 |
| 252 void CCSingleThreadProxy::releaseContentsTexturesOnImplThread() | 267 void CCSingleThreadProxy::releaseContentsTexturesOnImplThread() |
| 253 { | 268 { |
| 254 ASSERT(isImplThread()); | 269 ASSERT(isImplThread()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 266 | 281 |
| 267 void CCSingleThreadProxy::forceSerializeOnSwapBuffers() | 282 void CCSingleThreadProxy::forceSerializeOnSwapBuffers() |
| 268 { | 283 { |
| 269 { | 284 { |
| 270 DebugScopedSetImplThread impl; | 285 DebugScopedSetImplThread impl; |
| 271 if (m_rendererInitialized) | 286 if (m_rendererInitialized) |
| 272 m_layerTreeHostImpl->renderer()->doNoOp(); | 287 m_layerTreeHostImpl->renderer()->doNoOp(); |
| 273 } | 288 } |
| 274 } | 289 } |
| 275 | 290 |
| 291 void CCSingleThreadProxy::onSwapBuffersCompleteOnImplThread() |
| 292 { |
| 293 ASSERT_NOT_REACHED(); |
| 294 } |
| 295 |
| 276 bool CCSingleThreadProxy::commitAndComposite() | 296 bool CCSingleThreadProxy::commitAndComposite() |
| 277 { | 297 { |
| 278 ASSERT(CCProxy::isMainThread()); | 298 ASSERT(CCProxy::isMainThread()); |
| 279 | 299 |
| 280 if (!m_layerTreeHost->initializeRendererIfNeeded()) | 300 if (!m_layerTreeHost->initializeRendererIfNeeded()) |
| 281 return false; | 301 return false; |
| 282 | 302 |
| 283 // Unlink any texture backings that were deleted | 303 // Unlink any texture backings that were deleted |
| 284 CCPrioritizedTextureManager::BackingVector evictedContentsTexturesBackings; | 304 CCPrioritizedTextureManager::BackingVector evictedContentsTexturesBackings; |
| 285 { | 305 { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 361 |
| 342 void CCSingleThreadProxy::didSwapFrame() | 362 void CCSingleThreadProxy::didSwapFrame() |
| 343 { | 363 { |
| 344 if (m_nextFrameIsNewlyCommittedFrame) { | 364 if (m_nextFrameIsNewlyCommittedFrame) { |
| 345 m_nextFrameIsNewlyCommittedFrame = false; | 365 m_nextFrameIsNewlyCommittedFrame = false; |
| 346 m_layerTreeHost->didCommitAndDrawFrame(); | 366 m_layerTreeHost->didCommitAndDrawFrame(); |
| 347 } | 367 } |
| 348 } | 368 } |
| 349 | 369 |
| 350 } | 370 } |
| OLD | NEW |