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

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

Issue 954183006: Add glDrawRangeElements to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 if (!vertex_array_object_manager_->SetupSimulatedIndexAndClientSideBuffers( 844 if (!vertex_array_object_manager_->SetupSimulatedIndexAndClientSideBuffers(
845 "glDrawElements", this, helper_, count, type, 0, indices, 845 "glDrawElements", this, helper_, count, type, 0, indices,
846 &offset, &simulated)) { 846 &offset, &simulated)) {
847 return; 847 return;
848 } 848 }
849 helper_->DrawElements(mode, count, type, offset); 849 helper_->DrawElements(mode, count, type, offset);
850 RestoreElementAndArrayBuffers(simulated); 850 RestoreElementAndArrayBuffers(simulated);
851 CheckGLError(); 851 CheckGLError();
852 } 852 }
853 853
854 void GLES2Implementation::DrawRangeElements(
855 GLenum mode, GLuint start, GLuint end,
856 GLsizei count, GLenum type, const void* indices) {
857 GPU_CLIENT_SINGLE_THREAD_CHECK();
858 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDrawRangeElements("
859 << GLES2Util::GetStringDrawMode(mode) << ", "
860 << start << ", " << end << ", " << count << ", "
861 << GLES2Util::GetStringIndexType(type) << ", "
862 << static_cast<const void*>(indices) << ")");
863 // TODO(zmo): mImplement client side data support.
864 // crbug.com/461871
865 helper_->DrawRangeElements(mode, start, end, count, type, ToGLuint(indices));
866 CheckGLError();
867 }
868
854 void GLES2Implementation::Flush() { 869 void GLES2Implementation::Flush() {
855 GPU_CLIENT_SINGLE_THREAD_CHECK(); 870 GPU_CLIENT_SINGLE_THREAD_CHECK();
856 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFlush()"); 871 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFlush()");
857 // Insert the cmd to call glFlush 872 // Insert the cmd to call glFlush
858 helper_->Flush(); 873 helper_->Flush();
859 // Flush our command buffer 874 // Flush our command buffer
860 // (tell the service to execute up to the flush cmd.) 875 // (tell the service to execute up to the flush cmd.)
861 helper_->CommandBufferHelper::Flush(); 876 helper_->CommandBufferHelper::Flush();
862 } 877 }
863 878
(...skipping 4127 matching lines...) Expand 10 before | Expand all | Expand 10 after
4991 CheckGLError(); 5006 CheckGLError();
4992 } 5007 }
4993 5008
4994 // Include the auto-generated part of this file. We split this because it means 5009 // Include the auto-generated part of this file. We split this because it means
4995 // we can easily edit the non-auto generated parts right here in this file 5010 // we can easily edit the non-auto generated parts right here in this file
4996 // instead of having to edit some template or the code generator. 5011 // instead of having to edit some template or the code generator.
4997 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 5012 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
4998 5013
4999 } // namespace gles2 5014 } // namespace gles2
5000 } // namespace gpu 5015 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698