blob: 558d6e8772896157875d04cf4b885c84d6736468 (
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
|
// 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.
#include "cc/resources/returned_resource.h"
#include "cc/resources/transferable_resource.h"
namespace cc {
TransferableResource::TransferableResource()
: id(0),
format(RGBA_8888),
filter(0),
is_repeated(false),
is_software(false),
allow_overlay(false) {
}
TransferableResource::~TransferableResource() {
}
ReturnedResource TransferableResource::ToReturnedResource() const {
ReturnedResource returned;
returned.id = id;
returned.sync_point = mailbox_holder.sync_point;
returned.count = 1;
return returned;
}
// static
void TransferableResource::ReturnResources(
const TransferableResourceArray& input,
ReturnedResourceArray* output) {
for (TransferableResourceArray::const_iterator it = input.begin();
it != input.end(); ++it)
output->push_back(it->ToReturnedResource());
}
} // namespace cc
|