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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 newInterface->fFunctions.fPathStencilFunc = NULL; | 49 newInterface->fFunctions.fPathStencilFunc = NULL; |
50 newInterface->fFunctions.fStencilFillPath = NULL; | 50 newInterface->fFunctions.fStencilFillPath = NULL; |
51 newInterface->fFunctions.fStencilStrokePath = NULL; | 51 newInterface->fFunctions.fStencilStrokePath = NULL; |
52 newInterface->fFunctions.fStencilFillPathInstanced = NULL; | 52 newInterface->fFunctions.fStencilFillPathInstanced = NULL; |
53 newInterface->fFunctions.fStencilStrokePathInstanced = NULL; | 53 newInterface->fFunctions.fStencilStrokePathInstanced = NULL; |
54 newInterface->fFunctions.fPathTexGen = NULL; | 54 newInterface->fFunctions.fPathTexGen = NULL; |
55 newInterface->fFunctions.fCoverFillPath = NULL; | 55 newInterface->fFunctions.fCoverFillPath = NULL; |
56 newInterface->fFunctions.fCoverStrokePath = NULL; | 56 newInterface->fFunctions.fCoverStrokePath = NULL; |
57 newInterface->fFunctions.fCoverFillPathInstanced = NULL; | 57 newInterface->fFunctions.fCoverFillPathInstanced = NULL; |
58 newInterface->fFunctions.fCoverStrokePathInstanced = NULL; | 58 newInterface->fFunctions.fCoverStrokePathInstanced = NULL; |
| 59 newInterface->fFunctions.fStencilThenCoverFillPath = NULL; |
| 60 newInterface->fFunctions.fStencilThenCoverStrokePath = NULL; |
| 61 newInterface->fFunctions.fStencilThenCoverFillPathInstanced = NULL; |
| 62 newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = NULL; |
59 newInterface->fFunctions.fProgramPathFragmentInputGen = NULL; | 63 newInterface->fFunctions.fProgramPathFragmentInputGen = NULL; |
60 return newInterface; | 64 return newInterface; |
61 } | 65 } |
62 | 66 |
63 GrGLInterface::GrGLInterface() { | 67 GrGLInterface::GrGLInterface() { |
64 fStandard = kNone_GrGLStandard; | 68 fStandard = kNone_GrGLStandard; |
65 | 69 |
66 #if GR_GL_PER_GL_FUNC_CALLBACK | 70 #if GR_GL_PER_GL_FUNC_CALLBACK |
67 fCallback = GrGLDefaultInterfaceCallback; | 71 fCallback = GrGLDefaultInterfaceCallback; |
68 fCallbackData = 0; | 72 fCallbackData = 0; |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 NULL == fFunctions.fDeletePaths || | 464 NULL == fFunctions.fDeletePaths || |
461 NULL == fFunctions.fIsPath || | 465 NULL == fFunctions.fIsPath || |
462 NULL == fFunctions.fPathStencilFunc || | 466 NULL == fFunctions.fPathStencilFunc || |
463 NULL == fFunctions.fStencilFillPath || | 467 NULL == fFunctions.fStencilFillPath || |
464 NULL == fFunctions.fStencilStrokePath || | 468 NULL == fFunctions.fStencilStrokePath || |
465 NULL == fFunctions.fStencilFillPathInstanced || | 469 NULL == fFunctions.fStencilFillPathInstanced || |
466 NULL == fFunctions.fStencilStrokePathInstanced || | 470 NULL == fFunctions.fStencilStrokePathInstanced || |
467 NULL == fFunctions.fCoverFillPath || | 471 NULL == fFunctions.fCoverFillPath || |
468 NULL == fFunctions.fCoverStrokePath || | 472 NULL == fFunctions.fCoverStrokePath || |
469 NULL == fFunctions.fCoverFillPathInstanced || | 473 NULL == fFunctions.fCoverFillPathInstanced || |
470 NULL == fFunctions.fCoverStrokePathInstanced || | 474 NULL == fFunctions.fCoverStrokePathInstanced) { |
471 NULL == fFunctions.fStencilThenCoverFillPath || | |
472 NULL == fFunctions.fStencilThenCoverStrokePath || | |
473 NULL == fFunctions.fStencilThenCoverFillPathInstanced || | |
474 NULL == fFunctions.fStencilThenCoverStrokePathInstanced) { | |
475 RETURN_FALSE_INTERFACE | 475 RETURN_FALSE_INTERFACE |
476 } | 476 } |
477 // Currently ProgramPathFragmentInputGen is not used on | 477 if (kGL_GrGLStandard == fStandard) { |
478 // OpenGL, rather PathTexGen is. | 478 // Some methods only exist on desktop |
479 if ((kGL_GrGLStandard == fStandard && NULL == fFunctions.fPathTexGen) || | 479 if (NULL == fFunctions.fPathTexGen) { |
480 (kGLES_GrGLStandard == fStandard && NULL == fFunctions.fProgramPathF
ragmentInputGen)) { | 480 RETURN_FALSE_INTERFACE |
481 RETURN_FALSE_INTERFACE | 481 } |
| 482 } else { |
| 483 // All additions through v1.3 exist on GLES |
| 484 if (NULL == fFunctions.fStencilThenCoverFillPath || |
| 485 NULL == fFunctions.fStencilThenCoverStrokePath || |
| 486 NULL == fFunctions.fStencilThenCoverFillPathInstanced || |
| 487 NULL == fFunctions.fStencilThenCoverStrokePathInstanced || |
| 488 NULL == fFunctions.fProgramPathFragmentInputGen) { |
| 489 RETURN_FALSE_INTERFACE |
| 490 } |
482 } | 491 } |
483 } | 492 } |
484 | 493 |
485 return true; | 494 return true; |
486 } | 495 } |
OLD | NEW |