Reland "Add base::TimeDelta::Max()"
[chromium-blink-merge.git] / cc / resources / transferable_resource.cc
blobe7e9e24b3cab956ef56bdc69239ccda66a08442d
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.
5 #include "base/logging.h"
6 #include "cc/resources/returned_resource.h"
7 #include "cc/resources/transferable_resource.h"
9 namespace cc {
11 TransferableResource::TransferableResource()
12 : id(0),
13 format(RGBA_8888),
14 filter(0),
15 is_software(false) {}
17 TransferableResource::~TransferableResource() {
20 ReturnedResource TransferableResource::ToReturnedResource() const {
21 ReturnedResource returned;
22 returned.id = id;
23 returned.sync_point = mailbox_holder.sync_point;
24 returned.count = 1;
25 return returned;
28 // static
29 void TransferableResource::ReturnResources(
30 const TransferableResourceArray& input,
31 ReturnedResourceArray* output) {
32 for (TransferableResourceArray::const_iterator it = input.begin();
33 it != input.end(); ++it)
34 output->push_back(it->ToReturnedResource());
37 } // namespace cc