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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 621673002: command_buffer: Remove unused shared id code (GenSharedIdsCHROMIUM, ...) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 // A class to emulate GLES2 over command buffers. 5 // A class to emulate GLES2 over command buffers.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <GLES2/gl2ext.h> 9 #include <GLES2/gl2ext.h>
10 #include <GLES2/gl2extchromium.h> 10 #include <GLES2/gl2extchromium.h>
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } 320 }
321 321
322 GLES2CmdHelper* GLES2Implementation::helper() const { 322 GLES2CmdHelper* GLES2Implementation::helper() const {
323 return helper_; 323 return helper_;
324 } 324 }
325 325
326 IdHandlerInterface* GLES2Implementation::GetIdHandler(int namespace_id) const { 326 IdHandlerInterface* GLES2Implementation::GetIdHandler(int namespace_id) const {
327 return share_group_->GetIdHandler(namespace_id); 327 return share_group_->GetIdHandler(namespace_id);
328 } 328 }
329 329
330 IdAllocatorInterface* GLES2Implementation::GetIdAllocator( 330 IdAllocator* GLES2Implementation::GetIdAllocator(int namespace_id) const {
331 int namespace_id) const {
332 if (namespace_id == id_namespaces::kQueries) 331 if (namespace_id == id_namespaces::kQueries)
333 return query_id_allocator_.get(); 332 return query_id_allocator_.get();
334 NOTREACHED(); 333 NOTREACHED();
335 return NULL; 334 return NULL;
336 } 335 }
337 336
338 void* GLES2Implementation::GetResultBuffer() { 337 void* GLES2Implementation::GetResultBuffer() {
339 return transfer_buffer_->GetResultBuffer(); 338 return transfer_buffer_->GetResultBuffer();
340 } 339 }
341 340
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 helper_->SwapBuffers(); 946 helper_->SwapBuffers();
948 helper_->CommandBufferHelper::Flush(); 947 helper_->CommandBufferHelper::Flush();
949 // Wait if we added too many swap buffers. Add 1 to kMaxSwapBuffers to 948 // Wait if we added too many swap buffers. Add 1 to kMaxSwapBuffers to
950 // compensate for TODO above. 949 // compensate for TODO above.
951 if (swap_buffers_tokens_.size() > kMaxSwapBuffers + 1) { 950 if (swap_buffers_tokens_.size() > kMaxSwapBuffers + 1) {
952 helper_->WaitForToken(swap_buffers_tokens_.front()); 951 helper_->WaitForToken(swap_buffers_tokens_.front());
953 swap_buffers_tokens_.pop(); 952 swap_buffers_tokens_.pop();
954 } 953 }
955 } 954 }
956 955
957 void GLES2Implementation::GenSharedIdsCHROMIUM(
958 GLuint namespace_id, GLuint id_offset, GLsizei n, GLuint* ids) {
959 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenSharedIdsCHROMIUM("
960 << namespace_id << ", " << id_offset << ", " << n << ", " <<
961 static_cast<void*>(ids) << ")");
962 TRACE_EVENT0("gpu", "GLES2::GenSharedIdsCHROMIUM");
963 GLsizei num = n;
964 GLuint* dst = ids;
965 while (num) {
966 ScopedTransferBufferArray<GLint> id_buffer(num, helper_, transfer_buffer_);
967 if (!id_buffer.valid()) {
968 return;
969 }
970 helper_->GenSharedIdsCHROMIUM(
971 namespace_id, id_offset, id_buffer.num_elements(),
972 id_buffer.shm_id(), id_buffer.offset());
973 WaitForCmd();
974 memcpy(dst, id_buffer.address(), sizeof(*dst) * id_buffer.num_elements());
975 num -= id_buffer.num_elements();
976 dst += id_buffer.num_elements();
977 }
978 GPU_CLIENT_LOG_CODE_BLOCK({
979 for (GLsizei i = 0; i < n; ++i) {
980 GPU_CLIENT_LOG(" " << i << ": " << namespace_id << ", " << ids[i]);
981 }
982 });
983 }
984
985 void GLES2Implementation::DeleteSharedIdsCHROMIUM(
986 GLuint namespace_id, GLsizei n, const GLuint* ids) {
987 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteSharedIdsCHROMIUM("
988 << namespace_id << ", " << n << ", "
989 << static_cast<const void*>(ids) << ")");
990 GPU_CLIENT_LOG_CODE_BLOCK({
991 for (GLsizei i = 0; i < n; ++i) {
992 GPU_CLIENT_LOG(" " << i << ": " << namespace_id << ", " << ids[i]);
993 }
994 });
995 TRACE_EVENT0("gpu", "GLES2::DeleteSharedIdsCHROMIUM");
996 while (n) {
997 ScopedTransferBufferArray<GLint> id_buffer(n, helper_, transfer_buffer_);
998 if (!id_buffer.valid()) {
999 return;
1000 }
1001 memcpy(id_buffer.address(), ids, sizeof(*ids) * id_buffer.num_elements());
1002 helper_->DeleteSharedIdsCHROMIUM(
1003 namespace_id, id_buffer.num_elements(),
1004 id_buffer.shm_id(), id_buffer.offset());
1005 WaitForCmd();
1006 n -= id_buffer.num_elements();
1007 ids += id_buffer.num_elements();
1008 }
1009 }
1010
1011 void GLES2Implementation::RegisterSharedIdsCHROMIUM(
1012 GLuint namespace_id, GLsizei n, const GLuint* ids) {
1013 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glRegisterSharedIdsCHROMIUM("
1014 << namespace_id << ", " << n << ", "
1015 << static_cast<const void*>(ids) << ")");
1016 GPU_CLIENT_LOG_CODE_BLOCK({
1017 for (GLsizei i = 0; i < n; ++i) {
1018 GPU_CLIENT_LOG(" " << i << ": " << namespace_id << ", " << ids[i]);
1019 }
1020 });
1021 TRACE_EVENT0("gpu", "GLES2::RegisterSharedIdsCHROMIUM");
1022 while (n) {
1023 ScopedTransferBufferArray<GLint> id_buffer(n, helper_, transfer_buffer_);
1024 if (!id_buffer.valid()) {
1025 return;
1026 }
1027 memcpy(id_buffer.address(), ids, sizeof(*ids) * id_buffer.num_elements());
1028 helper_->RegisterSharedIdsCHROMIUM(
1029 namespace_id, id_buffer.num_elements(),
1030 id_buffer.shm_id(), id_buffer.offset());
1031 WaitForCmd();
1032 n -= id_buffer.num_elements();
1033 ids += id_buffer.num_elements();
1034 }
1035 }
1036
1037 void GLES2Implementation::BindAttribLocation( 956 void GLES2Implementation::BindAttribLocation(
1038 GLuint program, GLuint index, const char* name) { 957 GLuint program, GLuint index, const char* name) {
1039 GPU_CLIENT_SINGLE_THREAD_CHECK(); 958 GPU_CLIENT_SINGLE_THREAD_CHECK();
1040 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindAttribLocation(" 959 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBindAttribLocation("
1041 << program << ", " << index << ", " << name << ")"); 960 << program << ", " << index << ", " << name << ")");
1042 SetBucketAsString(kResultBucketId, name); 961 SetBucketAsString(kResultBucketId, name);
1043 helper_->BindAttribLocationBucket(program, index, kResultBucketId); 962 helper_->BindAttribLocationBucket(program, index, kResultBucketId);
1044 helper_->SetBucketSize(kResultBucketId, 0); 963 helper_->SetBucketSize(kResultBucketId, 0);
1045 CheckGLError(); 964 CheckGLError();
1046 } 965 }
(...skipping 3143 matching lines...) Expand 10 before | Expand all | Expand 10 after
4190 return true; 4109 return true;
4191 } 4110 }
4192 4111
4193 // Include the auto-generated part of this file. We split this because it means 4112 // Include the auto-generated part of this file. We split this because it means
4194 // we can easily edit the non-auto generated parts right here in this file 4113 // we can easily edit the non-auto generated parts right here in this file
4195 // instead of having to edit some template or the code generator. 4114 // instead of having to edit some template or the code generator.
4196 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 4115 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
4197 4116
4198 } // namespace gles2 4117 } // namespace gles2
4199 } // namespace gpu 4118 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698