blob: c36260d0859809e5dd0eda50ed836cbccce7dea7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_RESOURCE_UPDATE_QUEUE_H_
#define CC_RESOURCE_UPDATE_QUEUE_H_
#include <deque>
#include "base/basictypes.h"
#include "cc/base/cc_export.h"
#include "cc/resource_update.h"
#include "cc/texture_copier.h"
namespace cc {
class CC_EXPORT ResourceUpdateQueue {
public:
ResourceUpdateQueue();
virtual ~ResourceUpdateQueue();
void appendFullUpload(const ResourceUpdate&);
void appendPartialUpload(const ResourceUpdate&);
void appendCopy(TextureCopier::Parameters);
void clearUploadsToEvictedResources();
ResourceUpdate takeFirstFullUpload();
ResourceUpdate takeFirstPartialUpload();
TextureCopier::Parameters takeFirstCopy();
size_t fullUploadSize() const { return m_fullEntries.size(); }
size_t partialUploadSize() const { return m_partialEntries.size(); }
size_t copySize() const { return m_copyEntries.size(); }
bool hasMoreUpdates() const;
private:
void clearUploadsToEvictedResources(std::deque<ResourceUpdate>& entryQueue);
std::deque<ResourceUpdate> m_fullEntries;
std::deque<ResourceUpdate> m_partialEntries;
std::deque<TextureCopier::Parameters> m_copyEntries;
DISALLOW_COPY_AND_ASSIGN(ResourceUpdateQueue);
};
}
#endif // CC_RESOURCE_UPDATE_QUEUE_H_
|