Home | History | Annotate | Download | only in resources
      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 "base/logging.h"
      6 #include "cc/resources/returned_resource.h"
      7 #include "cc/resources/transferable_resource.h"
      8 
      9 namespace cc {
     10 
     11 TransferableResource::TransferableResource()
     12     : id(0),
     13       sync_point(0),
     14       format(RGBA_8888),
     15       target(0),
     16       filter(0),
     17       is_software(false) {}
     18 
     19 TransferableResource::~TransferableResource() {
     20 }
     21 
     22 ReturnedResource TransferableResource::ToReturnedResource() const {
     23   ReturnedResource returned;
     24   returned.id = id;
     25   returned.sync_point = sync_point;
     26   returned.count = 1;
     27   return returned;
     28 }
     29 
     30 // static
     31 void TransferableResource::ReturnResources(
     32     const TransferableResourceArray& input,
     33     ReturnedResourceArray* output) {
     34   for (TransferableResourceArray::const_iterator it = input.begin();
     35        it != input.end(); ++it)
     36     output->push_back(it->ToReturnedResource());
     37 }
     38 
     39 }  // namespace cc
     40