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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 859043005: Add Sync related APIs to GPU command buffer: Part I (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make win bots happy Created 5 years, 11 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 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 // Gets the service id for any simulated backbuffer fbo. 1271 // Gets the service id for any simulated backbuffer fbo.
1272 GLuint GetBackbufferServiceId() const; 1272 GLuint GetBackbufferServiceId() const;
1273 1273
1274 // Helper for glGetBooleanv, glGetFloatv and glGetIntegerv 1274 // Helper for glGetBooleanv, glGetFloatv and glGetIntegerv
1275 bool GetHelper(GLenum pname, GLint* params, GLsizei* num_written); 1275 bool GetHelper(GLenum pname, GLint* params, GLsizei* num_written);
1276 1276
1277 // Helper for glGetVertexAttrib 1277 // Helper for glGetVertexAttrib
1278 void GetVertexAttribHelper( 1278 void GetVertexAttribHelper(
1279 const VertexAttrib* attrib, GLenum pname, GLint* param); 1279 const VertexAttrib* attrib, GLenum pname, GLint* param);
1280 1280
1281 // Wrapper for glCreateProgram
1282 bool CreateProgramHelper(GLuint client_id);
1283
1284 // Wrapper for glCreateShader
1285 bool CreateShaderHelper(GLenum type, GLuint client_id);
1286
1287 // Wrapper for glActiveTexture 1281 // Wrapper for glActiveTexture
1288 void DoActiveTexture(GLenum texture_unit); 1282 void DoActiveTexture(GLenum texture_unit);
1289 1283
1290 // Wrapper for glAttachShader 1284 // Wrapper for glAttachShader
1291 void DoAttachShader(GLuint client_program_id, GLint client_shader_id); 1285 void DoAttachShader(GLuint client_program_id, GLint client_shader_id);
1292 1286
1293 // Wrapper for glBindBuffer since we need to track the current targets. 1287 // Wrapper for glBindBuffer since we need to track the current targets.
1294 void DoBindBuffer(GLenum target, GLuint buffer); 1288 void DoBindBuffer(GLenum target, GLuint buffer);
1295 1289
1296 // Wrapper for glBindFramebuffer since we need to track the current targets. 1290 // Wrapper for glBindFramebuffer since we need to track the current targets.
(...skipping 2745 matching lines...) Expand 10 before | Expand all | Expand 10 after
4042 } else { 4036 } else {
4043 return DoCommandsImpl<false>( 4037 return DoCommandsImpl<false>(
4044 num_commands, buffer, num_entries, entries_processed); 4038 num_commands, buffer, num_entries, entries_processed);
4045 } 4039 }
4046 } 4040 }
4047 4041
4048 void GLES2DecoderImpl::RemoveBuffer(GLuint client_id) { 4042 void GLES2DecoderImpl::RemoveBuffer(GLuint client_id) {
4049 buffer_manager()->RemoveBuffer(client_id); 4043 buffer_manager()->RemoveBuffer(client_id);
4050 } 4044 }
4051 4045
4052 bool GLES2DecoderImpl::CreateProgramHelper(GLuint client_id) {
4053 if (GetProgram(client_id)) {
4054 return false;
4055 }
4056 GLuint service_id = glCreateProgram();
4057 if (service_id != 0) {
4058 CreateProgram(client_id, service_id);
4059 }
4060 return true;
4061 }
4062
4063 bool GLES2DecoderImpl::CreateShaderHelper(GLenum type, GLuint client_id) {
4064 if (GetShader(client_id)) {
4065 return false;
4066 }
4067 GLuint service_id = glCreateShader(type);
4068 if (service_id != 0) {
4069 CreateShader(client_id, service_id, type);
4070 }
4071 return true;
4072 }
4073
4074 void GLES2DecoderImpl::DoFinish() { 4046 void GLES2DecoderImpl::DoFinish() {
4075 glFinish(); 4047 glFinish();
4076 ProcessPendingReadPixels(); 4048 ProcessPendingReadPixels();
4077 ProcessPendingQueries(true); 4049 ProcessPendingQueries(true);
4078 } 4050 }
4079 4051
4080 void GLES2DecoderImpl::DoFlush() { 4052 void GLES2DecoderImpl::DoFlush() {
4081 glFlush(); 4053 glFlush();
4082 ProcessPendingQueries(false); 4054 ProcessPendingQueries(false);
4083 } 4055 }
(...skipping 7550 matching lines...) Expand 10 before | Expand all | Expand 10 after
11634 } 11606 }
11635 } 11607 }
11636 11608
11637 // Include the auto-generated part of this file. We split this because it means 11609 // Include the auto-generated part of this file. We split this because it means
11638 // we can easily edit the non-auto generated parts right here in this file 11610 // we can easily edit the non-auto generated parts right here in this file
11639 // instead of having to edit some template or the code generator. 11611 // instead of having to edit some template or the code generator.
11640 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 11612 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
11641 11613
11642 } // namespace gles2 11614 } // namespace gles2
11643 } // namespace gpu 11615 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_group.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698