| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 #include "ui/gl/gl_bindings_skia_in_process.h" | 6 #include "ui/gl/gl_bindings_skia_in_process.h" |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" | 9 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" |
| 10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 GLvoid StubGLBindVertexArray(GLuint array) { | 63 GLvoid StubGLBindVertexArray(GLuint array) { |
| 64 glBindVertexArrayOES(array); | 64 glBindVertexArrayOES(array); |
| 65 } | 65 } |
| 66 | 66 |
| 67 GLvoid StubGLBlendColor(GLclampf red, GLclampf green, GLclampf blue, | 67 GLvoid StubGLBlendColor(GLclampf red, GLclampf green, GLclampf blue, |
| 68 GLclampf alpha) { | 68 GLclampf alpha) { |
| 69 glBlendColor(red, green, blue, alpha); | 69 glBlendColor(red, green, blue, alpha); |
| 70 } | 70 } |
| 71 | 71 |
| 72 GLvoid StubGLBlendEquation(GLenum mode) { |
| 73 glBlendEquation(mode); |
| 74 } |
| 75 |
| 72 GLvoid StubGLBlendFunc(GLenum sfactor, GLenum dfactor) { | 76 GLvoid StubGLBlendFunc(GLenum sfactor, GLenum dfactor) { |
| 73 glBlendFunc(sfactor, dfactor); | 77 glBlendFunc(sfactor, dfactor); |
| 74 } | 78 } |
| 75 | 79 |
| 76 GLvoid StubGLBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, | 80 GLvoid StubGLBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, |
| 77 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, | 81 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, |
| 78 GLbitfield mask, GLenum filter) { | 82 GLbitfield mask, GLenum filter) { |
| 79 glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, | 83 glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, |
| 80 mask, filter); | 84 mask, filter); |
| 81 } | 85 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 193 |
| 190 GLvoid StubGLDiscardFramebuffer(GLenum target, GLsizei numAttachments, | 194 GLvoid StubGLDiscardFramebuffer(GLenum target, GLsizei numAttachments, |
| 191 const GLenum *attachments) { | 195 const GLenum *attachments) { |
| 192 glDiscardFramebufferEXT(target, numAttachments, attachments); | 196 glDiscardFramebufferEXT(target, numAttachments, attachments); |
| 193 } | 197 } |
| 194 | 198 |
| 195 GLvoid StubGLDrawArrays(GLenum mode, GLint first, GLsizei count) { | 199 GLvoid StubGLDrawArrays(GLenum mode, GLint first, GLsizei count) { |
| 196 glDrawArrays(mode, first, count); | 200 glDrawArrays(mode, first, count); |
| 197 } | 201 } |
| 198 | 202 |
| 203 GLvoid StubGLDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, |
| 204 GLsizei instanceCount) { |
| 205 glDrawArraysInstancedANGLE(mode, first, count, instanceCount); |
| 206 } |
| 207 |
| 208 |
| 199 GLvoid StubGLDrawBuffer(GLenum mode) { | 209 GLvoid StubGLDrawBuffer(GLenum mode) { |
| 200 glDrawBuffer(mode); | 210 glDrawBuffer(mode); |
| 201 } | 211 } |
| 202 | 212 |
| 203 GLvoid StubGLDrawBuffers(GLsizei n, const GLenum* bufs) { | 213 GLvoid StubGLDrawBuffers(GLsizei n, const GLenum* bufs) { |
| 204 glDrawBuffersARB(n, bufs); | 214 glDrawBuffersARB(n, bufs); |
| 205 } | 215 } |
| 206 | 216 |
| 207 GLvoid StubGLDrawElements(GLenum mode, GLsizei count, GLenum type, | 217 GLvoid StubGLDrawElements(GLenum mode, GLsizei count, GLenum type, |
| 208 const void* indices) { | 218 const void* indices) { |
| 209 glDrawElements(mode, count, type, indices); | 219 glDrawElements(mode, count, type, indices); |
| 210 } | 220 } |
| 211 | 221 |
| 222 GLvoid StubGLDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, |
| 223 const GLvoid *indices, |
| 224 GLsizei instanceCount) { |
| 225 glDrawElementsInstancedANGLE(mode, count, type, indices, instanceCount); |
| 226 } |
| 227 |
| 228 |
| 212 GLvoid StubGLEnable(GLenum cap) { | 229 GLvoid StubGLEnable(GLenum cap) { |
| 213 glEnable(cap); | 230 glEnable(cap); |
| 214 } | 231 } |
| 215 | 232 |
| 216 GLvoid StubGLEnableVertexAttribArray(GLuint index) { | 233 GLvoid StubGLEnableVertexAttribArray(GLuint index) { |
| 217 glEnableVertexAttribArray(index); | 234 glEnableVertexAttribArray(index); |
| 218 } | 235 } |
| 219 | 236 |
| 220 GLvoid StubGLEndQuery(GLenum target) { | 237 GLvoid StubGLEndQuery(GLenum target) { |
| 221 glEndQuery(target); | 238 glEndQuery(target); |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 } | 630 } |
| 614 | 631 |
| 615 GLvoid StubGLVertexAttrib3fv(GLuint indx, const GLfloat* values) { | 632 GLvoid StubGLVertexAttrib3fv(GLuint indx, const GLfloat* values) { |
| 616 glVertexAttrib3fv(indx, values); | 633 glVertexAttrib3fv(indx, values); |
| 617 } | 634 } |
| 618 | 635 |
| 619 GLvoid StubGLVertexAttrib4fv(GLuint indx, const GLfloat* values) { | 636 GLvoid StubGLVertexAttrib4fv(GLuint indx, const GLfloat* values) { |
| 620 glVertexAttrib4fv(indx, values); | 637 glVertexAttrib4fv(indx, values); |
| 621 } | 638 } |
| 622 | 639 |
| 640 GLvoid StubGLVertexAttribDivisor(GLuint index, GLuint divisor) { |
| 641 glVertexAttribDivisorANGLE(index, divisor); |
| 642 } |
| 643 |
| 623 GLvoid StubGLVertexAttribPointer(GLuint indx, GLint size, GLenum type, | 644 GLvoid StubGLVertexAttribPointer(GLuint indx, GLint size, GLenum type, |
| 624 GLboolean normalized, GLsizei stride, | 645 GLboolean normalized, GLsizei stride, |
| 625 const void* ptr) { | 646 const void* ptr) { |
| 626 glVertexAttribPointer(indx, size, type, normalized, stride, ptr); | 647 glVertexAttribPointer(indx, size, type, normalized, stride, ptr); |
| 627 } | 648 } |
| 628 | 649 |
| 629 GLvoid StubGLViewport(GLint x, GLint y, GLsizei width, GLsizei height) { | 650 GLvoid StubGLViewport(GLint x, GLint y, GLsizei width, GLsizei height) { |
| 630 glViewport(x, y, width, height); | 651 glViewport(x, y, width, height); |
| 631 } | 652 } |
| 632 | 653 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 GrGLInterface::Functions* functions = &interface->fFunctions; | 700 GrGLInterface::Functions* functions = &interface->fFunctions; |
| 680 functions->fActiveTexture = StubGLActiveTexture; | 701 functions->fActiveTexture = StubGLActiveTexture; |
| 681 functions->fAttachShader = StubGLAttachShader; | 702 functions->fAttachShader = StubGLAttachShader; |
| 682 functions->fBeginQuery = StubGLBeginQuery; | 703 functions->fBeginQuery = StubGLBeginQuery; |
| 683 functions->fBindAttribLocation = StubGLBindAttribLocation; | 704 functions->fBindAttribLocation = StubGLBindAttribLocation; |
| 684 functions->fBindBuffer = StubGLBindBuffer; | 705 functions->fBindBuffer = StubGLBindBuffer; |
| 685 functions->fBindFragDataLocation = StubGLBindFragDataLocation; | 706 functions->fBindFragDataLocation = StubGLBindFragDataLocation; |
| 686 functions->fBindTexture = StubGLBindTexture; | 707 functions->fBindTexture = StubGLBindTexture; |
| 687 functions->fBindVertexArray = StubGLBindVertexArray; | 708 functions->fBindVertexArray = StubGLBindVertexArray; |
| 688 functions->fBlendColor = StubGLBlendColor; | 709 functions->fBlendColor = StubGLBlendColor; |
| 710 functions->fBlendEquation = StubGLBlendEquation; |
| 689 functions->fBlendFunc = StubGLBlendFunc; | 711 functions->fBlendFunc = StubGLBlendFunc; |
| 690 functions->fBufferData = StubGLBufferData; | 712 functions->fBufferData = StubGLBufferData; |
| 691 functions->fBufferSubData = StubGLBufferSubData; | 713 functions->fBufferSubData = StubGLBufferSubData; |
| 692 functions->fClear = StubGLClear; | 714 functions->fClear = StubGLClear; |
| 693 functions->fClearColor = StubGLClearColor; | 715 functions->fClearColor = StubGLClearColor; |
| 694 functions->fClearStencil = StubGLClearStencil; | 716 functions->fClearStencil = StubGLClearStencil; |
| 695 functions->fColorMask = StubGLColorMask; | 717 functions->fColorMask = StubGLColorMask; |
| 696 functions->fCompileShader = StubGLCompileShader; | 718 functions->fCompileShader = StubGLCompileShader; |
| 697 functions->fCompressedTexImage2D = StubGLCompressedTexImage2D; | 719 functions->fCompressedTexImage2D = StubGLCompressedTexImage2D; |
| 698 functions->fCopyTexSubImage2D = StubGLCopyTexSubImage2D; | 720 functions->fCopyTexSubImage2D = StubGLCopyTexSubImage2D; |
| 699 functions->fCreateProgram = StubGLCreateProgram; | 721 functions->fCreateProgram = StubGLCreateProgram; |
| 700 functions->fCreateShader = StubGLCreateShader; | 722 functions->fCreateShader = StubGLCreateShader; |
| 701 functions->fCullFace = StubGLCullFace; | 723 functions->fCullFace = StubGLCullFace; |
| 702 functions->fDeleteBuffers = StubGLDeleteBuffers; | 724 functions->fDeleteBuffers = StubGLDeleteBuffers; |
| 703 functions->fDeleteProgram = StubGLDeleteProgram; | 725 functions->fDeleteProgram = StubGLDeleteProgram; |
| 704 functions->fDeleteQueries = StubGLDeleteQueries; | 726 functions->fDeleteQueries = StubGLDeleteQueries; |
| 705 functions->fDeleteShader = StubGLDeleteShader; | 727 functions->fDeleteShader = StubGLDeleteShader; |
| 706 functions->fDeleteTextures = StubGLDeleteTextures; | 728 functions->fDeleteTextures = StubGLDeleteTextures; |
| 707 functions->fDeleteVertexArrays = StubGLDeleteVertexArrays; | 729 functions->fDeleteVertexArrays = StubGLDeleteVertexArrays; |
| 708 functions->fDepthMask = StubGLDepthMask; | 730 functions->fDepthMask = StubGLDepthMask; |
| 709 functions->fDisable = StubGLDisable; | 731 functions->fDisable = StubGLDisable; |
| 710 functions->fDisableVertexAttribArray = StubGLDisableVertexAttribArray; | 732 functions->fDisableVertexAttribArray = StubGLDisableVertexAttribArray; |
| 711 functions->fDiscardFramebuffer = StubGLDiscardFramebuffer; | 733 functions->fDiscardFramebuffer = StubGLDiscardFramebuffer; |
| 712 functions->fDrawArrays = StubGLDrawArrays; | 734 functions->fDrawArrays = StubGLDrawArrays; |
| 735 functions->fDrawArraysInstanced = StubGLDrawArraysInstanced; |
| 713 functions->fDrawBuffer = StubGLDrawBuffer; | 736 functions->fDrawBuffer = StubGLDrawBuffer; |
| 714 functions->fDrawBuffers = StubGLDrawBuffers; | 737 functions->fDrawBuffers = StubGLDrawBuffers; |
| 715 functions->fDrawElements = StubGLDrawElements; | 738 functions->fDrawElements = StubGLDrawElements; |
| 739 functions->fDrawElementsInstanced = StubGLDrawElementsInstanced; |
| 716 functions->fEnable = StubGLEnable; | 740 functions->fEnable = StubGLEnable; |
| 717 functions->fEnableVertexAttribArray = StubGLEnableVertexAttribArray; | 741 functions->fEnableVertexAttribArray = StubGLEnableVertexAttribArray; |
| 718 functions->fEndQuery = StubGLEndQuery; | 742 functions->fEndQuery = StubGLEndQuery; |
| 719 functions->fFinish = StubGLFinish; | 743 functions->fFinish = StubGLFinish; |
| 720 functions->fFlush = StubGLFlush; | 744 functions->fFlush = StubGLFlush; |
| 721 functions->fFlushMappedBufferRange = StubGLFlushMappedBufferRange; | 745 functions->fFlushMappedBufferRange = StubGLFlushMappedBufferRange; |
| 722 functions->fFrontFace = StubGLFrontFace; | 746 functions->fFrontFace = StubGLFrontFace; |
| 723 functions->fGenBuffers = StubGLGenBuffers; | 747 functions->fGenBuffers = StubGLGenBuffers; |
| 724 functions->fGenQueries = StubGLGenQueries; | 748 functions->fGenQueries = StubGLGenQueries; |
| 725 functions->fGenTextures = StubGLGenTextures; | 749 functions->fGenTextures = StubGLGenTextures; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 functions->fUniform4fv = StubGLUniform4fv; | 808 functions->fUniform4fv = StubGLUniform4fv; |
| 785 functions->fUniform4iv = StubGLUniform4iv; | 809 functions->fUniform4iv = StubGLUniform4iv; |
| 786 functions->fUniformMatrix2fv = StubGLUniformMatrix2fv; | 810 functions->fUniformMatrix2fv = StubGLUniformMatrix2fv; |
| 787 functions->fUniformMatrix3fv = StubGLUniformMatrix3fv; | 811 functions->fUniformMatrix3fv = StubGLUniformMatrix3fv; |
| 788 functions->fUniformMatrix4fv = StubGLUniformMatrix4fv; | 812 functions->fUniformMatrix4fv = StubGLUniformMatrix4fv; |
| 789 functions->fUseProgram = StubGLUseProgram; | 813 functions->fUseProgram = StubGLUseProgram; |
| 790 functions->fVertexAttrib1f = StubGLVertexAttrib1f; | 814 functions->fVertexAttrib1f = StubGLVertexAttrib1f; |
| 791 functions->fVertexAttrib2fv = StubGLVertexAttrib2fv; | 815 functions->fVertexAttrib2fv = StubGLVertexAttrib2fv; |
| 792 functions->fVertexAttrib3fv = StubGLVertexAttrib3fv; | 816 functions->fVertexAttrib3fv = StubGLVertexAttrib3fv; |
| 793 functions->fVertexAttrib4fv = StubGLVertexAttrib4fv; | 817 functions->fVertexAttrib4fv = StubGLVertexAttrib4fv; |
| 818 functions->fVertexAttribDivisor = StubGLVertexAttribDivisor; |
| 794 functions->fVertexAttribPointer = StubGLVertexAttribPointer; | 819 functions->fVertexAttribPointer = StubGLVertexAttribPointer; |
| 795 functions->fViewport = StubGLViewport; | 820 functions->fViewport = StubGLViewport; |
| 796 functions->fBindFramebuffer = StubGLBindFramebuffer; | 821 functions->fBindFramebuffer = StubGLBindFramebuffer; |
| 797 functions->fBindRenderbuffer = StubGLBindRenderbuffer; | 822 functions->fBindRenderbuffer = StubGLBindRenderbuffer; |
| 798 functions->fCheckFramebufferStatus = StubGLCheckFramebufferStatus; | 823 functions->fCheckFramebufferStatus = StubGLCheckFramebufferStatus; |
| 799 functions->fDeleteFramebuffers = StubGLDeleteFramebuffers; | 824 functions->fDeleteFramebuffers = StubGLDeleteFramebuffers; |
| 800 functions->fDeleteRenderbuffers = StubGLDeleteRenderbuffers; | 825 functions->fDeleteRenderbuffers = StubGLDeleteRenderbuffers; |
| 801 functions->fFramebufferRenderbuffer = StubGLFramebufferRenderbuffer; | 826 functions->fFramebufferRenderbuffer = StubGLFramebufferRenderbuffer; |
| 802 functions->fFramebufferTexture2D = StubGLFramebufferTexture2D; | 827 functions->fFramebufferTexture2D = StubGLFramebufferTexture2D; |
| 803 functions->fFramebufferTexture2DMultisample = | 828 functions->fFramebufferTexture2DMultisample = |
| (...skipping 16 matching lines...) Expand all Loading... |
| 820 functions->fMapBuffer = StubGLMapBuffer; | 845 functions->fMapBuffer = StubGLMapBuffer; |
| 821 functions->fUnmapBuffer = StubGLUnmapBuffer; | 846 functions->fUnmapBuffer = StubGLUnmapBuffer; |
| 822 functions->fBindFragDataLocationIndexed = | 847 functions->fBindFragDataLocationIndexed = |
| 823 StubGLBindFragDataLocationIndexed; | 848 StubGLBindFragDataLocationIndexed; |
| 824 functions->fGetProgramResourceLocation = StubGLGetProgramResourceLocation; | 849 functions->fGetProgramResourceLocation = StubGLGetProgramResourceLocation; |
| 825 | 850 |
| 826 return interface; | 851 return interface; |
| 827 } | 852 } |
| 828 | 853 |
| 829 } // namespace gfx | 854 } // namespace gfx |
| OLD | NEW |