Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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 #ifndef CC_SURFACES_FRAME_SINK_ID_ALLOCATOR_H_ | |
| 6 #define CC_SURFACES_FRAME_SINK_ID_ALLOCATOR_H_ | |
| 7 | |
| 8 #include "cc/surfaces/frame_sink_id.h" | |
| 9 | |
| 10 namespace cc { | |
| 11 | |
| 12 // This class generates FrameSinkId with a fixed client_id and an incrementally | |
| 13 // -increasing sink_id. | |
|
Fady Samuel
2017/02/17 14:01:52
nit: put the hyphen (the -) on the previous line o
xlai (Olivia)
2017/02/17 15:55:11
Done.
| |
| 14 class FrameSinkIdAllocator { | |
| 15 public: | |
| 16 constexpr FrameSinkIdAllocator(uint32_t client_id) | |
| 17 : client_id_(client_id), next_sink_id_(1u) {} | |
|
Fady Samuel
2017/02/17 14:01:52
nit: New line after this.
xlai (Olivia)
2017/02/17 15:55:11
Done.
| |
| 18 FrameSinkId NextFrameSinkId() { | |
| 19 return FrameSinkId(client_id_, next_sink_id_++); | |
| 20 } | |
| 21 | |
| 22 private: | |
| 23 const uint32_t client_id_; | |
| 24 uint32_t next_sink_id_; | |
| 25 | |
| 26 DISALLOW_COPY_AND_ASSIGN(FrameSinkIdAllocator); | |
| 27 }; | |
| 28 | |
| 29 } // namespace cc | |
| 30 | |
| 31 #endif // CC_SURFACES_FRAME_SINK_ID_ALLOCATOR_H_ | |
| OLD | NEW |