Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 | 8 |
| 9 #include "gl/GrGLDebugMarker.h" | |
| 9 #include "gl/GrGLInterface.h" | 10 #include "gl/GrGLInterface.h" |
| 10 #include "gl/GrGLExtensions.h" | 11 #include "gl/GrGLExtensions.h" |
| 11 #include "gl/GrGLUtil.h" | 12 #include "gl/GrGLUtil.h" |
| 12 | 13 |
| 13 #include <stdio.h> | 14 #include <stdio.h> |
| 14 | 15 |
| 15 #if GR_GL_PER_GL_FUNC_CALLBACK | 16 #if GR_GL_PER_GL_FUNC_CALLBACK |
| 16 namespace { | 17 namespace { |
| 17 void GrGLDefaultInterfaceCallback(const GrGLInterface*) {} | 18 void GrGLDefaultInterfaceCallback(const GrGLInterface*) {} |
| 18 } | 19 } |
| 19 #endif | 20 #endif |
| 20 | 21 |
| 22 const GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface* interf ace) { | |
| 23 GrGLInterface* newInterface = GrGLInterface::NewClone(interface); | |
| 24 | |
| 25 if (!newInterface->fExtensions.has("GL_EXT_debug_marker")) { | |
| 26 newInterface->fExtensions.add("GL_EXT_debug_marker"); | |
| 27 } | |
| 28 | |
| 29 newInterface->fInsertEventMarker = testInsertEventMarker; | |
|
bsalomon
2014/02/20 22:14:13
Where are these defined?
| |
| 30 newInterface->fPushGroupMarker = testPushGroupMarker; | |
| 31 newInterface->fPopGroupMarker = testPopGroupMarker; | |
| 32 | |
| 33 return newInterface; | |
| 34 } | |
| 35 | |
| 21 const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) { | 36 const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) { |
| 22 GrGLInterface* newInterface = GrGLInterface::NewClone(interface); | 37 GrGLInterface* newInterface = GrGLInterface::NewClone(interface); |
| 23 | 38 |
| 24 newInterface->fExtensions.remove("GL_NV_path_rendering"); | 39 newInterface->fExtensions.remove("GL_NV_path_rendering"); |
| 25 | 40 |
| 26 newInterface->fPathCommands = NULL; | 41 newInterface->fPathCommands = NULL; |
| 27 newInterface->fPathCoords = NULL; | 42 newInterface->fPathCoords = NULL; |
| 28 newInterface->fPathSubCommands = NULL; | 43 newInterface->fPathSubCommands = NULL; |
| 29 newInterface->fPathSubCoords = NULL; | 44 newInterface->fPathSubCoords = NULL; |
| 30 newInterface->fPathString = NULL; | 45 newInterface->fPathString = NULL; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 , fGetPathMetrics(&fFunctions.fGetPathMetrics) | 271 , fGetPathMetrics(&fFunctions.fGetPathMetrics) |
| 257 , fGetPathMetricRange(&fFunctions.fGetPathMetricRange) | 272 , fGetPathMetricRange(&fFunctions.fGetPathMetricRange) |
| 258 , fGetPathSpacing(&fFunctions.fGetPathSpacing) | 273 , fGetPathSpacing(&fFunctions.fGetPathSpacing) |
| 259 , fGetPathColorGeniv(&fFunctions.fGetPathColorGeniv) | 274 , fGetPathColorGeniv(&fFunctions.fGetPathColorGeniv) |
| 260 , fGetPathColorGenfv(&fFunctions.fGetPathColorGenfv) | 275 , fGetPathColorGenfv(&fFunctions.fGetPathColorGenfv) |
| 261 , fGetPathTexGeniv(&fFunctions.fGetPathTexGeniv) | 276 , fGetPathTexGeniv(&fFunctions.fGetPathTexGeniv) |
| 262 , fGetPathTexGenfv(&fFunctions.fGetPathTexGenfv) | 277 , fGetPathTexGenfv(&fFunctions.fGetPathTexGenfv) |
| 263 , fIsPointInFillPath(&fFunctions.fIsPointInFillPath) | 278 , fIsPointInFillPath(&fFunctions.fIsPointInFillPath) |
| 264 , fIsPointInStrokePath(&fFunctions.fIsPointInStrokePath) | 279 , fIsPointInStrokePath(&fFunctions.fIsPointInStrokePath) |
| 265 , fGetPathLength(&fFunctions.fGetPathLength) | 280 , fGetPathLength(&fFunctions.fGetPathLength) |
| 266 , fPointAlongPath(&fFunctions.fPointAlongPath) { | 281 , fPointAlongPath(&fFunctions.fPointAlongPath) |
| 282 , fInsertEventMarker(&fFunctions.fInsertEventMarker) | |
| 283 , fPushGroupMarker(&fFunctions.fPushGroupMarker) | |
| 284 , fPopGroupMarker(&fFunctions.fPopGroupMarker) { | |
| 267 fStandard = kNone_GrGLStandard; | 285 fStandard = kNone_GrGLStandard; |
| 268 | 286 |
| 269 #if GR_GL_PER_GL_FUNC_CALLBACK | 287 #if GR_GL_PER_GL_FUNC_CALLBACK |
| 270 fCallback = GrGLDefaultInterfaceCallback; | 288 fCallback = GrGLDefaultInterfaceCallback; |
| 271 fCallbackData = 0; | 289 fCallbackData = 0; |
| 272 #endif | 290 #endif |
| 273 } | 291 } |
| 274 | 292 |
| 275 GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) { | 293 GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) { |
| 276 SkASSERT(NULL != interface); | 294 SkASSERT(NULL != interface); |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 648 } | 666 } |
| 649 } else { | 667 } else { |
| 650 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_obje ct")) { | 668 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_obje ct")) { |
| 651 if (NULL == fFunctions.fBindVertexArray || | 669 if (NULL == fFunctions.fBindVertexArray || |
| 652 NULL == fFunctions.fDeleteVertexArrays || | 670 NULL == fFunctions.fDeleteVertexArrays || |
| 653 NULL == fFunctions.fGenVertexArrays) { | 671 NULL == fFunctions.fGenVertexArrays) { |
| 654 return false; | 672 return false; |
| 655 } | 673 } |
| 656 } | 674 } |
| 657 } | 675 } |
| 676 | |
| 677 #if 0 | |
| 678 if (fExtensions.has("GL_EXT_debug_marker")) { | |
| 679 if (NULL == fFunctions.fInsertEventMarker || | |
| 680 NULL == fFunctions.fPushGroupMarker || | |
| 681 NULL == fFunctions.fPopGroupMarker) { | |
| 682 return false; | |
| 683 } | |
| 684 } | |
| 685 #endif | |
| 658 return true; | 686 return true; |
| 659 } | 687 } |
| OLD | NEW |