Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(868)

Side by Side Diff: src/gpu/gl/GrGLInterface.cpp

Issue 1184863002: Revert of Import functionality for new GL backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | src/gpu/gl/GrGLNoOpInterface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 // These functions are added to the 3.0 version of both GLES and GL. 459 // These functions are added to the 3.0 version of both GLES and GL.
460 if (glVer >= GR_GL_VER(3,0) || 460 if (glVer >= GR_GL_VER(3,0) ||
461 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_r ange")) || 461 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_r ange")) ||
462 (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_ran ge"))) { 462 (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_ran ge"))) {
463 if (NULL == fFunctions.fMapBufferRange || 463 if (NULL == fFunctions.fMapBufferRange ||
464 NULL == fFunctions.fFlushMappedBufferRange) { 464 NULL == fFunctions.fFlushMappedBufferRange) {
465 RETURN_FALSE_INTERFACE; 465 RETURN_FALSE_INTERFACE;
466 } 466 }
467 } 467 }
468 468
469 if ((kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_state_a ccess")) ||
470 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_NV_path_renderin g"))) {
471 if (NULL == fFunctions.fMatrixLoadf ||
472 NULL == fFunctions.fMatrixLoadIdentity) {
473 RETURN_FALSE_INTERFACE
474 }
475 }
476
469 if ((kGL_GrGLStandard == fStandard && 477 if ((kGL_GrGLStandard == fStandard &&
470 (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_program_interface_q uery"))) || 478 (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_program_interface_q uery"))) ||
471 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) { 479 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) {
472 if (NULL == fFunctions.fGetProgramResourceLocation) { 480 if (NULL == fFunctions.fGetProgramResourceLocation) {
473 RETURN_FALSE_INTERFACE 481 RETURN_FALSE_INTERFACE
474 } 482 }
475 } 483 }
476 484
477 if (kGLES_GrGLStandard == fStandard || glVer >= GR_GL_VER(4,1) || 485 if (kGLES_GrGLStandard == fStandard || glVer >= GR_GL_VER(4,1) ||
478 fExtensions.has("GL_ARB_ES2_compatibility")) { 486 fExtensions.has("GL_ARB_ES2_compatibility")) {
479 #if 0 // Enable this once Chrome gives us the function ptr 487 #if 0 // Enable this once Chrome gives us the function ptr
480 if (NULL == fFunctions.fGetShaderPrecisionFormat) { 488 if (NULL == fFunctions.fGetShaderPrecisionFormat) {
481 RETURN_FALSE_INTERFACE 489 RETURN_FALSE_INTERFACE
482 } 490 }
483 #endif 491 #endif
484 } 492 }
485 493
486 if (fExtensions.has("GL_NV_path_rendering")) { 494 if (fExtensions.has("GL_NV_path_rendering")) {
487 if (NULL == fFunctions.fMatrixLoadf || 495 if (NULL == fFunctions.fPathCommands ||
488 NULL == fFunctions.fMatrixLoadIdentity ||
489 NULL == fFunctions.fPathCommands ||
490 NULL == fFunctions.fPathCoords || 496 NULL == fFunctions.fPathCoords ||
491 NULL == fFunctions.fPathParameteri || 497 NULL == fFunctions.fPathParameteri ||
492 NULL == fFunctions.fPathParameterf || 498 NULL == fFunctions.fPathParameterf ||
493 NULL == fFunctions.fGenPaths || 499 NULL == fFunctions.fGenPaths ||
494 NULL == fFunctions.fDeletePaths || 500 NULL == fFunctions.fDeletePaths ||
495 NULL == fFunctions.fIsPath || 501 NULL == fFunctions.fIsPath ||
496 NULL == fFunctions.fPathStencilFunc || 502 NULL == fFunctions.fPathStencilFunc ||
497 NULL == fFunctions.fStencilFillPath || 503 NULL == fFunctions.fStencilFillPath ||
498 NULL == fFunctions.fStencilStrokePath || 504 NULL == fFunctions.fStencilStrokePath ||
499 NULL == fFunctions.fStencilFillPathInstanced || 505 NULL == fFunctions.fStencilFillPathInstanced ||
(...skipping 27 matching lines...) Expand all
527 RETURN_FALSE_INTERFACE 533 RETURN_FALSE_INTERFACE
528 } 534 }
529 } 535 }
530 536
531 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) { 537 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) {
532 if (NULL == fFunctions.fCoverageModulation) { 538 if (NULL == fFunctions.fCoverageModulation) {
533 RETURN_FALSE_INTERFACE 539 RETURN_FALSE_INTERFACE
534 } 540 }
535 } 541 }
536 542
537 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1)) ||
538 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
539 fExtensions.has("GL_ARB_draw_instanced") ||
540 fExtensions.has("GL_EXT_draw_instanced")) {
541 if (NULL == fFunctions.fDrawArraysInstanced ||
542 NULL == fFunctions.fDrawElementsInstanced) {
543 RETURN_FALSE_INTERFACE
544 }
545 }
546
547 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,2)) ||
548 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
549 fExtensions.has("GL_ARB_instanced_arrays") ||
550 fExtensions.has("GL_EXT_instanced_arrays")) {
551 if (NULL == fFunctions.fVertexAttribDivisor) {
552 RETURN_FALSE_INTERFACE
553 }
554 if (kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_stat e_access")) {
555 if (NULL == fFunctions.fVertexArrayVertexAttribDivisor) {
556 RETURN_FALSE_INTERFACE
557 }
558 }
559 }
560
561 if (fExtensions.has("GL_NV_bindless_texture")) {
562 if (NULL == fFunctions.fGetTextureHandle ||
563 NULL == fFunctions.fGetTextureSamplerHandle ||
564 NULL == fFunctions.fMakeTextureHandleResident ||
565 NULL == fFunctions.fMakeTextureHandleNonResident ||
566 NULL == fFunctions.fGetImageHandle ||
567 NULL == fFunctions.fMakeImageHandleResident ||
568 NULL == fFunctions.fMakeImageHandleNonResident ||
569 NULL == fFunctions.fIsTextureHandleResident ||
570 NULL == fFunctions.fIsImageHandleResident ||
571 NULL == fFunctions.fUniformHandleui64 ||
572 NULL == fFunctions.fUniformHandleui64v ||
573 NULL == fFunctions.fProgramUniformHandleui64 ||
574 NULL == fFunctions.fProgramUniformHandleui64v) {
575 RETURN_FALSE_INTERFACE
576 }
577 }
578
579 if (kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_state_ac cess")) {
580 if (NULL == fFunctions.fTextureParameteri ||
581 NULL == fFunctions.fTextureParameteriv ||
582 NULL == fFunctions.fTextureParameterf ||
583 NULL == fFunctions.fTextureParameterfv ||
584 NULL == fFunctions.fTextureImage1D ||
585 NULL == fFunctions.fTextureImage2D ||
586 NULL == fFunctions.fTextureSubImage1D ||
587 NULL == fFunctions.fTextureSubImage2D ||
588 NULL == fFunctions.fCopyTextureImage1D ||
589 NULL == fFunctions.fCopyTextureImage2D ||
590 NULL == fFunctions.fCopyTextureSubImage1D ||
591 NULL == fFunctions.fCopyTextureSubImage2D ||
592 NULL == fFunctions.fGetTextureImage ||
593 NULL == fFunctions.fGetTextureParameterfv ||
594 NULL == fFunctions.fGetTextureParameteriv ||
595 NULL == fFunctions.fGetTextureLevelParameterfv ||
596 NULL == fFunctions.fGetTextureLevelParameteriv) {
597 RETURN_FALSE_INTERFACE
598 }
599 if (glVer >= GR_GL_VER(1,2)) {
600 if (NULL == fFunctions.fTextureImage3D ||
601 NULL == fFunctions.fTextureSubImage3D ||
602 NULL == fFunctions.fCopyTextureSubImage3D ||
603 NULL == fFunctions.fCompressedTextureImage3D ||
604 NULL == fFunctions.fCompressedTextureImage2D ||
605 NULL == fFunctions.fCompressedTextureImage1D ||
606 NULL == fFunctions.fCompressedTextureSubImage3D ||
607 NULL == fFunctions.fCompressedTextureSubImage2D ||
608 NULL == fFunctions.fCompressedTextureSubImage1D ||
609 NULL == fFunctions.fGetCompressedTextureImage) {
610 RETURN_FALSE_INTERFACE
611 }
612 }
613 if (glVer >= GR_GL_VER(1,5)) {
614 if (NULL == fFunctions.fNamedBufferData ||
615 NULL == fFunctions.fNamedBufferSubData ||
616 NULL == fFunctions.fMapNamedBuffer ||
617 NULL == fFunctions.fUnmapNamedBuffer ||
618 NULL == fFunctions.fGetNamedBufferParameteriv ||
619 NULL == fFunctions.fGetNamedBufferPointerv ||
620 NULL == fFunctions.fGetNamedBufferSubData) {
621 RETURN_FALSE_INTERFACE
622 }
623 }
624 if (glVer >= GR_GL_VER(2,0)) {
625 if (NULL == fFunctions.fProgramUniform1f ||
626 NULL == fFunctions.fProgramUniform2f ||
627 NULL == fFunctions.fProgramUniform3f ||
628 NULL == fFunctions.fProgramUniform4f ||
629 NULL == fFunctions.fProgramUniform1i ||
630 NULL == fFunctions.fProgramUniform2i ||
631 NULL == fFunctions.fProgramUniform3i ||
632 NULL == fFunctions.fProgramUniform4i ||
633 NULL == fFunctions.fProgramUniform1fv ||
634 NULL == fFunctions.fProgramUniform2fv ||
635 NULL == fFunctions.fProgramUniform3fv ||
636 NULL == fFunctions.fProgramUniform4fv ||
637 NULL == fFunctions.fProgramUniform1iv ||
638 NULL == fFunctions.fProgramUniform2iv ||
639 NULL == fFunctions.fProgramUniform3iv ||
640 NULL == fFunctions.fProgramUniform4iv ||
641 NULL == fFunctions.fProgramUniformMatrix2fv ||
642 NULL == fFunctions.fProgramUniformMatrix3fv ||
643 NULL == fFunctions.fProgramUniformMatrix4fv) {
644 RETURN_FALSE_INTERFACE
645 }
646 }
647 if (glVer >= GR_GL_VER(2,1)) {
648 if (NULL == fFunctions.fProgramUniformMatrix2x3fv ||
649 NULL == fFunctions.fProgramUniformMatrix3x2fv ||
650 NULL == fFunctions.fProgramUniformMatrix2x4fv ||
651 NULL == fFunctions.fProgramUniformMatrix4x2fv ||
652 NULL == fFunctions.fProgramUniformMatrix3x4fv ||
653 NULL == fFunctions.fProgramUniformMatrix4x3fv) {
654 RETURN_FALSE_INTERFACE
655 }
656 }
657 if (glVer >= GR_GL_VER(3,0)) {
658 if (NULL == fFunctions.fNamedRenderbufferStorage ||
659 NULL == fFunctions.fGetNamedRenderbufferParameteriv ||
660 NULL == fFunctions.fNamedRenderbufferStorageMultisample ||
661 NULL == fFunctions.fCheckNamedFramebufferStatus ||
662 NULL == fFunctions.fNamedFramebufferTexture1D ||
663 NULL == fFunctions.fNamedFramebufferTexture2D ||
664 NULL == fFunctions.fNamedFramebufferTexture3D ||
665 NULL == fFunctions.fNamedFramebufferRenderbuffer ||
666 NULL == fFunctions.fGetNamedFramebufferAttachmentParameteriv ||
667 NULL == fFunctions.fGenerateTextureMipmap ||
668 NULL == fFunctions.fFramebufferDrawBuffer ||
669 NULL == fFunctions.fFramebufferDrawBuffers ||
670 NULL == fFunctions.fFramebufferReadBuffer ||
671 NULL == fFunctions.fGetFramebufferParameteriv ||
672 NULL == fFunctions.fNamedCopyBufferSubData ||
673 NULL == fFunctions.fVertexArrayVertexOffset ||
674 NULL == fFunctions.fVertexArrayColorOffset ||
675 NULL == fFunctions.fVertexArrayEdgeFlagOffset ||
676 NULL == fFunctions.fVertexArrayIndexOffset ||
677 NULL == fFunctions.fVertexArrayNormalOffset ||
678 NULL == fFunctions.fVertexArrayTexCoordOffset ||
679 NULL == fFunctions.fVertexArrayMultiTexCoordOffset ||
680 NULL == fFunctions.fVertexArrayFogCoordOffset ||
681 NULL == fFunctions.fVertexArraySecondaryColorOffset ||
682 NULL == fFunctions.fVertexArrayVertexAttribOffset ||
683 NULL == fFunctions.fVertexArrayVertexAttribIOffset ||
684 NULL == fFunctions.fEnableVertexArray ||
685 NULL == fFunctions.fDisableVertexArray ||
686 NULL == fFunctions.fEnableVertexArrayAttrib ||
687 NULL == fFunctions.fDisableVertexArrayAttrib ||
688 NULL == fFunctions.fGetVertexArrayIntegerv ||
689 NULL == fFunctions.fGetVertexArrayPointerv ||
690 NULL == fFunctions.fGetVertexArrayIntegeri_v ||
691 NULL == fFunctions.fGetVertexArrayPointeri_v ||
692 NULL == fFunctions.fMapNamedBufferRange ||
693 NULL == fFunctions.fFlushMappedNamedBufferRange) {
694 RETURN_FALSE_INTERFACE
695 }
696 }
697 }
698
699 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
700 fExtensions.has("GL_KHR_debug")) {
701 if (NULL == fFunctions.fDebugMessageControl ||
702 NULL == fFunctions.fDebugMessageInsert ||
703 NULL == fFunctions.fDebugMessageCallback ||
704 NULL == fFunctions.fGetDebugMessageLog ||
705 NULL == fFunctions.fPushDebugGroup ||
706 NULL == fFunctions.fPopDebugGroup ||
707 NULL == fFunctions.fObjectLabel) {
708 RETURN_FALSE_INTERFACE
709 }
710 }
711
712 return true; 543 return true;
713 } 544 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | src/gpu/gl/GrGLNoOpInterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698