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

Side by Side Diff: cc/resources/resource_update_queue.cc

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 | « cc/resources/resource_update_queue.h ('k') | cc/resources/returned_resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/resources/resource_update_queue.h"
6
7 #include "cc/resources/prioritized_resource.h"
8
9 namespace cc {
10
11 ResourceUpdateQueue::ResourceUpdateQueue() {}
12
13 ResourceUpdateQueue::~ResourceUpdateQueue() {}
14
15 void ResourceUpdateQueue::AppendFullUpload(const ResourceUpdate& upload) {
16 full_entries_.push_back(upload);
17 }
18
19 void ResourceUpdateQueue::AppendPartialUpload(const ResourceUpdate& upload) {
20 partial_entries_.push_back(upload);
21 }
22
23 void ResourceUpdateQueue::ClearUploadsToEvictedResources() {
24 ClearUploadsToEvictedResources(&full_entries_);
25 ClearUploadsToEvictedResources(&partial_entries_);
26 }
27
28 void ResourceUpdateQueue::ClearUploadsToEvictedResources(
29 std::deque<ResourceUpdate>* entry_queue) {
30 std::deque<ResourceUpdate> temp;
31 entry_queue->swap(temp);
32 while (temp.size()) {
33 ResourceUpdate upload = temp.front();
34 temp.pop_front();
35 if (!upload.texture->BackingResourceWasEvicted())
36 entry_queue->push_back(upload);
37 }
38 }
39
40 ResourceUpdate ResourceUpdateQueue::TakeFirstFullUpload() {
41 ResourceUpdate first = full_entries_.front();
42 full_entries_.pop_front();
43 return first;
44 }
45
46 ResourceUpdate ResourceUpdateQueue::TakeFirstPartialUpload() {
47 ResourceUpdate first = partial_entries_.front();
48 partial_entries_.pop_front();
49 return first;
50 }
51
52 bool ResourceUpdateQueue::HasMoreUpdates() const {
53 return !full_entries_.empty() || !partial_entries_.empty();
54 }
55
56 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_update_queue.h ('k') | cc/resources/returned_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698