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

Side by Side Diff: cc/proto/gpu_conversions.cc

Issue 2493853002: cc/blimp: Proto Cleanup. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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
« no previous file with comments | « cc/proto/gpu_conversions.h ('k') | cc/proto/gpu_conversions_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 "cc/proto/gpu_conversions.h"
6
7 #include "base/logging.h"
8 #include "cc/proto/memory_allocation.pb.h"
9 #include "gpu/command_buffer/common/gpu_memory_allocation.h"
10
11 namespace cc {
12
13 proto::MemoryAllocation::PriorityCutoff MemoryAllocationPriorityCutoffToProto(
14 const gpu::MemoryAllocation::PriorityCutoff& priority_cutoff) {
15 switch (priority_cutoff) {
16 case gpu::MemoryAllocation::PriorityCutoff::CUTOFF_ALLOW_NOTHING:
17 return proto::MemoryAllocation_PriorityCutoff_ALLOW_NOTHING;
18 case gpu::MemoryAllocation::PriorityCutoff::CUTOFF_ALLOW_REQUIRED_ONLY:
19 return proto::MemoryAllocation_PriorityCutoff_ALLOW_REQUIRED_ONLY;
20 case gpu::MemoryAllocation::PriorityCutoff::CUTOFF_ALLOW_NICE_TO_HAVE:
21 return proto::MemoryAllocation_PriorityCutoff_ALLOW_NICE_TO_HAVE;
22 case gpu::MemoryAllocation::PriorityCutoff::CUTOFF_ALLOW_EVERYTHING:
23 return proto::MemoryAllocation_PriorityCutoff_ALLOW_EVERYTHING;
24 }
25 return proto::MemoryAllocation_PriorityCutoff_UNKNOWN;
26 }
27
28 gpu::MemoryAllocation::PriorityCutoff MemoryAllocationPriorityCutoffFromProto(
29 const proto::MemoryAllocation::PriorityCutoff& priority_cutoff) {
30 switch (priority_cutoff) {
31 case proto::MemoryAllocation_PriorityCutoff_ALLOW_NOTHING:
32 return gpu::MemoryAllocation::PriorityCutoff::CUTOFF_ALLOW_NOTHING;
33 case proto::MemoryAllocation_PriorityCutoff_ALLOW_REQUIRED_ONLY:
34 return gpu::MemoryAllocation::PriorityCutoff::CUTOFF_ALLOW_REQUIRED_ONLY;
35 case proto::MemoryAllocation_PriorityCutoff_ALLOW_NICE_TO_HAVE:
36 return gpu::MemoryAllocation::PriorityCutoff::CUTOFF_ALLOW_NICE_TO_HAVE;
37 case proto::MemoryAllocation_PriorityCutoff_ALLOW_EVERYTHING:
38 return gpu::MemoryAllocation::PriorityCutoff::CUTOFF_ALLOW_EVERYTHING;
39 case proto::MemoryAllocation_PriorityCutoff_UNKNOWN:
40 NOTREACHED() << "Received MemoryAllocation::PriorityCutoff_UNKNOWN";
41 return gpu::MemoryAllocation::PriorityCutoff::CUTOFF_LAST;
42 }
43 return gpu::MemoryAllocation::PriorityCutoff::CUTOFF_ALLOW_NOTHING;
44 }
45
46 } // namespace cc
OLDNEW
« no previous file with comments | « cc/proto/gpu_conversions.h ('k') | cc/proto/gpu_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698