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

Side by Side Diff: cc/CCTextureUpdateQueue.cpp

Issue 10947017: Enable removing uploads to evicted textures from texture upload queues. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback 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/CCTextureUpdateQueue.h ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #if USE(ACCELERATED_COMPOSITING) 7 #if USE(ACCELERATED_COMPOSITING)
8 8
9 #include "CCTextureUpdateQueue.h" 9 #include "CCTextureUpdateQueue.h"
10 10
(...skipping 15 matching lines...) Expand all
26 void CCTextureUpdateQueue::appendPartialUpload(TextureUploader::Parameters uploa d) 26 void CCTextureUpdateQueue::appendPartialUpload(TextureUploader::Parameters uploa d)
27 { 27 {
28 m_partialEntries.append(upload); 28 m_partialEntries.append(upload);
29 } 29 }
30 30
31 void CCTextureUpdateQueue::appendCopy(TextureCopier::Parameters copy) 31 void CCTextureUpdateQueue::appendCopy(TextureCopier::Parameters copy)
32 { 32 {
33 m_copyEntries.append(copy); 33 m_copyEntries.append(copy);
34 } 34 }
35 35
36 void CCTextureUpdateQueue::clearUploads() 36 void CCTextureUpdateQueue::clearUploadsToEvictedResources()
37 { 37 {
38 m_fullEntries.clear(); 38 clearUploadsToEvictedResources(m_fullEntries);
39 m_partialEntries.clear(); 39 clearUploadsToEvictedResources(m_partialEntries);
40 }
41
42 void CCTextureUpdateQueue::clearUploadsToEvictedResources(Deque<TextureUploader: :Parameters>& entryQueue)
43 {
44 Deque<TextureUploader::Parameters> temp;
45 entryQueue.swap(temp);
46 while (temp.size()) {
47 TextureUploader::Parameters upload = temp.takeFirst();
48 if (!upload.texture->backingResourceWasEvicted())
49 entryQueue.append(upload);
50 }
40 } 51 }
41 52
42 TextureUploader::Parameters CCTextureUpdateQueue::takeFirstFullUpload() 53 TextureUploader::Parameters CCTextureUpdateQueue::takeFirstFullUpload()
43 { 54 {
44 return m_fullEntries.takeFirst(); 55 return m_fullEntries.takeFirst();
45 } 56 }
46 57
47 TextureUploader::Parameters CCTextureUpdateQueue::takeFirstPartialUpload() 58 TextureUploader::Parameters CCTextureUpdateQueue::takeFirstPartialUpload()
48 { 59 {
49 return m_partialEntries.takeFirst(); 60 return m_partialEntries.takeFirst();
50 } 61 }
51 62
52 TextureCopier::Parameters CCTextureUpdateQueue::takeFirstCopy() 63 TextureCopier::Parameters CCTextureUpdateQueue::takeFirstCopy()
53 { 64 {
54 return m_copyEntries.takeFirst(); 65 return m_copyEntries.takeFirst();
55 } 66 }
56 67
57 bool CCTextureUpdateQueue::hasMoreUpdates() const 68 bool CCTextureUpdateQueue::hasMoreUpdates() const
58 { 69 {
59 return m_fullEntries.size() || m_partialEntries.size() || m_copyEntries.size (); 70 return m_fullEntries.size() || m_partialEntries.size() || m_copyEntries.size ();
60 } 71 }
61 72
62 } 73 }
63 74
64 #endif // USE(ACCELERATED_COMPOSITING) 75 #endif // USE(ACCELERATED_COMPOSITING)
OLDNEW
« no previous file with comments | « cc/CCTextureUpdateQueue.h ('k') | cc/CCThreadProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698