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

Side by Side Diff: ui/gl/gl_bindings_skia_in_process.cc

Issue 952893003: Update from https://crrev.com/317530 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix gn for nacl Created 5 years, 9 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 | « ui/gl/gl_bindings_autogen_mock.cc ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 222 }
223 223
224 GLvoid StubGLFinish() { 224 GLvoid StubGLFinish() {
225 glFinish(); 225 glFinish();
226 } 226 }
227 227
228 GLvoid StubGLFlush() { 228 GLvoid StubGLFlush() {
229 glFlush(); 229 glFlush();
230 } 230 }
231 231
232 GLvoid StubGLFlushMappedBufferRange(GLenum target, GLintptr offset,
233 GLsizeiptr length) {
234 glFlushMappedBufferRange(target, offset, length);
235 }
236
232 GLvoid StubGLFramebufferRenderbuffer(GLenum target, GLenum attachment, 237 GLvoid StubGLFramebufferRenderbuffer(GLenum target, GLenum attachment,
233 GLenum renderbuffertarget, 238 GLenum renderbuffertarget,
234 GLuint renderbuffer) { 239 GLuint renderbuffer) {
235 glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, 240 glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget,
236 renderbuffer); 241 renderbuffer);
237 } 242 }
238 243
239 GLvoid StubGLFramebufferTexture2D(GLenum target, GLenum attachment, 244 GLvoid StubGLFramebufferTexture2D(GLenum target, GLenum attachment,
240 GLenum textarget, GLuint texture, 245 GLenum textarget, GLuint texture,
241 GLint level) { 246 GLint level) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 329
325 GLvoid StubGLGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, 330 GLvoid StubGLGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
326 GLint *range, GLint *precision) { 331 GLint *range, GLint *precision) {
327 glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); 332 glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
328 } 333 }
329 334
330 const GLubyte* StubGLGetString(GLenum name) { 335 const GLubyte* StubGLGetString(GLenum name) {
331 return glGetString(name); 336 return glGetString(name);
332 } 337 }
333 338
339 const GLubyte* StubGLGetStringi(GLenum name, GLuint index) {
340 return glGetStringi(name, index);
341 }
342
334 GLvoid StubGLGetQueryiv(GLenum target, GLenum pname, GLint* params) { 343 GLvoid StubGLGetQueryiv(GLenum target, GLenum pname, GLint* params) {
335 glGetQueryiv(target, pname, params); 344 glGetQueryiv(target, pname, params);
336 } 345 }
337 346
338 GLvoid StubGLGetQueryObjecti64v(GLuint id, GLenum pname, GLint64* params) { 347 GLvoid StubGLGetQueryObjecti64v(GLuint id, GLenum pname, GLint64* params) {
339 glGetQueryObjecti64v(id, pname, params); 348 glGetQueryObjecti64v(id, pname, params);
340 } 349 }
341 350
342 GLvoid StubGLGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) { 351 GLvoid StubGLGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) {
343 glGetQueryObjectiv(id, pname, params); 352 glGetQueryObjectiv(id, pname, params);
(...skipping 13 matching lines...) Expand all
357 } 366 }
358 367
359 GLint StubGLGetUniformLocation(GLuint program, const char* name) { 368 GLint StubGLGetUniformLocation(GLuint program, const char* name) {
360 return glGetUniformLocation(program, name); 369 return glGetUniformLocation(program, name);
361 } 370 }
362 371
363 GLvoid StubGLInsertEventMarker(GLsizei length, const char* marker) { 372 GLvoid StubGLInsertEventMarker(GLsizei length, const char* marker) {
364 glInsertEventMarkerEXT(length, marker); 373 glInsertEventMarkerEXT(length, marker);
365 } 374 }
366 375
376 GLvoid StubGLInvalidateFramebuffer(GLenum target, GLsizei numAttachments,
377 const GLenum* attachments) {
378 glInvalidateFramebuffer(target, numAttachments, attachments);
379 }
380
381 GLvoid StubGLInvalidateSubFramebuffer(GLenum target,
382 GLsizei numAttachments,
383 const GLenum* attachments,
384 GLint x, GLint y,
385 GLsizei width, GLsizei height) {
386 glInvalidateSubFramebuffer(target, numAttachments, attachments,
387 x, y, width, height);
388 }
389
367 GLvoid StubGLLineWidth(GLfloat width) { 390 GLvoid StubGLLineWidth(GLfloat width) {
368 glLineWidth(width); 391 glLineWidth(width);
369 } 392 }
370 393
371 GLvoid StubGLLinkProgram(GLuint program) { 394 GLvoid StubGLLinkProgram(GLuint program) {
372 glLinkProgram(program); 395 glLinkProgram(program);
373 } 396 }
374 397
375 void* StubGLMapBuffer(GLenum target, GLenum access) { 398 void* StubGLMapBuffer(GLenum target, GLenum access) {
376 return glMapBuffer(target, access); 399 return glMapBuffer(target, access);
377 } 400 }
378 401
402 void* StubGLMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
403 GLbitfield access) {
404 return glMapBufferRange(target, offset, length, access);
405 }
406
379 GLvoid StubGLPixelStorei(GLenum pname, GLint param) { 407 GLvoid StubGLPixelStorei(GLenum pname, GLint param) {
380 glPixelStorei(pname, param); 408 glPixelStorei(pname, param);
381 } 409 }
382 410
383 GLvoid StubGLPopGroupMarker() { 411 GLvoid StubGLPopGroupMarker() {
384 glPopGroupMarkerEXT(); 412 glPopGroupMarkerEXT();
385 } 413 }
386 414
387 GLvoid StubGLPushGroupMarker(GLsizei length, const char* marker) { 415 GLvoid StubGLPushGroupMarker(GLsizei length, const char* marker) {
388 glPushGroupMarkerEXT(length, marker); 416 glPushGroupMarkerEXT(length, marker);
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 610
583 GLvoid StubGLVertexAttribPointer(GLuint indx, GLint size, GLenum type, 611 GLvoid StubGLVertexAttribPointer(GLuint indx, GLint size, GLenum type,
584 GLboolean normalized, GLsizei stride, 612 GLboolean normalized, GLsizei stride,
585 const void* ptr) { 613 const void* ptr) {
586 glVertexAttribPointer(indx, size, type, normalized, stride, ptr); 614 glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
587 } 615 }
588 616
589 GLvoid StubGLViewport(GLint x, GLint y, GLsizei width, GLsizei height) { 617 GLvoid StubGLViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
590 glViewport(x, y, width, height); 618 glViewport(x, y, width, height);
591 } 619 }
620
621 GLint StubGLGetProgramResourceLocation(GLuint program,
622 GLenum programInterface,
623 const char* name) {
624 return glGetProgramResourceLocation(program, programInterface, name);
625 }
626
592 } // extern "C" 627 } // extern "C"
593 } // namespace 628 } // namespace
594 629
595 namespace gfx { 630 namespace gfx {
596 631
597 GrGLInterface* CreateInProcessSkiaGLBinding() { 632 GrGLInterface* CreateInProcessSkiaGLBinding() {
598 GrGLStandard standard; 633 GrGLStandard standard;
599 switch (gfx::GetGLImplementation()) { 634 switch (gfx::GetGLImplementation()) {
600 case gfx::kGLImplementationNone: 635 case gfx::kGLImplementationNone:
601 NOTREACHED(); 636 NOTREACHED();
(...skipping 13 matching lines...) Expand all
615 return NULL; 650 return NULL;
616 default: 651 default:
617 NOTREACHED(); 652 NOTREACHED();
618 return NULL; 653 return NULL;
619 } 654 }
620 655
621 GrGLInterface* interface = new GrGLInterface; 656 GrGLInterface* interface = new GrGLInterface;
622 interface->fStandard = standard; 657 interface->fStandard = standard;
623 interface->fExtensions.init(standard, 658 interface->fExtensions.init(standard,
624 StubGLGetString, 659 StubGLGetString,
625 NULL, 660 StubGLGetStringi,
626 StubGLGetIntegerv); 661 StubGLGetIntegerv);
627 662
628 GrGLInterface::Functions* functions = &interface->fFunctions; 663 GrGLInterface::Functions* functions = &interface->fFunctions;
629 functions->fActiveTexture = StubGLActiveTexture; 664 functions->fActiveTexture = StubGLActiveTexture;
630 functions->fAttachShader = StubGLAttachShader; 665 functions->fAttachShader = StubGLAttachShader;
631 functions->fBeginQuery = StubGLBeginQuery; 666 functions->fBeginQuery = StubGLBeginQuery;
632 functions->fBindAttribLocation = StubGLBindAttribLocation; 667 functions->fBindAttribLocation = StubGLBindAttribLocation;
633 functions->fBindBuffer = StubGLBindBuffer; 668 functions->fBindBuffer = StubGLBindBuffer;
634 functions->fBindFragDataLocation = StubGLBindFragDataLocation; 669 functions->fBindFragDataLocation = StubGLBindFragDataLocation;
635 functions->fBindTexture = StubGLBindTexture; 670 functions->fBindTexture = StubGLBindTexture;
(...skipping 24 matching lines...) Expand all
660 functions->fDiscardFramebuffer = StubGLDiscardFramebuffer; 695 functions->fDiscardFramebuffer = StubGLDiscardFramebuffer;
661 functions->fDrawArrays = StubGLDrawArrays; 696 functions->fDrawArrays = StubGLDrawArrays;
662 functions->fDrawBuffer = StubGLDrawBuffer; 697 functions->fDrawBuffer = StubGLDrawBuffer;
663 functions->fDrawBuffers = StubGLDrawBuffers; 698 functions->fDrawBuffers = StubGLDrawBuffers;
664 functions->fDrawElements = StubGLDrawElements; 699 functions->fDrawElements = StubGLDrawElements;
665 functions->fEnable = StubGLEnable; 700 functions->fEnable = StubGLEnable;
666 functions->fEnableVertexAttribArray = StubGLEnableVertexAttribArray; 701 functions->fEnableVertexAttribArray = StubGLEnableVertexAttribArray;
667 functions->fEndQuery = StubGLEndQuery; 702 functions->fEndQuery = StubGLEndQuery;
668 functions->fFinish = StubGLFinish; 703 functions->fFinish = StubGLFinish;
669 functions->fFlush = StubGLFlush; 704 functions->fFlush = StubGLFlush;
705 functions->fFlushMappedBufferRange = StubGLFlushMappedBufferRange;
670 functions->fFrontFace = StubGLFrontFace; 706 functions->fFrontFace = StubGLFrontFace;
671 functions->fGenBuffers = StubGLGenBuffers; 707 functions->fGenBuffers = StubGLGenBuffers;
672 functions->fGenQueries = StubGLGenQueries; 708 functions->fGenQueries = StubGLGenQueries;
673 functions->fGenTextures = StubGLGenTextures; 709 functions->fGenTextures = StubGLGenTextures;
674 functions->fGenVertexArrays = StubGLGenVertexArrays; 710 functions->fGenVertexArrays = StubGLGenVertexArrays;
675 functions->fGenerateMipmap = StubGLGenerateMipmap; 711 functions->fGenerateMipmap = StubGLGenerateMipmap;
676 functions->fGetBufferParameteriv = StubGLGetBufferParameteriv; 712 functions->fGetBufferParameteriv = StubGLGetBufferParameteriv;
677 functions->fGetError = StubGLGetError; 713 functions->fGetError = StubGLGetError;
678 functions->fGetIntegerv = StubGLGetIntegerv; 714 functions->fGetIntegerv = StubGLGetIntegerv;
679 functions->fGetQueryiv = StubGLGetQueryiv; 715 functions->fGetQueryiv = StubGLGetQueryiv;
680 functions->fGetQueryObjecti64v = StubGLGetQueryObjecti64v; 716 functions->fGetQueryObjecti64v = StubGLGetQueryObjecti64v;
681 functions->fGetQueryObjectiv = StubGLGetQueryObjectiv; 717 functions->fGetQueryObjectiv = StubGLGetQueryObjectiv;
682 functions->fGetQueryObjectui64v = StubGLGetQueryObjectui64v; 718 functions->fGetQueryObjectui64v = StubGLGetQueryObjectui64v;
683 functions->fGetQueryObjectuiv = StubGLGetQueryObjectuiv; 719 functions->fGetQueryObjectuiv = StubGLGetQueryObjectuiv;
684 functions->fGetProgramInfoLog = StubGLGetProgramInfoLog; 720 functions->fGetProgramInfoLog = StubGLGetProgramInfoLog;
685 functions->fGetProgramiv = StubGLGetProgramiv; 721 functions->fGetProgramiv = StubGLGetProgramiv;
686 functions->fGetShaderInfoLog = StubGLGetShaderInfoLog; 722 functions->fGetShaderInfoLog = StubGLGetShaderInfoLog;
687 functions->fGetShaderiv = StubGLGetShaderiv; 723 functions->fGetShaderiv = StubGLGetShaderiv;
688 functions->fGetShaderPrecisionFormat = StubGLGetShaderPrecisionFormat; 724 functions->fGetShaderPrecisionFormat = StubGLGetShaderPrecisionFormat;
689 functions->fGetString = StubGLGetString; 725 functions->fGetString = StubGLGetString;
726 functions->fGetStringi = StubGLGetStringi;
690 functions->fGetTexLevelParameteriv = StubGLGetTexLevelParameteriv; 727 functions->fGetTexLevelParameteriv = StubGLGetTexLevelParameteriv;
691 functions->fGetUniformLocation = StubGLGetUniformLocation; 728 functions->fGetUniformLocation = StubGLGetUniformLocation;
692 functions->fInsertEventMarker = StubGLInsertEventMarker; 729 functions->fInsertEventMarker = StubGLInsertEventMarker;
730 functions->fInvalidateFramebuffer = StubGLInvalidateFramebuffer;
731 functions->fInvalidateSubFramebuffer = StubGLInvalidateSubFramebuffer;
693 functions->fLineWidth = StubGLLineWidth; 732 functions->fLineWidth = StubGLLineWidth;
694 functions->fLinkProgram = StubGLLinkProgram; 733 functions->fLinkProgram = StubGLLinkProgram;
734 functions->fMapBufferRange = StubGLMapBufferRange;
695 functions->fPixelStorei = StubGLPixelStorei; 735 functions->fPixelStorei = StubGLPixelStorei;
696 functions->fPopGroupMarker = StubGLPopGroupMarker; 736 functions->fPopGroupMarker = StubGLPopGroupMarker;
697 functions->fPushGroupMarker = StubGLPushGroupMarker; 737 functions->fPushGroupMarker = StubGLPushGroupMarker;
698 functions->fQueryCounter = StubGLQueryCounter; 738 functions->fQueryCounter = StubGLQueryCounter;
699 functions->fReadBuffer = StubGLReadBuffer; 739 functions->fReadBuffer = StubGLReadBuffer;
700 functions->fReadPixels = StubGLReadPixels; 740 functions->fReadPixels = StubGLReadPixels;
701 functions->fScissor = StubGLScissor; 741 functions->fScissor = StubGLScissor;
702 functions->fShaderSource = StubGLShaderSource; 742 functions->fShaderSource = StubGLShaderSource;
703 functions->fStencilFunc = StubGLStencilFunc; 743 functions->fStencilFunc = StubGLStencilFunc;
704 functions->fStencilFuncSeparate = StubGLStencilFuncSeparate; 744 functions->fStencilFuncSeparate = StubGLStencilFuncSeparate;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 functions->fFramebufferTexture2DMultisample = 787 functions->fFramebufferTexture2DMultisample =
748 StubGLFramebufferTexture2DMultisample; 788 StubGLFramebufferTexture2DMultisample;
749 functions->fGenFramebuffers = StubGLGenFramebuffers; 789 functions->fGenFramebuffers = StubGLGenFramebuffers;
750 functions->fGenRenderbuffers = StubGLGenRenderbuffers; 790 functions->fGenRenderbuffers = StubGLGenRenderbuffers;
751 functions->fGetFramebufferAttachmentParameteriv = 791 functions->fGetFramebufferAttachmentParameteriv =
752 StubGLGetFramebufferAttachmentParameteriv; 792 StubGLGetFramebufferAttachmentParameteriv;
753 functions->fGetRenderbufferParameteriv = StubGLGetRenderbufferParameteriv; 793 functions->fGetRenderbufferParameteriv = StubGLGetRenderbufferParameteriv;
754 functions->fRenderbufferStorage = StubGLRenderbufferStorage; 794 functions->fRenderbufferStorage = StubGLRenderbufferStorage;
755 functions->fRenderbufferStorageMultisample = 795 functions->fRenderbufferStorageMultisample =
756 StubGLRenderbufferStorageMultisample; 796 StubGLRenderbufferStorageMultisample;
797 functions->fRenderbufferStorageMultisampleES2EXT =
798 StubGLRenderbufferStorageMultisample;
757 functions->fBlitFramebuffer = StubGLBlitFramebuffer; 799 functions->fBlitFramebuffer = StubGLBlitFramebuffer;
758 functions->fMapBuffer = StubGLMapBuffer; 800 functions->fMapBuffer = StubGLMapBuffer;
759 functions->fUnmapBuffer = StubGLUnmapBuffer; 801 functions->fUnmapBuffer = StubGLUnmapBuffer;
760 functions->fBindFragDataLocationIndexed = 802 functions->fBindFragDataLocationIndexed =
761 StubGLBindFragDataLocationIndexed; 803 StubGLBindFragDataLocationIndexed;
804 functions->fGetProgramResourceLocation = StubGLGetProgramResourceLocation;
762 805
763 return interface; 806 return interface;
764 } 807 }
765 808
766 } // namespace gfx 809 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_bindings_autogen_mock.cc ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698