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

Side by Side Diff: cc/resources/transferable_resource.h

Issue 23097005: cc: return resources via a ReturnedResource struct rather than TransferableResource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: post-rebase fixes Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_RESOURCES_TRANSFERABLE_RESOURCE_H_ 5 #ifndef CC_RESOURCES_TRANSFERABLE_RESOURCE_H_
6 #define CC_RESOURCES_TRANSFERABLE_RESOURCE_H_ 6 #define CC_RESOURCES_TRANSFERABLE_RESOURCE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "cc/base/cc_export.h" 11 #include "cc/base/cc_export.h"
12 #include "gpu/command_buffer/common/mailbox.h" 12 #include "gpu/command_buffer/common/mailbox.h"
13 #include "ui/gfx/size.h" 13 #include "ui/gfx/size.h"
14 14
15 namespace cc { 15 namespace cc {
16 16
17 struct ReturnedResource;
18
17 struct CC_EXPORT TransferableResource { 19 struct CC_EXPORT TransferableResource {
18 TransferableResource(); 20 TransferableResource();
19 ~TransferableResource(); 21 ~TransferableResource();
20 22
23 ReturnedResource Return() const;
24
21 unsigned id; 25 unsigned id;
22 unsigned sync_point; 26 unsigned sync_point;
23 uint32 format; 27 uint32 format;
24 uint32 filter; 28 uint32 filter;
25 gfx::Size size; 29 gfx::Size size;
26 gpu::Mailbox mailbox; 30 gpu::Mailbox mailbox;
27 }; 31 };
28 32
29 typedef std::vector<TransferableResource> TransferableResourceArray; 33 typedef std::vector<TransferableResource> TransferableResourceArray;
30 34
35 struct CC_EXPORT ReturnedResource {
danakj 2013/08/16 23:33:35 Can you move this to its own file please?
piman 2013/08/17 01:54:31 Done.
36 ReturnedResource() : id(0), sync_point(0), filter(0), count(0) {}
37 unsigned id;
38 unsigned sync_point;
39 uint32 filter;
40 int count;
41 };
42
43 typedef std::vector<ReturnedResource> ReturnedResourceArray;
44
45 CC_EXPORT void ReturnResources(const TransferableResourceArray& input,
danakj 2013/08/16 23:33:35 I'm kinda meh about a free function like this, as
piman 2013/08/17 01:54:31 As discussed, made it a static in TransferableReso
46 ReturnedResourceArray* output);
47
31 } // namespace cc 48 } // namespace cc
32 49
33 #endif // CC_RESOURCES_TRANSFERABLE_RESOURCE_H_ 50 #endif // CC_RESOURCES_TRANSFERABLE_RESOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698