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

Side by Side Diff: gpu/blink/webgraphicscontext3d_impl.cc

Issue 1809553002: blink: Remove unused or rarely used methods from WebGraphicsContext3D (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wgc3d
Patch Set: wgc3d-unused: WebMediaPlayerAndroid::copyVideoTextureToPlatformTexture Created 4 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 | « gpu/blink/webgraphicscontext3d_impl.h ('k') | third_party/WebKit/Source/core/testing/DEPS » ('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 #include "gpu/blink/webgraphicscontext3d_impl.h" 5 #include "gpu/blink/webgraphicscontext3d_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/atomicops.h" 9 #include "base/atomicops.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 DELEGATE_TO_GL_R(insertFenceSyncCHROMIUM, InsertFenceSyncCHROMIUM, WGC3Duint64) 220 DELEGATE_TO_GL_R(insertFenceSyncCHROMIUM, InsertFenceSyncCHROMIUM, WGC3Duint64)
221 221
222 bool WebGraphicsContext3DImpl::genSyncTokenCHROMIUM(WGC3Duint64 fenceSync, 222 bool WebGraphicsContext3DImpl::genSyncTokenCHROMIUM(WGC3Duint64 fenceSync,
223 WGC3Dbyte* syncToken) { 223 WGC3Dbyte* syncToken) {
224 gl_->GenSyncTokenCHROMIUM(fenceSync, syncToken); 224 gl_->GenSyncTokenCHROMIUM(fenceSync, syncToken);
225 return true; 225 return true;
226 } 226 }
227 227
228 DELEGATE_TO_GL_1(waitSyncTokenCHROMIUM, WaitSyncTokenCHROMIUM, const WGC3Dbyte*) 228 DELEGATE_TO_GL_1(waitSyncTokenCHROMIUM, WaitSyncTokenCHROMIUM, const WGC3Dbyte*)
229 229
230 void WebGraphicsContext3DImpl::reshapeWithScaleFactor(int width,
231 int height,
232 float scale) {
233 gl_->ResizeCHROMIUM(width, height, scale, true);
234 }
235
236 DELEGATE_TO_GL_4R(mapBufferSubDataCHROMIUM, MapBufferSubDataCHROMIUM, WGC3Denum,
237 WGC3Dintptr, WGC3Dsizeiptr, WGC3Denum, void*)
238
239 DELEGATE_TO_GL_1(unmapBufferSubDataCHROMIUM, UnmapBufferSubDataCHROMIUM,
240 const void*)
241
242 DELEGATE_TO_GL_9R(mapTexSubImage2DCHROMIUM, MapTexSubImage2DCHROMIUM, WGC3Denum,
243 WGC3Dint, WGC3Dint, WGC3Dint, WGC3Dsizei, WGC3Dsizei,
244 WGC3Denum, WGC3Denum, WGC3Denum, void*)
245
246 DELEGATE_TO_GL_1(unmapTexSubImage2DCHROMIUM, UnmapTexSubImage2DCHROMIUM,
247 const void*)
248
249 DELEGATE_TO_GL_3(discardFramebufferEXT, DiscardFramebufferEXT, WGC3Denum, 230 DELEGATE_TO_GL_3(discardFramebufferEXT, DiscardFramebufferEXT, WGC3Denum,
250 WGC3Dsizei, const WGC3Denum*) 231 WGC3Dsizei, const WGC3Denum*)
251 232
252 blink::WebString WebGraphicsContext3DImpl:: 233 blink::WebString WebGraphicsContext3DImpl::
253 getRequestableExtensionsCHROMIUM() { 234 getRequestableExtensionsCHROMIUM() {
254 return blink::WebString::fromUTF8( 235 return blink::WebString::fromUTF8(
255 gl_->GetRequestableExtensionsCHROMIUM()); 236 gl_->GetRequestableExtensionsCHROMIUM());
256 } 237 }
257 238
258 DELEGATE_TO_GL_1(requestExtensionCHROMIUM, RequestExtensionCHROMIUM, 239 DELEGATE_TO_GL_1(requestExtensionCHROMIUM, RequestExtensionCHROMIUM,
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 void WebGraphicsContext3DImpl::setErrorMessageCallback( 809 void WebGraphicsContext3DImpl::setErrorMessageCallback(
829 WebGraphicsContext3D::WebGraphicsErrorMessageCallback* cb) { 810 WebGraphicsContext3D::WebGraphicsErrorMessageCallback* cb) {
830 error_message_callback_ = cb; 811 error_message_callback_ = cb;
831 } 812 }
832 813
833 void WebGraphicsContext3DImpl::setContextLostCallback( 814 void WebGraphicsContext3DImpl::setContextLostCallback(
834 WebGraphicsContext3D::WebGraphicsContextLostCallback* cb) { 815 WebGraphicsContext3D::WebGraphicsContextLostCallback* cb) {
835 context_lost_callback_ = cb; 816 context_lost_callback_ = cb;
836 } 817 }
837 818
838 DELEGATE_TO_GL_5(texImageIOSurface2DCHROMIUM, TexImageIOSurface2DCHROMIUM,
839 WGC3Denum, WGC3Dint, WGC3Dint, WGC3Duint, WGC3Duint)
840
841 DELEGATE_TO_GL_5(texStorage2DEXT, TexStorage2DEXT, 819 DELEGATE_TO_GL_5(texStorage2DEXT, TexStorage2DEXT,
842 WGC3Denum, WGC3Dint, WGC3Duint, WGC3Dint, WGC3Dint) 820 WGC3Denum, WGC3Dint, WGC3Duint, WGC3Dint, WGC3Dint)
843 821
844 WebGLId WebGraphicsContext3DImpl::createQueryEXT() { 822 WebGLId WebGraphicsContext3DImpl::createQueryEXT() {
845 GLuint o; 823 GLuint o;
846 gl_->GenQueriesEXT(1, &o); 824 gl_->GenQueriesEXT(1, &o);
847 return o; 825 return o;
848 } 826 }
849 827
850 void WebGraphicsContext3DImpl::deleteQueryEXT( 828 void WebGraphicsContext3DImpl::deleteQueryEXT(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 WGC3Dint, 861 WGC3Dint,
884 WGC3Dint, 862 WGC3Dint,
885 WGC3Dint, 863 WGC3Dint,
886 WGC3Dint, 864 WGC3Dint,
887 WGC3Dsizei, 865 WGC3Dsizei,
888 WGC3Dsizei, 866 WGC3Dsizei,
889 WGC3Dboolean, 867 WGC3Dboolean,
890 WGC3Dboolean, 868 WGC3Dboolean,
891 WGC3Dboolean); 869 WGC3Dboolean);
892 870
893 DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM,
894 WebGLId, WGC3Dint, const WGC3Dchar*)
895
896 void WebGraphicsContext3DImpl::shallowFlushCHROMIUM() {
897 flush_id_ = GenFlushID();
898 gl_->ShallowFlushCHROMIUM();
899 }
900
901 void WebGraphicsContext3DImpl::shallowFinishCHROMIUM() {
902 flush_id_ = GenFlushID();
903 gl_->ShallowFinishCHROMIUM();
904 }
905
906 void WebGraphicsContext3DImpl::loseContextCHROMIUM(
907 WGC3Denum current, WGC3Denum other) {
908 gl_->LoseContextCHROMIUM(current, other);
909 gl_->Flush();
910 }
911
912 DELEGATE_TO_GL_1(genMailboxCHROMIUM, GenMailboxCHROMIUM, WGC3Dbyte*) 871 DELEGATE_TO_GL_1(genMailboxCHROMIUM, GenMailboxCHROMIUM, WGC3Dbyte*)
913 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, 872 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM,
914 WGC3Denum, const WGC3Dbyte*) 873 WGC3Denum, const WGC3Dbyte*)
915 DELEGATE_TO_GL_3(produceTextureDirectCHROMIUM, ProduceTextureDirectCHROMIUM, 874 DELEGATE_TO_GL_3(produceTextureDirectCHROMIUM, ProduceTextureDirectCHROMIUM,
916 WebGLId, WGC3Denum, const WGC3Dbyte*) 875 WebGLId, WGC3Denum, const WGC3Dbyte*)
917 DELEGATE_TO_GL_2(consumeTextureCHROMIUM, ConsumeTextureCHROMIUM,
918 WGC3Denum, const WGC3Dbyte*)
919 DELEGATE_TO_GL_2R(createAndConsumeTextureCHROMIUM, 876 DELEGATE_TO_GL_2R(createAndConsumeTextureCHROMIUM,
920 CreateAndConsumeTextureCHROMIUM, 877 CreateAndConsumeTextureCHROMIUM,
921 WGC3Denum, const WGC3Dbyte*, WebGLId) 878 WGC3Denum, const WGC3Dbyte*, WebGLId)
922 879
923 DELEGATE_TO_GL_2(genValuebuffersCHROMIUM, 880 DELEGATE_TO_GL_2(genValuebuffersCHROMIUM,
924 GenValuebuffersCHROMIUM, 881 GenValuebuffersCHROMIUM,
925 WGC3Dsizei, 882 WGC3Dsizei,
926 WebGLId*); 883 WebGLId*);
927 884
928 WebGLId WebGraphicsContext3DImpl::createValuebufferCHROMIUM() { 885 WebGLId WebGraphicsContext3DImpl::createValuebufferCHROMIUM() {
(...skipping 24 matching lines...) Expand all
953 WGC3Denum, 910 WGC3Denum,
954 WGC3Denum); 911 WGC3Denum);
955 DELEGATE_TO_GL_1(populateSubscribedValuesCHROMIUM, 912 DELEGATE_TO_GL_1(populateSubscribedValuesCHROMIUM,
956 PopulateSubscribedValuesCHROMIUM, 913 PopulateSubscribedValuesCHROMIUM,
957 WGC3Denum); 914 WGC3Denum);
958 DELEGATE_TO_GL_3(uniformValuebufferCHROMIUM, 915 DELEGATE_TO_GL_3(uniformValuebufferCHROMIUM,
959 UniformValuebufferCHROMIUM, 916 UniformValuebufferCHROMIUM,
960 WGC3Dint, 917 WGC3Dint,
961 WGC3Denum, 918 WGC3Denum,
962 WGC3Denum); 919 WGC3Denum);
963 DELEGATE_TO_GL_2(traceBeginCHROMIUM,
964 TraceBeginCHROMIUM,
965 const WGC3Dchar*,
966 const WGC3Dchar*);
967 DELEGATE_TO_GL(traceEndCHROMIUM, TraceEndCHROMIUM);
968
969 void WebGraphicsContext3DImpl::insertEventMarkerEXT(
970 const WGC3Dchar* marker) {
971 gl_->InsertEventMarkerEXT(0, marker);
972 }
973 920
974 void WebGraphicsContext3DImpl::pushGroupMarkerEXT( 921 void WebGraphicsContext3DImpl::pushGroupMarkerEXT(
975 const WGC3Dchar* marker) { 922 const WGC3Dchar* marker) {
976 gl_->PushGroupMarkerEXT(0, marker); 923 gl_->PushGroupMarkerEXT(0, marker);
977 } 924 }
978 925
979 DELEGATE_TO_GL(popGroupMarkerEXT, PopGroupMarkerEXT);
980
981 WebGLId WebGraphicsContext3DImpl::createVertexArrayOES() { 926 WebGLId WebGraphicsContext3DImpl::createVertexArrayOES() {
982 GLuint array; 927 GLuint array;
983 gl_->GenVertexArraysOES(1, &array); 928 gl_->GenVertexArraysOES(1, &array);
984 return array; 929 return array;
985 } 930 }
986 931
987 void WebGraphicsContext3DImpl::deleteVertexArrayOES( 932 void WebGraphicsContext3DImpl::deleteVertexArrayOES(
988 WebGLId array) { 933 WebGLId array) {
989 gl_->DeleteVertexArraysOES(1, &array); 934 gl_->DeleteVertexArraysOES(1, &array);
990 } 935 }
991 936
992 DELEGATE_TO_GL_1R(isVertexArrayOES, IsVertexArrayOES, WebGLId, WGC3Dboolean) 937 DELEGATE_TO_GL_1R(isVertexArrayOES, IsVertexArrayOES, WebGLId, WGC3Dboolean)
993 DELEGATE_TO_GL_1(bindVertexArrayOES, BindVertexArrayOES, WebGLId) 938 DELEGATE_TO_GL_1(bindVertexArrayOES, BindVertexArrayOES, WebGLId)
994 939
995 DELEGATE_TO_GL_2(bindTexImage2DCHROMIUM, BindTexImage2DCHROMIUM, 940 DELEGATE_TO_GL_2(bindTexImage2DCHROMIUM, BindTexImage2DCHROMIUM,
996 WGC3Denum, WGC3Dint) 941 WGC3Denum, WGC3Dint)
997 DELEGATE_TO_GL_2(releaseTexImage2DCHROMIUM, ReleaseTexImage2DCHROMIUM, 942 DELEGATE_TO_GL_2(releaseTexImage2DCHROMIUM, ReleaseTexImage2DCHROMIUM,
998 WGC3Denum, WGC3Dint) 943 WGC3Denum, WGC3Dint)
999 944
1000 DELEGATE_TO_GL_2R(mapBufferCHROMIUM, MapBufferCHROMIUM, WGC3Denum, WGC3Denum,
1001 void*)
1002 DELEGATE_TO_GL_1R(unmapBufferCHROMIUM, UnmapBufferCHROMIUM, WGC3Denum,
1003 WGC3Dboolean)
1004
1005 DELEGATE_TO_GL_2(drawBuffersEXT, DrawBuffersEXT, WGC3Dsizei, const WGC3Denum*) 945 DELEGATE_TO_GL_2(drawBuffersEXT, DrawBuffersEXT, WGC3Dsizei, const WGC3Denum*)
1006 946
1007 DELEGATE_TO_GL_4(drawArraysInstancedANGLE, DrawArraysInstancedANGLE, WGC3Denum, 947 DELEGATE_TO_GL_4(drawArraysInstancedANGLE, DrawArraysInstancedANGLE, WGC3Denum,
1008 WGC3Dint, WGC3Dsizei, WGC3Dsizei) 948 WGC3Dint, WGC3Dsizei, WGC3Dsizei)
1009 949
1010 void WebGraphicsContext3DImpl::drawElementsInstancedANGLE( 950 void WebGraphicsContext3DImpl::drawElementsInstancedANGLE(
1011 WGC3Denum mode, 951 WGC3Denum mode,
1012 WGC3Dsizei count, 952 WGC3Dsizei count,
1013 WGC3Denum type, 953 WGC3Denum type,
1014 WGC3Dintptr offset, 954 WGC3Dintptr offset,
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 gl_->VertexAttribIPointer( 1149 gl_->VertexAttribIPointer(
1210 index, size, type, stride, 1150 index, size, type, stride,
1211 reinterpret_cast<void*>(static_cast<intptr_t>(offset))); 1151 reinterpret_cast<void*>(static_cast<intptr_t>(offset)));
1212 } 1152 }
1213 void WebGraphicsContext3DImpl::waitSync(WGC3Dsync sync, 1153 void WebGraphicsContext3DImpl::waitSync(WGC3Dsync sync,
1214 WGC3Dbitfield flags, 1154 WGC3Dbitfield flags,
1215 WGC3Duint64 timeout) { 1155 WGC3Duint64 timeout) {
1216 gl_->WaitSync(reinterpret_cast<GLsync>(sync), flags, timeout); 1156 gl_->WaitSync(reinterpret_cast<GLsync>(sync), flags, timeout);
1217 } 1157 }
1218 1158
1219 blink::WGC3Denum WebGraphicsContext3DImpl::getGraphicsResetStatusARB() {
1220 return gl_->GetGraphicsResetStatusKHR();
1221 }
1222
1223 ::gpu::gles2::GLES2Interface* WebGraphicsContext3DImpl::getGLES2Interface() { 1159 ::gpu::gles2::GLES2Interface* WebGraphicsContext3DImpl::getGLES2Interface() {
1224 return gl_; 1160 return gl_;
1225 } 1161 }
1226 1162
1227 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* 1163 ::gpu::gles2::GLES2ImplementationErrorMessageCallback*
1228 WebGraphicsContext3DImpl::getErrorMessageCallback() { 1164 WebGraphicsContext3DImpl::getErrorMessageCallback() {
1229 if (!client_error_message_callback_) { 1165 if (!client_error_message_callback_) {
1230 client_error_message_callback_.reset( 1166 client_error_message_callback_.reset(
1231 new WebGraphicsContext3DErrorMessageCallback(this)); 1167 new WebGraphicsContext3DErrorMessageCallback(this));
1232 } 1168 }
1233 return client_error_message_callback_.get(); 1169 return client_error_message_callback_.get();
1234 } 1170 }
1235 1171
1236 void WebGraphicsContext3DImpl::OnErrorMessage( 1172 void WebGraphicsContext3DImpl::OnErrorMessage(
1237 const std::string& message, int id) { 1173 const std::string& message, int id) {
1238 if (error_message_callback_) { 1174 if (error_message_callback_) {
1239 blink::WebString str = blink::WebString::fromUTF8(message.c_str()); 1175 blink::WebString str = blink::WebString::fromUTF8(message.c_str());
1240 error_message_callback_->onErrorMessage(str, id); 1176 error_message_callback_->onErrorMessage(str, id);
1241 } 1177 }
1242 } 1178 }
1243 1179
1244 // TODO(bajones): Look into removing these functions from the blink interface
1245 void WebGraphicsContext3DImpl::prepareTexture() {
1246 NOTREACHED();
1247 }
1248
1249 void WebGraphicsContext3DImpl::postSubBufferCHROMIUM(
1250 int x, int y, int width, int height) {
1251 NOTREACHED();
1252 }
1253
1254 void WebGraphicsContext3DImpl::setVisibilityCHROMIUM(
1255 bool visible) {
1256 NOTREACHED();
1257 }
1258
1259 void WebGraphicsContext3DImpl::copyTextureToParentTextureCHROMIUM(
1260 WebGLId texture, WebGLId parentTexture) {
1261 NOTIMPLEMENTED();
1262 }
1263
1264 void WebGraphicsContext3DImpl::releaseShaderCompiler() {
1265 }
1266
1267 // static 1180 // static
1268 void WebGraphicsContext3DImpl::ConvertAttributes( 1181 void WebGraphicsContext3DImpl::ConvertAttributes(
1269 const blink::WebGraphicsContext3D::Attributes& attributes, 1182 const blink::WebGraphicsContext3D::Attributes& attributes,
1270 ::gpu::gles2::ContextCreationAttribHelper* output_attribs) { 1183 ::gpu::gles2::ContextCreationAttribHelper* output_attribs) {
1271 output_attribs->alpha_size = attributes.alpha ? 8 : 0; 1184 output_attribs->alpha_size = attributes.alpha ? 8 : 0;
1272 output_attribs->depth_size = attributes.depth ? 24 : 0; 1185 output_attribs->depth_size = attributes.depth ? 24 : 0;
1273 // TODO(jinsukkim): Pass RGBA info directly from client by cleaning up 1186 // TODO(jinsukkim): Pass RGBA info directly from client by cleaning up
1274 // how this is passed to the constructor. 1187 // how this is passed to the constructor.
1275 #if defined(OS_ANDROID) 1188 #if defined(OS_ANDROID)
1276 if (base::SysInfo::IsLowEndDevice() && !attributes.alpha) { 1189 if (base::SysInfo::IsLowEndDevice() && !attributes.alpha) {
(...skipping 24 matching lines...) Expand all
1301 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL2; 1214 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_WEBGL2;
1302 break; 1215 break;
1303 default: 1216 default:
1304 NOTREACHED(); 1217 NOTREACHED();
1305 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2; 1218 output_attribs->context_type = ::gpu::gles2::CONTEXT_TYPE_OPENGLES2;
1306 break; 1219 break;
1307 } 1220 }
1308 } 1221 }
1309 1222
1310 } // namespace gpu_blink 1223 } // namespace gpu_blink
OLDNEW
« no previous file with comments | « gpu/blink/webgraphicscontext3d_impl.h ('k') | third_party/WebKit/Source/core/testing/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698