1 // Copyright 2014 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_SURFACE_ID_H_ 6 #define CC_SURFACES_SURFACE_ID_H_ 7 8 namespace cc { 9 10 struct SurfaceId { SurfaceIdSurfaceId11 SurfaceId() : id(0) {} SurfaceIdSurfaceId12 explicit SurfaceId(int id) : id(id) {} 13 is_nullSurfaceId14 bool is_null() const { return id == 0; } 15 16 int id; 17 }; 18 19 inline bool operator==(const SurfaceId& a, const SurfaceId& b) { 20 return a.id == b.id; 21 } 22 23 inline bool operator!=(const SurfaceId& a, const SurfaceId& b) { 24 return !(a == b); 25 } 26 27 } // namespace cc 28 29 #endif // CC_SURFACES_SURFACE_ID_H_ 30