summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client/gles2_implementation.h
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-14 20:06:57 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-14 20:06:57 +0000
commit87ad26d05ee0e7b31211e6e9b0c06d6dd62c086a (patch)
tree0f9fe2342769c8072ca29651d6cb97bb5f195600 /gpu/command_buffer/client/gles2_implementation.h
parentde059efb30d6ae2f62f2dbd10d1550b56f30a433 (diff)
downloadchromium_src-87ad26d05ee0e7b31211e6e9b0c06d6dd62c086a.zip
chromium_src-87ad26d05ee0e7b31211e6e9b0c06d6dd62c086a.tar.gz
chromium_src-87ad26d05ee0e7b31211e6e9b0c06d6dd62c086a.tar.bz2
Add lots of client side OpenGL logging.
TEST=ran chrome, ran OpenGL ES 2.0 conformance tests BUG=none R=apatrick@chromium.org Review URL: http://codereview.chromium.org/7003103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89054 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client/gles2_implementation.h')
-rw-r--r--gpu/command_buffer/client/gles2_implementation.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 3c25116..6a3aa75 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -18,8 +18,21 @@
#include "../client/gles2_cmd_helper.h"
#include "../client/ring_buffer.h"
-// TODO(gman): replace with logging code expansion.
-#define GPU_CLIENT_LOG(args)
+#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_LOG(args)
+ #define GPU_CLIENT_LOG_CODE_BLOCK(code)
+ #else
+ #include "base/logging.h"
+ #define GPU_CLIENT_LOG(args) DLOG_IF(INFO, debug_) << args;
+ #define GPU_CLIENT_LOG_CODE_BLOCK(code) code
+ #define GPU_CLIENT_DEBUG
+ #endif
+#else
+ #define GPU_CLIENT_LOG(args)
+ #define GPU_CLIENT_LOG_CODE_BLOCK(code)
+#endif
namespace gpu {
@@ -326,6 +339,9 @@ class GLES2Implementation {
// Current GL error bits.
uint32 error_bits_;
+ // Whether or not to print debugging info.
+ bool debug_;
+
// 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;