Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Sat, 11 Mar 2017 16:00:06 +0000 (03:00 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 11 Mar 2017 16:00:06 +0000 (03:00 +1100)
14 files changed:
1  2 
CMakeLists.txt
GNUmakefile
build_files/cmake/macros.cmake
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/sequencer.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/interface/interface_eyedropper.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap_object.c
source/blender/gpu/intern/gpu_debug.c

diff --cc CMakeLists.txt
Simple merge
diff --cc GNUmakefile
Simple merge
Simple merge
index 8df34f4f8905045bc42646ae0607cff5b4c17e75,be2e4ab05e0d3e29d42aba17821d416941b68947..556cf74ecf0c53654af2eedebaaa55d372a978f9
@@@ -8159,8 -7171,9 +8159,9 @@@ static void drawtexspace(Object *ob, co
  }
  
  /* draws wire outline */
- static void drawObjectSelect(Scene *scene, SceneLayer *sl, View3D *v3d, ARegion *ar, Base *base,
-                              const unsigned char ob_wire_col[4])
+ static void draw_object_selected_outline(
 -        Scene *scene, View3D *v3d, ARegion *ar, Base *base,
++        Scene *scene, SceneLayer *sl, View3D *v3d, ARegion *ar, Base *base,
+         const unsigned char ob_wire_col[4])
  {
        RegionView3D *rv3d = ar->regiondata;
        Object *ob = base->object;
@@@ -8647,17 -7645,8 +8648,17 @@@ void draw_object(Scene *scene, SceneLay
                /* draw outline for selected objects, mesh does itself */
                if ((v3d->flag & V3D_SELECT_OUTLINE) && !render_override && ob->type != OB_MESH) {
                        if (dt > OB_WIRE && (ob->mode & OB_MODE_EDIT) == 0 && (dflag & DRAW_SCENESET) == 0) {
 -                              if (!(ob->dtx & OB_DRAWWIRE) && (ob->flag & SELECT) && !(dflag & (DRAW_PICKING | DRAW_CONSTCOLOR))) {
 -                                      draw_object_selected_outline(scene, v3d, ar, base, ob_wire_col);
 +                              if (!(ob->dtx & OB_DRAWWIRE) && (base->flag & BASE_SELECTED) && !(dflag & (DRAW_PICKING | DRAW_CONSTCOLOR))) {
-                                       drawObjectSelect(scene, sl, v3d, ar, base, ob_wire_col);
++                                      draw_object_selected_outline(scene, sl, v3d, ar, base, ob_wire_col);
 +                              }
 +                      }
 +              }
 +
 +              /* TODO Viewport: draw only for selection */
 +              if (!IS_VIEWPORT_LEGACY(v3d)) {
 +                      if ((dflag & DRAW_PICKING) == 0) {
 +                              if ((dt == OB_BOUNDBOX) || ELEM(ob->type, OB_EMPTY, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
 +                                      goto afterdraw;
                                }
                        }
                }
index bfda589b45290765ec089bcd7d25dc3dc5b4f431,ba68d1a6a0fcdce5b0bf144faea364b50fb9f55c..eeeb6e0ab331d7925d00ebae9765cce31183a006
  #include <stdlib.h>
  #include <string.h>
  
 -#define CASE_CODE_RETURN_STR(code) case code: return #code;
 +#ifndef __APPLE__ /* only non-Apple systems implement OpenGL debug callbacks */
  
 -static const char *gpu_gl_error_symbol(GLenum err)
 -{
 -      switch (err) {
 -              CASE_CODE_RETURN_STR(GL_NO_ERROR)
 -              CASE_CODE_RETURN_STR(GL_INVALID_ENUM)
 -              CASE_CODE_RETURN_STR(GL_INVALID_VALUE)
 -              CASE_CODE_RETURN_STR(GL_INVALID_OPERATION)
 -              CASE_CODE_RETURN_STR(GL_STACK_OVERFLOW)
 -              CASE_CODE_RETURN_STR(GL_STACK_UNDERFLOW)
 -              CASE_CODE_RETURN_STR(GL_OUT_OF_MEMORY)
 -
 -#if GL_ARB_imaging
 -              CASE_CODE_RETURN_STR(GL_TABLE_TOO_LARGE)
 -#endif
 -
 -#if defined(WITH_GLU)
 -              CASE_CODE_RETURN_STR(GLU_INVALID_ENUM)
 -              CASE_CODE_RETURN_STR(GLU_INVALID_VALUE)
 -              CASE_CODE_RETURN_STR(GLU_OUT_OF_MEMORY)
 -#endif
 -
 -              default:
 -                      return "<unknown error>";
 -      }
 -}
 -
 -#undef CASE_CODE_RETURN_STR
 -
 -
 -static bool gpu_report_gl_errors(const char *file, int line, const char *str)
 -{
 -      GLenum gl_error = glGetError();
 -
 -      if (gl_error == GL_NO_ERROR) {
 -              return true;
 -      }
 -      else {
 -              /* glGetError should have cleared the error flag, so if we get the
 -               * same flag twice that means glGetError itself probably triggered
 -               * the error. This happens on Windows if the GL context is invalid.
 -               */
 -              {
 -                      GLenum new_error = glGetError();
 -                      if (gl_error == new_error) {
 -                              fprintf(stderr, "GL: Possible context invalidation issue\n");
 -                              return false;
 -                      }
 -              }
 -
 -              fprintf(stderr,
 -                      "%s:%d: ``%s'' -> GL Error (0x%04X - %s): %s\n",
 -                      file, line, str, gl_error,
 -                      gpu_gl_error_symbol(gl_error),
 -                      gpuErrorString(gl_error));
 -
 -              return false;
 -      }
 -}
 -
 -
 -const char *gpuErrorString(GLenum err)
 -{
 -      switch (err) {
 -              case GL_NO_ERROR:
 -                      return "No Error";
 -
 -              case GL_INVALID_ENUM:
 -                      return "Invalid Enumeration";
 -
 -              case GL_INVALID_VALUE:
 -                      return "Invalid Value";
 -
 -              case GL_INVALID_OPERATION:
 -                      return "Invalid Operation";
 -
 -              case GL_STACK_OVERFLOW:
 -                      return "Stack Overflow";
 -
 -              case GL_STACK_UNDERFLOW:
 -                      return "Stack Underflow";
 -
 -              case GL_OUT_OF_MEMORY:
 -                      return "Out of Memory";
 -
 -#if GL_ARB_imaging
 -              case GL_TABLE_TOO_LARGE:
 -                      return "Table Too Large";
 -#endif
 -
 -#if defined(WITH_GLU)
 -              case GLU_INVALID_ENUM:
 -                      return "Invalid Enum (GLU)";
 -
 -              case GLU_INVALID_VALUE:
 -                      return "Invalid Value (GLU)";
 -
 -              case GLU_OUT_OF_MEMORY:
 -                      return "Out of Memory (GLU)";
 -#endif
 -
 -              default:
 -                      return "<unknown error>";
 -      }
 -}
 +/* control whether we use older AMD_debug_output extension
 + * some supported GPU + OS combos do not have the newer extensions */
-  #define LEGACY_DEBUG 1
++#  define LEGACY_DEBUG 1
  
 -
 -/* Debug callbacks need the same calling convention as OpenGL functions.
 - */
 -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
 -    /* Win32 but not WinCE */
 -#   define APIENTRY __stdcall
 -#else
 -#   define APIENTRY
 -#endif
 +/* Debug callbacks need the same calling convention as OpenGL functions. */
-  #if defined(_WIN32)
-   #define APIENTRY __stdcall
-  #else
-   #define APIENTRY
-  #endif
++#  if defined(_WIN32)
++#    define APIENTRY __stdcall
++#  else
++#    define APIENTRY
++#  endif
  
  
- static const charsource_name(GLenum source)
+ static const char *source_name(GLenum source)
  {
        switch (source) {
                case GL_DEBUG_SOURCE_API: return "API";
@@@ -107,23 -232,8 +107,23 @@@ static void APIENTRY gpu_debug_proc
        }
  }
  
-  #if LEGACY_DEBUG
++#  if LEGACY_DEBUG
 +
- static const char* category_name_amd(GLenum category)
++static const char *category_name_amd(GLenum category)
 +{
 +      switch (category) {
 +              case GL_DEBUG_CATEGORY_API_ERROR_AMD: return "API error";
 +              case GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD: return "window system";
 +              case GL_DEBUG_CATEGORY_DEPRECATION_AMD: return "deprecated behavior";
 +              case GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD: return "undefined behavior";
 +              case GL_DEBUG_CATEGORY_PERFORMANCE_AMD: return "performance";
 +              case GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD: return "shader compiler";
 +              case GL_DEBUG_CATEGORY_APPLICATION_AMD: return "application";
 +              case GL_DEBUG_CATEGORY_OTHER_AMD: return "other";
 +              default: return "???";
 +      }
 +}
  
 -#ifndef GLEW_ES_ONLY
  static void APIENTRY gpu_debug_proc_amd(
          GLuint UNUSED(id), GLenum category,
          GLenum severity, GLsizei UNUSED(length),
                fflush(stderr);
        }
  }
-  #endif /* LEGACY_DEBUG */
 -#endif
 -
++#  endif /* LEGACY_DEBUG */
  
-  #undef APIENTRY
 -#undef APIENTRY
++#  undef APIENTRY
 +#endif /* not Apple */
  
  void gpu_debug_init(void)
  {
                glDebugMessageCallbackARB((GLDEBUGPROCARB)gpu_debug_proc, mxGetCurrentContext());
                glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE);
                GPU_string_marker(success);
 -
 -              return;
        }
-  #if LEGACY_DEBUG
 -
 -      if (GLEW_AMD_debug_output) {
++#  if LEGACY_DEBUG
 +      else if (GLEW_AMD_debug_output) {
                fprintf(stderr, "Using AMD_debug_output extension\n");
                glDebugMessageCallbackAMD(gpu_debug_proc_amd, mxGetCurrentContext());
                glDebugMessageEnableAMD(GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE);
                GPU_string_marker(success);
 -
 -              return;
        }
-  #endif
 -#endif
 -
 -      fprintf(stderr, "Failed to hook OpenGL debug callback.\n");
 -
 -      return;
++#  endif
 +      else {
 +              fprintf(stderr, "Failed to hook OpenGL debug callback.\n");
 +      }
 +#endif /* not Apple */
  }
  
  
  void gpu_debug_exit(void)
  {
 -#ifndef WITH_GLEW_ES
 -#ifndef GLEW_ES_ONLY
 -      if (GLEW_VERSION_4_3) {
 -              glDebugMessageCallback(NULL, NULL);
 -
 -              return;
 -      }
 -#endif
 -#endif
 -
 -      if (GLEW_KHR_debug) {
 -#ifndef GLEW_ES_ONLY
 +#ifndef __APPLE__
 +      if (GLEW_VERSION_4_3 || GLEW_KHR_debug) {
                glDebugMessageCallback(NULL, NULL);
 -#endif
 -              return;
        }
 -
 -#ifndef GLEW_ES_ONLY
 -      if (GLEW_ARB_debug_output) {
 +      else if (GLEW_ARB_debug_output) {
                glDebugMessageCallbackARB(NULL, NULL);
 -
 -              return;
        }
-  #if LEGACY_DEBUG
 -
 -      if (GLEW_AMD_debug_output) {
++#  if LEGACY_DEBUG
 +      else if (GLEW_AMD_debug_output) {
                glDebugMessageCallbackAMD(NULL, NULL);
 -
 -              return;
        }
-  #endif
++#  endif
  #endif
 -
 -      return;
  }
  
  void GPU_string_marker(const char *buf)
                glDebugMessageInsertARB(
                        GL_DEBUG_SOURCE_APPLICATION_ARB, GL_DEBUG_TYPE_OTHER_ARB, 0,
                        GL_DEBUG_SEVERITY_LOW_ARB, -1, buf);
 -
 -              return;
        }
-  #if LEGACY_DEBUG
 -
 -      if (GLEW_AMD_debug_output) {
++#  if LEGACY_DEBUG
 +      else if (GLEW_AMD_debug_output) {
                glDebugMessageInsertAMD(
                        GL_DEBUG_CATEGORY_APPLICATION_AMD, GL_DEBUG_SEVERITY_LOW_AMD, 0,
                        0, buf);
 -
 -              return;
        }
-  #endif
 -
 -      if (GLEW_GREMEDY_string_marker) {
 -              glStringMarkerGREMEDY(0, buf);
 -
 -              return;
 -      }
 -#endif
++#  endif
 +#endif /* not Apple */
  }
  
  void GPU_print_error_debug(const char *str)