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

Side by Side Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 63253002: Rename WebKit namespace to blink (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
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 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 5 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
6 6
7 #include "third_party/khronos/GLES2/gl2.h" 7 #include "third_party/khronos/GLES2/gl2.h"
8 #ifndef GL_GLEXT_PROTOTYPES 8 #ifndef GL_GLEXT_PROTOTYPES
9 #define GL_GLEXT_PROTOTYPES 1 9 #define GL_GLEXT_PROTOTYPES 1
10 #endif 10 #endif
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 } 603 }
604 604
605 void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM( 605 void WebGraphicsContext3DCommandBufferImpl::copyTextureToParentTextureCHROMIUM(
606 WebGLId texture, WebGLId parentTexture) { 606 WebGLId texture, WebGLId parentTexture) {
607 NOTIMPLEMENTED(); 607 NOTIMPLEMENTED();
608 } 608 }
609 609
610 DELEGATE_TO_GL(rateLimitOffscreenContextCHROMIUM, 610 DELEGATE_TO_GL(rateLimitOffscreenContextCHROMIUM,
611 RateLimitOffscreenContextCHROMIUM) 611 RateLimitOffscreenContextCHROMIUM)
612 612
613 WebKit::WebString WebGraphicsContext3DCommandBufferImpl:: 613 blink::WebString WebGraphicsContext3DCommandBufferImpl::
614 getRequestableExtensionsCHROMIUM() { 614 getRequestableExtensionsCHROMIUM() {
615 return WebKit::WebString::fromUTF8( 615 return blink::WebString::fromUTF8(
616 gl_->GetRequestableExtensionsCHROMIUM()); 616 gl_->GetRequestableExtensionsCHROMIUM());
617 } 617 }
618 618
619 DELEGATE_TO_GL_1(requestExtensionCHROMIUM, RequestExtensionCHROMIUM, 619 DELEGATE_TO_GL_1(requestExtensionCHROMIUM, RequestExtensionCHROMIUM,
620 const char*) 620 const char*)
621 621
622 void WebGraphicsContext3DCommandBufferImpl::blitFramebufferCHROMIUM( 622 void WebGraphicsContext3DCommandBufferImpl::blitFramebufferCHROMIUM(
623 WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, 623 WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1,
624 WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, 624 WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1,
625 WGC3Dbitfield mask, WGC3Denum filter) { 625 WGC3Dbitfield mask, WGC3Denum filter) {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 return false; 778 return false;
779 } 779 }
780 GLsizei length = 0; 780 GLsizei length = 0;
781 GLint size = -1; 781 GLint size = -1;
782 GLenum type = 0; 782 GLenum type = 0;
783 gl_->GetActiveAttrib( 783 gl_->GetActiveAttrib(
784 program, index, max_name_length, &length, &size, &type, name.get()); 784 program, index, max_name_length, &length, &size, &type, name.get());
785 if (size < 0) { 785 if (size < 0) {
786 return false; 786 return false;
787 } 787 }
788 info.name = WebKit::WebString::fromUTF8(name.get(), length); 788 info.name = blink::WebString::fromUTF8(name.get(), length);
789 info.type = type; 789 info.type = type;
790 info.size = size; 790 info.size = size;
791 return true; 791 return true;
792 } 792 }
793 793
794 bool WebGraphicsContext3DCommandBufferImpl::getActiveUniform( 794 bool WebGraphicsContext3DCommandBufferImpl::getActiveUniform(
795 WebGLId program, WGC3Duint index, ActiveInfo& info) { 795 WebGLId program, WGC3Duint index, ActiveInfo& info) {
796 GLint max_name_length = -1; 796 GLint max_name_length = -1;
797 gl_->GetProgramiv( 797 gl_->GetProgramiv(
798 program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &max_name_length); 798 program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &max_name_length);
799 if (max_name_length < 0) 799 if (max_name_length < 0)
800 return false; 800 return false;
801 scoped_ptr<GLchar[]> name(new GLchar[max_name_length]); 801 scoped_ptr<GLchar[]> name(new GLchar[max_name_length]);
802 if (!name) { 802 if (!name) {
803 synthesizeGLError(GL_OUT_OF_MEMORY); 803 synthesizeGLError(GL_OUT_OF_MEMORY);
804 return false; 804 return false;
805 } 805 }
806 GLsizei length = 0; 806 GLsizei length = 0;
807 GLint size = -1; 807 GLint size = -1;
808 GLenum type = 0; 808 GLenum type = 0;
809 gl_->GetActiveUniform( 809 gl_->GetActiveUniform(
810 program, index, max_name_length, &length, &size, &type, name.get()); 810 program, index, max_name_length, &length, &size, &type, name.get());
811 if (size < 0) { 811 if (size < 0) {
812 return false; 812 return false;
813 } 813 }
814 info.name = WebKit::WebString::fromUTF8(name.get(), length); 814 info.name = blink::WebString::fromUTF8(name.get(), length);
815 info.type = type; 815 info.type = type;
816 info.size = size; 816 info.size = size;
817 return true; 817 return true;
818 } 818 }
819 819
820 DELEGATE_TO_GL_4(getAttachedShaders, GetAttachedShaders, 820 DELEGATE_TO_GL_4(getAttachedShaders, GetAttachedShaders,
821 WebGLId, WGC3Dsizei, WGC3Dsizei*, WebGLId*) 821 WebGLId, WGC3Dsizei, WGC3Dsizei*, WebGLId*)
822 822
823 DELEGATE_TO_GL_2R(getAttribLocation, GetAttribLocation, 823 DELEGATE_TO_GL_2R(getAttribLocation, GetAttribLocation,
824 WebGLId, const WGC3Dchar*, WGC3Dint) 824 WebGLId, const WGC3Dchar*, WGC3Dint)
825 825
826 DELEGATE_TO_GL_2(getBooleanv, GetBooleanv, WGC3Denum, WGC3Dboolean*) 826 DELEGATE_TO_GL_2(getBooleanv, GetBooleanv, WGC3Denum, WGC3Dboolean*)
827 827
828 DELEGATE_TO_GL_3(getBufferParameteriv, GetBufferParameteriv, 828 DELEGATE_TO_GL_3(getBufferParameteriv, GetBufferParameteriv,
829 WGC3Denum, WGC3Denum, WGC3Dint*) 829 WGC3Denum, WGC3Denum, WGC3Dint*)
830 830
831 WebKit::WebGraphicsContext3D::Attributes 831 blink::WebGraphicsContext3D::Attributes
832 WebGraphicsContext3DCommandBufferImpl::getContextAttributes() { 832 WebGraphicsContext3DCommandBufferImpl::getContextAttributes() {
833 return attributes_; 833 return attributes_;
834 } 834 }
835 835
836 WGC3Denum WebGraphicsContext3DCommandBufferImpl::getError() { 836 WGC3Denum WebGraphicsContext3DCommandBufferImpl::getError() {
837 if (!synthetic_errors_.empty()) { 837 if (!synthetic_errors_.empty()) {
838 std::vector<WGC3Denum>::iterator iter = synthetic_errors_.begin(); 838 std::vector<WGC3Denum>::iterator iter = synthetic_errors_.begin();
839 WGC3Denum err = *iter; 839 WGC3Denum err = *iter;
840 synthetic_errors_.erase(iter); 840 synthetic_errors_.erase(iter);
841 return err; 841 return err;
(...skipping 11 matching lines...) Expand all
853 DELEGATE_TO_GL_2(getFloatv, GetFloatv, WGC3Denum, WGC3Dfloat*) 853 DELEGATE_TO_GL_2(getFloatv, GetFloatv, WGC3Denum, WGC3Dfloat*)
854 854
855 DELEGATE_TO_GL_4(getFramebufferAttachmentParameteriv, 855 DELEGATE_TO_GL_4(getFramebufferAttachmentParameteriv,
856 GetFramebufferAttachmentParameteriv, 856 GetFramebufferAttachmentParameteriv,
857 WGC3Denum, WGC3Denum, WGC3Denum, WGC3Dint*) 857 WGC3Denum, WGC3Denum, WGC3Denum, WGC3Dint*)
858 858
859 DELEGATE_TO_GL_2(getIntegerv, GetIntegerv, WGC3Denum, WGC3Dint*) 859 DELEGATE_TO_GL_2(getIntegerv, GetIntegerv, WGC3Denum, WGC3Dint*)
860 860
861 DELEGATE_TO_GL_3(getProgramiv, GetProgramiv, WebGLId, WGC3Denum, WGC3Dint*) 861 DELEGATE_TO_GL_3(getProgramiv, GetProgramiv, WebGLId, WGC3Denum, WGC3Dint*)
862 862
863 WebKit::WebString WebGraphicsContext3DCommandBufferImpl::getProgramInfoLog( 863 blink::WebString WebGraphicsContext3DCommandBufferImpl::getProgramInfoLog(
864 WebGLId program) { 864 WebGLId program) {
865 GLint logLength = 0; 865 GLint logLength = 0;
866 gl_->GetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength); 866 gl_->GetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength);
867 if (!logLength) 867 if (!logLength)
868 return WebKit::WebString(); 868 return blink::WebString();
869 scoped_ptr<GLchar[]> log(new GLchar[logLength]); 869 scoped_ptr<GLchar[]> log(new GLchar[logLength]);
870 if (!log) 870 if (!log)
871 return WebKit::WebString(); 871 return blink::WebString();
872 GLsizei returnedLogLength = 0; 872 GLsizei returnedLogLength = 0;
873 gl_->GetProgramInfoLog( 873 gl_->GetProgramInfoLog(
874 program, logLength, &returnedLogLength, log.get()); 874 program, logLength, &returnedLogLength, log.get());
875 DCHECK_EQ(logLength, returnedLogLength + 1); 875 DCHECK_EQ(logLength, returnedLogLength + 1);
876 WebKit::WebString res = 876 blink::WebString res =
877 WebKit::WebString::fromUTF8(log.get(), returnedLogLength); 877 blink::WebString::fromUTF8(log.get(), returnedLogLength);
878 return res; 878 return res;
879 } 879 }
880 880
881 DELEGATE_TO_GL_3(getRenderbufferParameteriv, GetRenderbufferParameteriv, 881 DELEGATE_TO_GL_3(getRenderbufferParameteriv, GetRenderbufferParameteriv,
882 WGC3Denum, WGC3Denum, WGC3Dint*) 882 WGC3Denum, WGC3Denum, WGC3Dint*)
883 883
884 DELEGATE_TO_GL_3(getShaderiv, GetShaderiv, WebGLId, WGC3Denum, WGC3Dint*) 884 DELEGATE_TO_GL_3(getShaderiv, GetShaderiv, WebGLId, WGC3Denum, WGC3Dint*)
885 885
886 WebKit::WebString WebGraphicsContext3DCommandBufferImpl::getShaderInfoLog( 886 blink::WebString WebGraphicsContext3DCommandBufferImpl::getShaderInfoLog(
887 WebGLId shader) { 887 WebGLId shader) {
888 GLint logLength = 0; 888 GLint logLength = 0;
889 gl_->GetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength); 889 gl_->GetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength);
890 if (!logLength) 890 if (!logLength)
891 return WebKit::WebString(); 891 return blink::WebString();
892 scoped_ptr<GLchar[]> log(new GLchar[logLength]); 892 scoped_ptr<GLchar[]> log(new GLchar[logLength]);
893 if (!log) 893 if (!log)
894 return WebKit::WebString(); 894 return blink::WebString();
895 GLsizei returnedLogLength = 0; 895 GLsizei returnedLogLength = 0;
896 gl_->GetShaderInfoLog( 896 gl_->GetShaderInfoLog(
897 shader, logLength, &returnedLogLength, log.get()); 897 shader, logLength, &returnedLogLength, log.get());
898 DCHECK_EQ(logLength, returnedLogLength + 1); 898 DCHECK_EQ(logLength, returnedLogLength + 1);
899 WebKit::WebString res = 899 blink::WebString res =
900 WebKit::WebString::fromUTF8(log.get(), returnedLogLength); 900 blink::WebString::fromUTF8(log.get(), returnedLogLength);
901 return res; 901 return res;
902 } 902 }
903 903
904 DELEGATE_TO_GL_4(getShaderPrecisionFormat, GetShaderPrecisionFormat, 904 DELEGATE_TO_GL_4(getShaderPrecisionFormat, GetShaderPrecisionFormat,
905 WGC3Denum, WGC3Denum, WGC3Dint*, WGC3Dint*) 905 WGC3Denum, WGC3Denum, WGC3Dint*, WGC3Dint*)
906 906
907 WebKit::WebString WebGraphicsContext3DCommandBufferImpl::getShaderSource( 907 blink::WebString WebGraphicsContext3DCommandBufferImpl::getShaderSource(
908 WebGLId shader) { 908 WebGLId shader) {
909 GLint logLength = 0; 909 GLint logLength = 0;
910 gl_->GetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &logLength); 910 gl_->GetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &logLength);
911 if (!logLength) 911 if (!logLength)
912 return WebKit::WebString(); 912 return blink::WebString();
913 scoped_ptr<GLchar[]> log(new GLchar[logLength]); 913 scoped_ptr<GLchar[]> log(new GLchar[logLength]);
914 if (!log) 914 if (!log)
915 return WebKit::WebString(); 915 return blink::WebString();
916 GLsizei returnedLogLength = 0; 916 GLsizei returnedLogLength = 0;
917 gl_->GetShaderSource( 917 gl_->GetShaderSource(
918 shader, logLength, &returnedLogLength, log.get()); 918 shader, logLength, &returnedLogLength, log.get());
919 if (!returnedLogLength) 919 if (!returnedLogLength)
920 return WebKit::WebString(); 920 return blink::WebString();
921 DCHECK_EQ(logLength, returnedLogLength + 1); 921 DCHECK_EQ(logLength, returnedLogLength + 1);
922 WebKit::WebString res = 922 blink::WebString res =
923 WebKit::WebString::fromUTF8(log.get(), returnedLogLength); 923 blink::WebString::fromUTF8(log.get(), returnedLogLength);
924 return res; 924 return res;
925 } 925 }
926 926
927 WebKit::WebString WebGraphicsContext3DCommandBufferImpl:: 927 blink::WebString WebGraphicsContext3DCommandBufferImpl::
928 getTranslatedShaderSourceANGLE(WebGLId shader) { 928 getTranslatedShaderSourceANGLE(WebGLId shader) {
929 GLint logLength = 0; 929 GLint logLength = 0;
930 gl_->GetShaderiv( 930 gl_->GetShaderiv(
931 shader, GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE, &logLength); 931 shader, GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE, &logLength);
932 if (!logLength) 932 if (!logLength)
933 return WebKit::WebString(); 933 return blink::WebString();
934 scoped_ptr<GLchar[]> log(new GLchar[logLength]); 934 scoped_ptr<GLchar[]> log(new GLchar[logLength]);
935 if (!log) 935 if (!log)
936 return WebKit::WebString(); 936 return blink::WebString();
937 GLsizei returnedLogLength = 0; 937 GLsizei returnedLogLength = 0;
938 gl_->GetTranslatedShaderSourceANGLE( 938 gl_->GetTranslatedShaderSourceANGLE(
939 shader, logLength, &returnedLogLength, log.get()); 939 shader, logLength, &returnedLogLength, log.get());
940 if (!returnedLogLength) 940 if (!returnedLogLength)
941 return WebKit::WebString(); 941 return blink::WebString();
942 DCHECK_EQ(logLength, returnedLogLength + 1); 942 DCHECK_EQ(logLength, returnedLogLength + 1);
943 WebKit::WebString res = 943 blink::WebString res =
944 WebKit::WebString::fromUTF8(log.get(), returnedLogLength); 944 blink::WebString::fromUTF8(log.get(), returnedLogLength);
945 return res; 945 return res;
946 } 946 }
947 947
948 WebKit::WebString WebGraphicsContext3DCommandBufferImpl::getString( 948 blink::WebString WebGraphicsContext3DCommandBufferImpl::getString(
949 WGC3Denum name) { 949 WGC3Denum name) {
950 return WebKit::WebString::fromUTF8( 950 return blink::WebString::fromUTF8(
951 reinterpret_cast<const char*>(gl_->GetString(name))); 951 reinterpret_cast<const char*>(gl_->GetString(name)));
952 } 952 }
953 953
954 DELEGATE_TO_GL_3(getTexParameterfv, GetTexParameterfv, 954 DELEGATE_TO_GL_3(getTexParameterfv, GetTexParameterfv,
955 WGC3Denum, WGC3Denum, WGC3Dfloat*) 955 WGC3Denum, WGC3Denum, WGC3Dfloat*)
956 956
957 DELEGATE_TO_GL_3(getTexParameteriv, GetTexParameteriv, 957 DELEGATE_TO_GL_3(getTexParameteriv, GetTexParameteriv,
958 WGC3Denum, WGC3Denum, WGC3Dint*) 958 WGC3Denum, WGC3Denum, WGC3Dint*)
959 959
960 DELEGATE_TO_GL_3(getUniformfv, GetUniformfv, WebGLId, WGC3Dint, WGC3Dfloat*) 960 DELEGATE_TO_GL_3(getUniformfv, GetUniformfv, WebGLId, WGC3Dint, WGC3Dfloat*)
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 g_all_shared_contexts.Get().erase(host_.get()); 1455 g_all_shared_contexts.Get().erase(host_.get());
1456 } 1456 }
1457 1457
1458 if (ShouldUseSwapClient()) 1458 if (ShouldUseSwapClient())
1459 swap_client_->OnViewContextSwapBuffersAborted(); 1459 swap_client_->OnViewContextSwapBuffersAborted();
1460 } 1460 }
1461 1461
1462 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( 1462 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage(
1463 const std::string& message, int id) { 1463 const std::string& message, int id) {
1464 if (error_message_callback_) { 1464 if (error_message_callback_) {
1465 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); 1465 blink::WebString str = blink::WebString::fromUTF8(message.c_str());
1466 error_message_callback_->onErrorMessage(str, id); 1466 error_message_callback_->onErrorMessage(str, id);
1467 } 1467 }
1468 } 1468 }
1469 1469
1470 } // namespace content 1470 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h ('k') | content/common/indexed_db/indexed_db_key.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698