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/GrGLInterface.h" | 9 #include "gl/GrGLInterface.h" |
10 #include "gl/GrGLExtensions.h" | 10 #include "gl/GrGLExtensions.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 newInterface->fFunctions.fPopGroupMarker = popGroupMarkerFn; | 33 newInterface->fFunctions.fPopGroupMarker = popGroupMarkerFn; |
34 | 34 |
35 return newInterface; | 35 return newInterface; |
36 } | 36 } |
37 | 37 |
38 const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) { | 38 const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) { |
39 GrGLInterface* newInterface = GrGLInterface::NewClone(interface); | 39 GrGLInterface* newInterface = GrGLInterface::NewClone(interface); |
40 | 40 |
41 newInterface->fExtensions.remove("GL_NV_path_rendering"); | 41 newInterface->fExtensions.remove("GL_NV_path_rendering"); |
42 newInterface->fFunctions.fPathCommands = NULL; | 42 newInterface->fFunctions.fPathCommands = NULL; |
| 43 newInterface->fFunctions.fPathCoords = NULL; |
43 newInterface->fFunctions.fPathParameteri = NULL; | 44 newInterface->fFunctions.fPathParameteri = NULL; |
44 newInterface->fFunctions.fPathParameterf = NULL; | 45 newInterface->fFunctions.fPathParameterf = NULL; |
45 newInterface->fFunctions.fGenPaths = NULL; | 46 newInterface->fFunctions.fGenPaths = NULL; |
46 newInterface->fFunctions.fDeletePaths = NULL; | 47 newInterface->fFunctions.fDeletePaths = NULL; |
47 newInterface->fFunctions.fIsPath = NULL; | 48 newInterface->fFunctions.fIsPath = NULL; |
48 newInterface->fFunctions.fPathStencilFunc = NULL; | 49 newInterface->fFunctions.fPathStencilFunc = NULL; |
49 newInterface->fFunctions.fStencilFillPath = NULL; | 50 newInterface->fFunctions.fStencilFillPath = NULL; |
50 newInterface->fFunctions.fStencilStrokePath = NULL; | 51 newInterface->fFunctions.fStencilStrokePath = NULL; |
51 newInterface->fFunctions.fStencilFillPathInstanced = NULL; | 52 newInterface->fFunctions.fStencilFillPathInstanced = NULL; |
52 newInterface->fFunctions.fStencilStrokePathInstanced = NULL; | 53 newInterface->fFunctions.fStencilStrokePathInstanced = NULL; |
| 54 newInterface->fFunctions.fPathTexGen = NULL; |
53 newInterface->fFunctions.fCoverFillPath = NULL; | 55 newInterface->fFunctions.fCoverFillPath = NULL; |
54 newInterface->fFunctions.fCoverStrokePath = NULL; | 56 newInterface->fFunctions.fCoverStrokePath = NULL; |
55 newInterface->fFunctions.fCoverFillPathInstanced = NULL; | 57 newInterface->fFunctions.fCoverFillPathInstanced = NULL; |
56 newInterface->fFunctions.fCoverStrokePathInstanced = NULL; | 58 newInterface->fFunctions.fCoverStrokePathInstanced = NULL; |
57 newInterface->fFunctions.fStencilThenCoverFillPath = NULL; | 59 newInterface->fFunctions.fStencilThenCoverFillPath = NULL; |
58 newInterface->fFunctions.fStencilThenCoverStrokePath = NULL; | 60 newInterface->fFunctions.fStencilThenCoverStrokePath = NULL; |
59 newInterface->fFunctions.fStencilThenCoverFillPathInstanced = NULL; | 61 newInterface->fFunctions.fStencilThenCoverFillPathInstanced = NULL; |
60 newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = NULL; | 62 newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = NULL; |
61 newInterface->fFunctions.fProgramPathFragmentInputGen = NULL; | 63 newInterface->fFunctions.fProgramPathFragmentInputGen = NULL; |
62 return newInterface; | 64 return newInterface; |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 if (NULL == fFunctions.fGetShaderPrecisionFormat) { | 482 if (NULL == fFunctions.fGetShaderPrecisionFormat) { |
481 RETURN_FALSE_INTERFACE | 483 RETURN_FALSE_INTERFACE |
482 } | 484 } |
483 #endif | 485 #endif |
484 } | 486 } |
485 | 487 |
486 if (fExtensions.has("GL_NV_path_rendering")) { | 488 if (fExtensions.has("GL_NV_path_rendering")) { |
487 if (NULL == fFunctions.fMatrixLoadf || | 489 if (NULL == fFunctions.fMatrixLoadf || |
488 NULL == fFunctions.fMatrixLoadIdentity || | 490 NULL == fFunctions.fMatrixLoadIdentity || |
489 NULL == fFunctions.fPathCommands || | 491 NULL == fFunctions.fPathCommands || |
| 492 NULL == fFunctions.fPathCoords || |
490 NULL == fFunctions.fPathParameteri || | 493 NULL == fFunctions.fPathParameteri || |
491 NULL == fFunctions.fPathParameterf || | 494 NULL == fFunctions.fPathParameterf || |
492 NULL == fFunctions.fGenPaths || | 495 NULL == fFunctions.fGenPaths || |
493 NULL == fFunctions.fDeletePaths || | 496 NULL == fFunctions.fDeletePaths || |
494 NULL == fFunctions.fIsPath || | 497 NULL == fFunctions.fIsPath || |
495 NULL == fFunctions.fPathStencilFunc || | 498 NULL == fFunctions.fPathStencilFunc || |
496 NULL == fFunctions.fStencilFillPath || | 499 NULL == fFunctions.fStencilFillPath || |
497 NULL == fFunctions.fStencilStrokePath || | 500 NULL == fFunctions.fStencilStrokePath || |
498 NULL == fFunctions.fStencilFillPathInstanced || | 501 NULL == fFunctions.fStencilFillPathInstanced || |
499 NULL == fFunctions.fStencilStrokePathInstanced || | 502 NULL == fFunctions.fStencilStrokePathInstanced || |
500 NULL == fFunctions.fCoverFillPath || | 503 NULL == fFunctions.fCoverFillPath || |
501 NULL == fFunctions.fCoverStrokePath || | 504 NULL == fFunctions.fCoverStrokePath || |
502 NULL == fFunctions.fCoverFillPathInstanced || | 505 NULL == fFunctions.fCoverFillPathInstanced || |
503 NULL == fFunctions.fCoverStrokePathInstanced || | 506 NULL == fFunctions.fCoverStrokePathInstanced) { |
504 NULL == fFunctions.fStencilThenCoverFillPath || | |
505 NULL == fFunctions.fStencilThenCoverStrokePath || | |
506 NULL == fFunctions.fStencilThenCoverFillPathInstanced || | |
507 NULL == fFunctions.fStencilThenCoverStrokePathInstanced || | |
508 NULL == fFunctions.fProgramPathFragmentInputGen) { | |
509 RETURN_FALSE_INTERFACE | 507 RETURN_FALSE_INTERFACE |
510 } | 508 } |
| 509 if (kGL_GrGLStandard == fStandard) { |
| 510 // Some methods only exist on desktop |
| 511 if (NULL == fFunctions.fPathTexGen) { |
| 512 RETURN_FALSE_INTERFACE |
| 513 } |
| 514 } else { |
| 515 // All additions through v1.3 exist on GLES |
| 516 if (NULL == fFunctions.fStencilThenCoverFillPath || |
| 517 NULL == fFunctions.fStencilThenCoverStrokePath || |
| 518 NULL == fFunctions.fStencilThenCoverFillPathInstanced || |
| 519 NULL == fFunctions.fStencilThenCoverStrokePathInstanced || |
| 520 NULL == fFunctions.fProgramPathFragmentInputGen) { |
| 521 RETURN_FALSE_INTERFACE |
| 522 } |
| 523 } |
511 } | 524 } |
512 | 525 |
513 if (fExtensions.has("GL_EXT_raster_multisample")) { | 526 if (fExtensions.has("GL_EXT_raster_multisample")) { |
514 if (NULL == fFunctions.fRasterSamples) { | 527 if (NULL == fFunctions.fRasterSamples) { |
515 RETURN_FALSE_INTERFACE | 528 RETURN_FALSE_INTERFACE |
516 } | 529 } |
517 } | 530 } |
518 | 531 |
519 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) { | 532 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) { |
520 if (NULL == fFunctions.fCoverageModulation) { | 533 if (NULL == fFunctions.fCoverageModulation) { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 NULL == fFunctions.fGetDebugMessageLog || | 700 NULL == fFunctions.fGetDebugMessageLog || |
688 NULL == fFunctions.fPushDebugGroup || | 701 NULL == fFunctions.fPushDebugGroup || |
689 NULL == fFunctions.fPopDebugGroup || | 702 NULL == fFunctions.fPopDebugGroup || |
690 NULL == fFunctions.fObjectLabel) { | 703 NULL == fFunctions.fObjectLabel) { |
691 RETURN_FALSE_INTERFACE | 704 RETURN_FALSE_INTERFACE |
692 } | 705 } |
693 } | 706 } |
694 | 707 |
695 return true; | 708 return true; |
696 } | 709 } |
OLD | NEW |