Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: cc/CCSingleThreadProxy.cpp

Issue 10919227: Roll in CC changes up to 128196 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/CCRenderSurfaceFilters.cpp ('k') | cc/CCThreadProxy.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 TRACE_EVENT0("cc", "CCSingleThreadProxy::recreateContext"); 127 TRACE_EVENT0("cc", "CCSingleThreadProxy::recreateContext");
128 ASSERT(CCProxy::isMainThread()); 128 ASSERT(CCProxy::isMainThread());
129 ASSERT(m_contextLost); 129 ASSERT(m_contextLost);
130 130
131 OwnPtr<CCGraphicsContext> context = m_layerTreeHost->createContext(); 131 OwnPtr<CCGraphicsContext> context = m_layerTreeHost->createContext();
132 if (!context) 132 if (!context)
133 return false; 133 return false;
134 134
135 bool initialized; 135 bool initialized;
136 { 136 {
137 DebugScopedSetMainThreadBlocked mainThreadBlocked;
137 DebugScopedSetImplThread impl; 138 DebugScopedSetImplThread impl;
138 if (!m_layerTreeHostImpl->contentsTexturesPurged()) 139 if (!m_layerTreeHostImpl->contentsTexturesPurged())
139 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostI mpl->resourceProvider()); 140 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostI mpl->resourceProvider());
140 initialized = m_layerTreeHostImpl->initializeRenderer(context.release(), UnthrottledUploader); 141 initialized = m_layerTreeHostImpl->initializeRenderer(context.release(), UnthrottledUploader);
141 if (initialized) { 142 if (initialized) {
142 m_RendererCapabilitiesForMainThread = m_layerTreeHostImpl->rendererC apabilities(); 143 m_RendererCapabilitiesForMainThread = m_layerTreeHostImpl->rendererC apabilities();
143 } 144 }
144 } 145 }
145 146
146 if (initialized) 147 if (initialized)
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 DebugScopedSetImplThread impl; 270 DebugScopedSetImplThread impl;
270 if (m_rendererInitialized) 271 if (m_rendererInitialized)
271 m_layerTreeHostImpl->renderer()->doNoOp(); 272 m_layerTreeHostImpl->renderer()->doNoOp();
272 } 273 }
273 } 274 }
274 275
275 bool CCSingleThreadProxy::commitAndComposite() 276 bool CCSingleThreadProxy::commitAndComposite()
276 { 277 {
277 ASSERT(CCProxy::isMainThread()); 278 ASSERT(CCProxy::isMainThread());
278 279
279
280 if (!m_layerTreeHost->initializeRendererIfNeeded()) 280 if (!m_layerTreeHost->initializeRendererIfNeeded())
281 return false; 281 return false;
282 282
283 if (m_layerTreeHostImpl->contentsTexturesPurged()) 283 if (m_layerTreeHostImpl->contentsTexturesPurged()) {
284 m_layerTreeHost->evictAllContentTextures(); 284 m_layerTreeHost->unlinkAllContentTextures();
285 DebugScopedSetImplThreadAndMainThreadBlocked implAndMainBlocked;
286 m_layerTreeHost->deleteUnlinkedTextures();
287 }
285 288
286 CCTextureUpdateQueue queue; 289 CCTextureUpdateQueue queue;
287 m_layerTreeHost->updateLayers(queue, m_layerTreeHostImpl->memoryAllocationLi mitBytes()); 290 m_layerTreeHost->updateLayers(queue, m_layerTreeHostImpl->memoryAllocationLi mitBytes());
288 m_layerTreeHostImpl->resetContentsTexturesPurged(); 291 m_layerTreeHostImpl->resetContentsTexturesPurged();
289 292
290 m_layerTreeHost->willCommit(); 293 m_layerTreeHost->willCommit();
291 doCommit(queue); 294 doCommit(queue);
292 bool result = doComposite(); 295 bool result = doComposite();
293 m_layerTreeHost->didBeginFrame(); 296 m_layerTreeHost->didBeginFrame();
294 return result; 297 return result;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 333
331 void CCSingleThreadProxy::didSwapFrame() 334 void CCSingleThreadProxy::didSwapFrame()
332 { 335 {
333 if (m_nextFrameIsNewlyCommittedFrame) { 336 if (m_nextFrameIsNewlyCommittedFrame) {
334 m_nextFrameIsNewlyCommittedFrame = false; 337 m_nextFrameIsNewlyCommittedFrame = false;
335 m_layerTreeHost->didCommitAndDrawFrame(); 338 m_layerTreeHost->didCommitAndDrawFrame();
336 } 339 }
337 } 340 }
338 341
339 } 342 }
OLDNEW
« no previous file with comments | « cc/CCRenderSurfaceFilters.cpp ('k') | cc/CCThreadProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698