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

Unified Diff: gpu/command_buffer/client/gles2_implementation.h

Issue 8914016: Revert "Reverting as this is suspected of causing check_deps failure on Linux bot" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.h
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 82739b40d911b9b5ed43e299727e26c0a368923b..5a23671606ac3a46db1105f010786393c7361551 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -21,17 +21,20 @@
#if !defined(NDEBUG) && !defined(__native_client__) && !defined(GLES2_CONFORMANCE_TESTS) // NOLINT
#if defined(GLES2_INLINE_OPTIMIZATION)
// TODO(gman): Replace with macros that work with inline optmization.
+ #define GPU_CLIENT_SINGLE_THREAD_CHECK()
#define GPU_CLIENT_LOG(args)
#define GPU_CLIENT_LOG_CODE_BLOCK(code)
#define GPU_CLIENT_DCHECK_CODE_BLOCK(code)
#else
#include "base/logging.h"
+ #define GPU_CLIENT_SINGLE_THREAD_CHECK() SingleThreadChecker checker(this);
#define GPU_CLIENT_LOG(args) DLOG_IF(INFO, debug_) << args;
#define GPU_CLIENT_LOG_CODE_BLOCK(code) code
#define GPU_CLIENT_DCHECK_CODE_BLOCK(code) code
#define GPU_CLIENT_DEBUG
#endif
#else
+ #define GPU_CLIENT_SINGLE_THREAD_CHECK()
#define GPU_CLIENT_LOG(args)
#define GPU_CLIENT_LOG_CODE_BLOCK(code)
#define GPU_CLIENT_DCHECK_CODE_BLOCK(code)
@@ -383,6 +386,16 @@ class GLES2Implementation {
GLuint bound_texture_cube_map;
};
+ // Checks for single threaded access.
+ class SingleThreadChecker {
+ public:
+ SingleThreadChecker(GLES2Implementation* gles2_implementation);
+ ~SingleThreadChecker();
+
+ private:
+ GLES2Implementation* gles2_implementation_;
+ };
+
// Gets the value of the result.
template <typename T>
T GetResultAs() {
@@ -542,6 +555,9 @@ class GLES2Implementation {
bool bind_generates_resource_;
+ // Used to check for single threaded access.
+ int use_count_;
+
// Map of GLenum to Strings for glGetString. We need to cache these because
// the pointer passed back to the client has to remain valid for eternity.
typedef std::map<uint32, std::set<std::string> > GLStringMap;
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698