OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 bool CCSingleThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect
) | 84 bool CCSingleThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect
) |
85 { | 85 { |
86 ASSERT(isMainThread()); | 86 ASSERT(isMainThread()); |
87 | 87 |
88 if (!recreateContextIfNeeded()) | 88 if (!recreateContextIfNeeded()) |
89 return false; | 89 return false; |
90 | 90 |
91 commitIfNeeded(); | 91 commitIfNeeded(); |
92 | 92 |
93 | |
94 if (!doComposite()) | 93 if (!doComposite()) |
95 return false; | 94 return false; |
96 | 95 |
97 m_layerTreeHostImpl->readback(pixels, rect); | 96 m_layerTreeHostImpl->readback(pixels, rect); |
98 | 97 |
99 if (m_layerTreeHostImpl->isContextLost()) | 98 if (m_layerTreeHostImpl->isContextLost()) |
100 return false; | 99 return false; |
101 | 100 |
102 return true; | 101 return true; |
103 } | 102 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 224 |
226 // We have tried too many times to recreate the context. Tell the host to fa
ll | 225 // We have tried too many times to recreate the context. Tell the host to fa
ll |
227 // back to software rendering. | 226 // back to software rendering. |
228 m_layerTreeHost->didRecreateGraphicsContext(false); | 227 m_layerTreeHost->didRecreateGraphicsContext(false); |
229 return false; | 228 return false; |
230 } | 229 } |
231 | 230 |
232 void CCSingleThreadProxy::commitIfNeeded() | 231 void CCSingleThreadProxy::commitIfNeeded() |
233 { | 232 { |
234 // Update | 233 // Update |
235 double frameBeginTime = currentTime(); | |
236 m_layerTreeHost->animateAndLayout(frameBeginTime); | |
237 m_layerTreeHost->updateLayers(); | 234 m_layerTreeHost->updateLayers(); |
238 | 235 |
239 // Commit | 236 // Commit |
240 { | 237 { |
241 ScopedSetImplThread impl; | 238 ScopedSetImplThread impl; |
242 m_layerTreeHostImpl->beginCommit(); | 239 m_layerTreeHostImpl->beginCommit(); |
243 m_layerTreeHost->commitTo(m_layerTreeHostImpl.get()); | 240 m_layerTreeHost->commitTo(m_layerTreeHostImpl.get()); |
244 m_layerTreeHostImpl->commitComplete(); | 241 m_layerTreeHostImpl->commitComplete(); |
245 } | 242 } |
246 } | 243 } |
(...skipping 16 matching lines...) Expand all Loading... |
263 m_numFailedRecreateAttempts = 0; | 260 m_numFailedRecreateAttempts = 0; |
264 setNeedsCommitAndRedraw(); | 261 setNeedsCommitAndRedraw(); |
265 return false; | 262 return false; |
266 } | 263 } |
267 } | 264 } |
268 | 265 |
269 return true; | 266 return true; |
270 } | 267 } |
271 | 268 |
272 } | 269 } |
OLD | NEW |