Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
graphicsmanagermacrodefs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ION_PROFILE_GL_FUNC(name)
 Copyright 2016 Google Inc. More...
 
#define ION_WRAP_NON_PROD_GL_FUNC(name, return_type, typed_args, args, trace)
 
#define ION_WRAP_PROD_GL_FUNC(name, return_type, typed_args, args, trace)
 In production builds, just invoke the function directly. More...
 
#define ION_DECLARE_GL_WRAPPER(group, name, return_type, typed_args, args)
 
#define ION_WRAP_GL_FUNC(group, name, return_type, typed_args, args, trace)
 
#define ION_TRACE_ARG(name, type, arg)   #arg << " = " << tracing_helper_.ToString(#type, arg)
 Logs an argument to the TracingHelper. More...
 

Macro Definition Documentation

#define ION_DECLARE_GL_WRAPPER (   group,
  name,
  return_type,
  typed_args,
  args 
)
Value:
private: \
/* Typedef for a pointer to the function. */ \
typedef return_type(ION_APIENTRY* name ## _Type) typed_args; \
\
/* Wrapper class that initializes the pointer with a lookup. */ \
class name ## _Wrapper : public WrapperBase { \
public: \
name ## _Wrapper() : WrapperBase(#name, k ## group) {} \
name ## _Type Get() { return reinterpret_cast<name ## _Type>(ptr_); } \
}; \
\
/* Instance of the wrapper class. */ \
name ## _Wrapper name ## _wrapper_;
std::string name
Definition: printer.cc:324

Definition at line 67 of file graphicsmanagermacrodefs.h.

#define ION_PROFILE_GL_FUNC (   name)

Copyright 2016 Google Inc.

All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.This file defines some magic preprocessor macros for wrapping OpenGL functions easily in the GraphicsManager class.

Definition at line 28 of file graphicsmanagermacrodefs.h.

#define ION_TRACE_ARG (   name,
  type,
  arg 
)    #arg << " = " << tracing_helper_.ToString(#type, arg)

Logs an argument to the TracingHelper.

Definition at line 93 of file graphicsmanagermacrodefs.h.

#define ION_WRAP_GL_FUNC (   group,
  name,
  return_type,
  typed_args,
  args,
  trace 
)
Value:
ION_WRAP_NON_PROD_GL_FUNC(name, return_type, typed_args, args, trace) \
ION_DECLARE_GL_WRAPPER(group, name, return_type, typed_args, args)
#define ION_WRAP_NON_PROD_GL_FUNC(name, return_type, typed_args, args, trace)
std::string name
Definition: printer.cc:324
#define ION_DECLARE_GL_WRAPPER(group, name, return_type, typed_args, args)

Definition at line 87 of file graphicsmanagermacrodefs.h.

#define ION_WRAP_NON_PROD_GL_FUNC (   name,
  return_type,
  typed_args,
  args,
  trace 
)
Value:
public: \
/* Invokes the wrapped function. */ \
return_type name typed_args { \
DCHECK(name##_wrapper_.Get()); \
/* Don't trace calls to glGetError(). */ \
static const bool do_trace = strcmp(#name, "GetError") && \
strcmp(#name, "PushGroupMarker") && \
strcmp(#name, "PopGroupMarker"); \
if (tracing_ostream_ && do_trace) { \
*tracing_ostream_ << tracing_prefix_ << name##_wrapper_.GetFuncName() \
<< "(" << trace << ")\n"; \
} \
if (is_error_checking_enabled_) { \
/* See ErrorChecker class doc for why it is needed here. */ \
std::ostringstream call; \
call << name##_wrapper_.GetFuncName() << "(" << trace << ")"; \
ErrorChecker error_checker(this, call.str()); \
return (*name##_wrapper_.Get())args; \
} else { \
return (*name##_wrapper_.Get())args; \
} \
}
#define DCHECK(expr)
Definition: logging.h:331
std::string name
Definition: printer.cc:324
#define ION_PROFILE_GL_FUNC(name)
Copyright 2016 Google Inc.

Definition at line 31 of file graphicsmanagermacrodefs.h.

#define ION_WRAP_PROD_GL_FUNC (   name,
  return_type,
  typed_args,
  args,
  trace 
)
Value:
public: \
/* Invokes the wrapped function. */ \
return_type name typed_args { \
return (*name ## _wrapper_.Get())args; \
}
std::string name
Definition: printer.cc:324
#define ION_PROFILE_GL_FUNC(name)
Copyright 2016 Google Inc.

In production builds, just invoke the function directly.

Since tracing is disabled in production builds, however, any tests that rely on tracing must be disabled or they will fail.

Definition at line 59 of file graphicsmanagermacrodefs.h.