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

Side by Side Diff: Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp

Issue 10694117: Merge 121450 - [chromium] Should schedule a commit when dropping contents textures (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | Source/WebCore/platform/graphics/chromium/cc/CCScheduler.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 /* 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 if (m_rootLayerImpl) 149 if (m_rootLayerImpl)
150 clearRenderSurfaces(); 150 clearRenderSurfaces();
151 } 151 }
152 152
153 void CCLayerTreeHostImpl::beginCommit() 153 void CCLayerTreeHostImpl::beginCommit()
154 { 154 {
155 } 155 }
156 156
157 void CCLayerTreeHostImpl::commitComplete() 157 void CCLayerTreeHostImpl::commitComplete()
158 { 158 {
159 TRACE_EVENT0("cc", "CCLayerTreeHostImpl::commitComplete");
159 // Recompute max scroll position; must be after layer content bounds are 160 // Recompute max scroll position; must be after layer content bounds are
160 // updated. 161 // updated.
161 updateMaxScrollPosition(); 162 updateMaxScrollPosition();
162 m_contentsTexturesWerePurgedSinceLastCommit = false; 163 m_contentsTexturesWerePurgedSinceLastCommit = false;
163 } 164 }
164 165
165 bool CCLayerTreeHostImpl::canDraw() 166 bool CCLayerTreeHostImpl::canDraw()
166 { 167 {
167 if (!m_rootLayerImpl) 168 if (!m_rootLayerImpl) {
169 TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw no root layer") ;
168 return false; 170 return false;
169 if (viewportSize().isEmpty()) 171 }
172 if (viewportSize().isEmpty()) {
173 TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw empty viewport" );
170 return false; 174 return false;
171 if (!m_layerRenderer) 175 }
176 if (!m_layerRenderer) {
177 TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw no layerRendere r");
172 return false; 178 return false;
173 if (m_contentsTexturesWerePurgedSinceLastCommit) 179 }
180 if (m_contentsTexturesWerePurgedSinceLastCommit) {
181 TRACE_EVENT_INSTANT0("cc", "CCLayerTreeHostImpl::canDraw contents textur es purged");
174 return false; 182 return false;
183 }
175 return true; 184 return true;
176 } 185 }
177 186
178 CCGraphicsContext* CCLayerTreeHostImpl::context() const 187 CCGraphicsContext* CCLayerTreeHostImpl::context() const
179 { 188 {
180 return m_context.get(); 189 return m_context.get();
181 } 190 }
182 191
183 void CCLayerTreeHostImpl::animate(double monotonicTime, double wallClockTime) 192 void CCLayerTreeHostImpl::animate(double monotonicTime, double wallClockTime)
184 { 193 {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 return false; 411 return false;
403 412
404 // If we return true, then we expect drawLayers() to be called before this f unction is called again. 413 // If we return true, then we expect drawLayers() to be called before this f unction is called again.
405 return true; 414 return true;
406 } 415 }
407 416
408 void CCLayerTreeHostImpl::releaseContentsTextures() 417 void CCLayerTreeHostImpl::releaseContentsTextures()
409 { 418 {
410 contentsTextureAllocator()->deleteAllTextures(); 419 contentsTextureAllocator()->deleteAllTextures();
411 m_contentsTexturesWerePurgedSinceLastCommit = true; 420 m_contentsTexturesWerePurgedSinceLastCommit = true;
421 m_client->setNeedsCommitOnImplThread();
412 } 422 }
413 423
414 void CCLayerTreeHostImpl::setMemoryAllocationLimitBytes(size_t bytes) 424 void CCLayerTreeHostImpl::setMemoryAllocationLimitBytes(size_t bytes)
415 { 425 {
416 if (m_memoryAllocationLimitBytes == bytes) 426 if (m_memoryAllocationLimitBytes == bytes)
417 return; 427 return;
418 m_memoryAllocationLimitBytes = bytes; 428 m_memoryAllocationLimitBytes = bytes;
419 429
420 ASSERT(bytes); 430 ASSERT(bytes);
421 m_client->setNeedsCommitOnImplThread(); 431 m_client->setNeedsCommitOnImplThread();
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 return; 1094 return;
1085 1095
1086 bool isContinuing = m_activeGestureAnimation->animate(monotonicTime); 1096 bool isContinuing = m_activeGestureAnimation->animate(monotonicTime);
1087 if (isContinuing) 1097 if (isContinuing)
1088 m_client->setNeedsRedrawOnImplThread(); 1098 m_client->setNeedsRedrawOnImplThread();
1089 else 1099 else
1090 m_activeGestureAnimation.clear(); 1100 m_activeGestureAnimation.clear();
1091 } 1101 }
1092 1102
1093 } // namespace WebCore 1103 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698