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

Unified Diff: gpu/command_buffer/common/value_state.h

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/common/value_state.h
diff --git a/gpu/command_buffer/common/value_state.h b/gpu/command_buffer/common/value_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..478924581b8a13b45d8afd9cfce38f7cbd38b8b5
--- /dev/null
+++ b/gpu/command_buffer/common/value_state.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_COMMAND_BUFFER_COMMON_VALUE_STATE_H_
+#define GPU_COMMAND_BUFFER_COMMON_VALUE_STATE_H_
+
+#include "base/containers/hash_tables.h"
+#include "base/memory/ref_counted.h"
+#include "gpu/gpu_export.h"
+
+namespace gpu {
+
+// Used to maintain Valuebuffer state, exposed to browser to
+// support passing ValueStates via IPC.
+union GPU_EXPORT ValueState {
+ float float_value[4];
+ int int_value[4];
+};
+
+// Refcounted wrapper for a hash_map of subscription targets to ValueStates
+class GPU_EXPORT ValueStateMap : public base::RefCounted<ValueStateMap> {
+ public:
+ ValueStateMap();
+
+ // Returns NULL if there is not ValueState for the target
+ const ValueState* GetState(unsigned int target) const;
+
+ void UpdateState(unsigned int target, const ValueState& state);
+
+ protected:
+ virtual ~ValueStateMap();
+
+ private:
+ friend class base::RefCounted<ValueStateMap>;
+
+ typedef base::hash_map<unsigned int, ValueState> Map;
+
+ Map state_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(ValueStateMap);
+};
+
+} // namespace gpu
+
+#endif // GPU_COMMAND_BUFFER_COMMON_VALUE_STATE_H_
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h ('k') | gpu/command_buffer/common/value_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698