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

Unified Diff: gpu/command_buffer/service/gles2_cmd_validation.h

Issue 987123003: Add a mechanism for command buffer to conditionally allow ES3 enums. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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/service/gles2_cmd_validation.h
diff --git a/gpu/command_buffer/service/gles2_cmd_validation.h b/gpu/command_buffer/service/gles2_cmd_validation.h
index 22ee2da0d0d7c424f59eae562d9cb6d4cecf1aa0..8ca98613d725b7882b4084b7bd1aeb9113c15c2d 100644
--- a/gpu/command_buffer/service/gles2_cmd_validation.h
+++ b/gpu/command_buffer/service/gles2_cmd_validation.h
@@ -22,9 +22,7 @@ class ValueValidator {
ValueValidator() {}
ValueValidator(const T* valid_values, int num_values) {
- for (int ii = 0; ii < num_values; ++ii) {
- AddValue(valid_values[ii]);
- }
+ AddValues(valid_values, num_values);
}
void AddValue(const T value) {
@@ -33,6 +31,12 @@ class ValueValidator {
}
}
+ void AddValues(const T* valid_values, int num_values) {
+ for (int ii = 0; ii < num_values; ++ii) {
+ AddValue(valid_values[ii]);
+ }
+ }
+
bool IsValid(const T value) const {
return std::find(valid_values_.begin(), valid_values_.end(), value) !=
valid_values_.end();
@@ -48,6 +52,9 @@ class ValueValidator {
struct Validators {
Validators();
+
+ void AddES3Values();
+
#include "gpu/command_buffer/service/gles2_cmd_validation_autogen.h"
};

Powered by Google App Engine
This is Rietveld 408576698