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

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

Issue 169603002: Add initial support for NV_path_rendering extension to gpu command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 6 years, 4 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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 void DoReleaseTexImage2DCHROMIUM( 980 void DoReleaseTexImage2DCHROMIUM(
981 GLenum target, 981 GLenum target,
982 GLint image_id); 982 GLint image_id);
983 983
984 void DoTraceEndCHROMIUM(void); 984 void DoTraceEndCHROMIUM(void);
985 985
986 void DoDrawBuffersEXT(GLsizei count, const GLenum* bufs); 986 void DoDrawBuffersEXT(GLsizei count, const GLenum* bufs);
987 987
988 void DoLoseContextCHROMIUM(GLenum current, GLenum other); 988 void DoLoseContextCHROMIUM(GLenum current, GLenum other);
989 989
990 void DoMatrixLoadfCHROMIUM(GLenum matrix_mode, const GLfloat* matrix);
991 void DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode);
992
990 // Creates a Program for the given program. 993 // Creates a Program for the given program.
991 Program* CreateProgram( 994 Program* CreateProgram(
992 GLuint client_id, GLuint service_id) { 995 GLuint client_id, GLuint service_id) {
993 return program_manager()->CreateProgram(client_id, service_id); 996 return program_manager()->CreateProgram(client_id, service_id);
994 } 997 }
995 998
996 // Gets the program info for the given program. Returns NULL if none exists. 999 // Gets the program info for the given program. Returns NULL if none exists.
997 Program* GetProgram(GLuint client_id) { 1000 Program* GetProgram(GLuint client_id) {
998 return program_manager()->GetProgram(client_id); 1001 return program_manager()->GetProgram(client_id);
999 } 1002 }
(...skipping 9641 matching lines...) Expand 10 before | Expand all | Expand 10 after
10641 group_->set_draw_buffer(bufs[0]); 10644 group_->set_draw_buffer(bufs[0]);
10642 } 10645 }
10643 } 10646 }
10644 10647
10645 void GLES2DecoderImpl::DoLoseContextCHROMIUM(GLenum current, GLenum other) { 10648 void GLES2DecoderImpl::DoLoseContextCHROMIUM(GLenum current, GLenum other) {
10646 group_->LoseContexts(other); 10649 group_->LoseContexts(other);
10647 reset_status_ = current; 10650 reset_status_ = current;
10648 current_decoder_error_ = error::kLostContext; 10651 current_decoder_error_ = error::kLostContext;
10649 } 10652 }
10650 10653
10654 void GLES2DecoderImpl::DoMatrixLoadfCHROMIUM(GLenum matrix_mode,
10655 const GLfloat* matrix) {
10656 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM ||
10657 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM);
10658 if (!features().chromium_path_rendering) {
10659 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
10660 "glMatrixLoadfCHROMIUM",
10661 "function not available");
10662 return;
10663 }
10664
10665 GLfloat* target_matrix = matrix_mode == GL_PATH_PROJECTION_CHROMIUM
10666 ? state_.projection_matrix
10667 : state_.modelview_matrix;
10668 memcpy(target_matrix, matrix, sizeof(GLfloat) * 16);
10669 glMatrixLoadfEXT(matrix_mode, matrix);
vmiura 2014/08/25 19:42:22 We're using GL_PATH_MODELVIEW_CHROMIUM/GL_PATH_PRO
Kimmo Kinnunen 2014/08/26 06:48:33 Done. I added comments here and in gl_bindings.h
10670 }
10671
10672 void GLES2DecoderImpl::DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode) {
10673 DCHECK(matrix_mode == GL_PATH_PROJECTION_CHROMIUM ||
10674 matrix_mode == GL_PATH_MODELVIEW_CHROMIUM);
10675 if (!features().chromium_path_rendering) {
10676 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
10677 "glMatrixLoadIdentityCHROMIUM",
10678 "function not available");
10679 return;
10680 }
10681
10682 static GLfloat kIdentityMatrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f,
10683 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
10684 0.0f, 0.0f, 0.0f, 1.0f};
10685
10686 GLfloat* target_matrix = matrix_mode == GL_PATH_PROJECTION_CHROMIUM
10687 ? state_.projection_matrix
10688 : state_.modelview_matrix;
10689 memcpy(target_matrix, kIdentityMatrix, sizeof(kIdentityMatrix));
10690 glMatrixLoadIdentityEXT(matrix_mode);
10691 }
10692
10651 bool GLES2DecoderImpl::ValidateAsyncTransfer( 10693 bool GLES2DecoderImpl::ValidateAsyncTransfer(
10652 const char* function_name, 10694 const char* function_name,
10653 TextureRef* texture_ref, 10695 TextureRef* texture_ref,
10654 GLenum target, 10696 GLenum target,
10655 GLint level, 10697 GLint level,
10656 const void * data) { 10698 const void * data) {
10657 // We only support async uploads to 2D textures for now. 10699 // We only support async uploads to 2D textures for now.
10658 if (GL_TEXTURE_2D != target) { 10700 if (GL_TEXTURE_2D != target) {
10659 LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, target, "target"); 10701 LOCAL_SET_GL_ERROR_INVALID_ENUM(function_name, target, "target");
10660 return false; 10702 return false;
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
10957 } 10999 }
10958 } 11000 }
10959 11001
10960 // Include the auto-generated part of this file. We split this because it means 11002 // Include the auto-generated part of this file. We split this because it means
10961 // we can easily edit the non-auto generated parts right here in this file 11003 // we can easily edit the non-auto generated parts right here in this file
10962 // instead of having to edit some template or the code generator. 11004 // instead of having to edit some template or the code generator.
10963 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 11005 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10964 11006
10965 } // namespace gles2 11007 } // namespace gles2
10966 } // namespace gpu 11008 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info_unittest.cc ('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