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

Side by Side Diff: cc/resource_update_queue.cc

Issue 11270047: cc: Rename TextureUpdate to ResourceUpdate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
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 #include "cc/texture_update_queue.h" 7 #include "cc/resource_update_queue.h"
8 8
9 #include "cc/prioritized_texture.h" 9 #include "cc/prioritized_texture.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 TextureUpdateQueue::TextureUpdateQueue() 13 ResourceUpdateQueue::ResourceUpdateQueue()
14 { 14 {
15 } 15 }
16 16
17 TextureUpdateQueue::~TextureUpdateQueue() 17 ResourceUpdateQueue::~ResourceUpdateQueue()
18 { 18 {
19 } 19 }
20 20
21 void TextureUpdateQueue::appendFullUpload(const ResourceUpdate& upload) 21 void ResourceUpdateQueue::appendFullUpload(const ResourceUpdate& upload)
22 { 22 {
23 m_fullEntries.push_back(upload); 23 m_fullEntries.push_back(upload);
24 } 24 }
25 25
26 void TextureUpdateQueue::appendPartialUpload(const ResourceUpdate& upload) 26 void ResourceUpdateQueue::appendPartialUpload(const ResourceUpdate& upload)
27 { 27 {
28 m_partialEntries.push_back(upload); 28 m_partialEntries.push_back(upload);
29 } 29 }
30 30
31 void TextureUpdateQueue::appendCopy(TextureCopier::Parameters copy) 31 void ResourceUpdateQueue::appendCopy(TextureCopier::Parameters copy)
32 { 32 {
33 m_copyEntries.push_back(copy); 33 m_copyEntries.push_back(copy);
34 } 34 }
35 35
36 void TextureUpdateQueue::clearUploadsToEvictedResources() 36 void ResourceUpdateQueue::clearUploadsToEvictedResources()
37 { 37 {
38 clearUploadsToEvictedResources(m_fullEntries); 38 clearUploadsToEvictedResources(m_fullEntries);
39 clearUploadsToEvictedResources(m_partialEntries); 39 clearUploadsToEvictedResources(m_partialEntries);
40 } 40 }
41 41
42 void TextureUpdateQueue::clearUploadsToEvictedResources(std::deque<ResourceUpdat e>& entryQueue) 42 void ResourceUpdateQueue::clearUploadsToEvictedResources(std::deque<ResourceUpda te>& entryQueue)
43 { 43 {
44 std::deque<ResourceUpdate> temp; 44 std::deque<ResourceUpdate> temp;
45 entryQueue.swap(temp); 45 entryQueue.swap(temp);
46 while (temp.size()) { 46 while (temp.size()) {
47 ResourceUpdate upload = temp.front(); 47 ResourceUpdate upload = temp.front();
48 temp.pop_front(); 48 temp.pop_front();
49 if (!upload.texture->backingResourceWasEvicted()) 49 if (!upload.texture->backingResourceWasEvicted())
50 entryQueue.push_back(upload); 50 entryQueue.push_back(upload);
51 } 51 }
52 } 52 }
53 53
54 ResourceUpdate TextureUpdateQueue::takeFirstFullUpload() 54 ResourceUpdate ResourceUpdateQueue::takeFirstFullUpload()
55 { 55 {
56 ResourceUpdate first = m_fullEntries.front(); 56 ResourceUpdate first = m_fullEntries.front();
57 m_fullEntries.pop_front(); 57 m_fullEntries.pop_front();
58 return first; 58 return first;
59 } 59 }
60 60
61 ResourceUpdate TextureUpdateQueue::takeFirstPartialUpload() 61 ResourceUpdate ResourceUpdateQueue::takeFirstPartialUpload()
62 { 62 {
63 ResourceUpdate first = m_partialEntries.front(); 63 ResourceUpdate first = m_partialEntries.front();
64 m_partialEntries.pop_front(); 64 m_partialEntries.pop_front();
65 return first; 65 return first;
66 } 66 }
67 67
68 TextureCopier::Parameters TextureUpdateQueue::takeFirstCopy() 68 TextureCopier::Parameters ResourceUpdateQueue::takeFirstCopy()
69 { 69 {
70 TextureCopier::Parameters first = m_copyEntries.front(); 70 TextureCopier::Parameters first = m_copyEntries.front();
71 m_copyEntries.pop_front(); 71 m_copyEntries.pop_front();
72 return first; 72 return first;
73 } 73 }
74 74
75 bool TextureUpdateQueue::hasMoreUpdates() const 75 bool ResourceUpdateQueue::hasMoreUpdates() const
76 { 76 {
77 return m_fullEntries.size() || m_partialEntries.size() || m_copyEntries.size (); 77 return m_fullEntries.size() || m_partialEntries.size() || m_copyEntries.size ();
78 } 78 }
79 79
80 } 80 }
OLDNEW
« no previous file with comments | « cc/resource_update_queue.h ('k') | cc/scrollbar_layer.h » ('j') | cc/scrollbar_layer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698