1 // Copyright (c) 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.
5 #ifndef GPU_COMMAND_BUFFER_COMMON_VALUE_STATE_H_
6 #define GPU_COMMAND_BUFFER_COMMON_VALUE_STATE_H_
8 #include "base/containers/hash_tables.h"
9 #include "base/memory/ref_counted.h"
10 #include "gpu/gpu_export.h"
14 // Used to maintain Valuebuffer state, exposed to browser to
15 // support passing ValueStates via IPC.
16 union GPU_EXPORT ValueState
{
21 // Refcounted wrapper for a hash_map of subscription targets to ValueStates
22 class GPU_EXPORT ValueStateMap
: public base::RefCounted
<ValueStateMap
> {
26 // Returns NULL if there is not ValueState for the target
27 const ValueState
* GetState(unsigned int target
) const;
29 void UpdateState(unsigned int target
, const ValueState
& state
);
32 virtual ~ValueStateMap();
35 friend class base::RefCounted
<ValueStateMap
>;
37 typedef base::hash_map
<unsigned int, ValueState
> Map
;
41 DISALLOW_COPY_AND_ASSIGN(ValueStateMap
);
46 #endif // GPU_COMMAND_BUFFER_COMMON_VALUE_STATE_H_