| OLD | NEW |
| 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 <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 2907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2918 | 2918 |
| 2919 // OpenGL ES 2.0 implicitly enables the desktop GL capability | 2919 // OpenGL ES 2.0 implicitly enables the desktop GL capability |
| 2920 // VERTEX_PROGRAM_POINT_SIZE and doesn't expose this enum. This fact | 2920 // VERTEX_PROGRAM_POINT_SIZE and doesn't expose this enum. This fact |
| 2921 // isn't well documented; it was discovered in the Khronos OpenGL ES | 2921 // isn't well documented; it was discovered in the Khronos OpenGL ES |
| 2922 // mailing list archives. It also implicitly enables the desktop GL | 2922 // mailing list archives. It also implicitly enables the desktop GL |
| 2923 // capability GL_POINT_SPRITE to provide access to the gl_PointCoord | 2923 // capability GL_POINT_SPRITE to provide access to the gl_PointCoord |
| 2924 // variable in fragment shaders. | 2924 // variable in fragment shaders. |
| 2925 if (!feature_info_->gl_version_info().BehavesLikeGLES()) { | 2925 if (!feature_info_->gl_version_info().BehavesLikeGLES()) { |
| 2926 glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); | 2926 glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); |
| 2927 glEnable(GL_POINT_SPRITE); | 2927 glEnable(GL_POINT_SPRITE); |
| 2928 } else if (feature_info_->gl_version_info().is_desktop_core_profile) { |
| 2929 // The desktop core profile changed how program point size mode is |
| 2930 // enabled. |
| 2931 glEnable(GL_PROGRAM_POINT_SIZE); |
| 2928 } | 2932 } |
| 2929 | 2933 |
| 2930 has_robustness_extension_ = | 2934 has_robustness_extension_ = |
| 2931 context->HasExtension("GL_ARB_robustness") || | 2935 context->HasExtension("GL_ARB_robustness") || |
| 2932 context->HasExtension("GL_KHR_robustness") || | 2936 context->HasExtension("GL_KHR_robustness") || |
| 2933 context->HasExtension("GL_EXT_robustness"); | 2937 context->HasExtension("GL_EXT_robustness"); |
| 2934 | 2938 |
| 2935 if (!InitializeShaderTranslator()) { | 2939 if (!InitializeShaderTranslator()) { |
| 2936 return false; | 2940 return false; |
| 2937 } | 2941 } |
| (...skipping 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5536 return true; | 5540 return true; |
| 5537 } | 5541 } |
| 5538 return GetHelper(pname, NULL, num_values); | 5542 return GetHelper(pname, NULL, num_values); |
| 5539 } | 5543 } |
| 5540 | 5544 |
| 5541 GLenum GLES2DecoderImpl::AdjustGetPname(GLenum pname) { | 5545 GLenum GLES2DecoderImpl::AdjustGetPname(GLenum pname) { |
| 5542 if (GL_MAX_SAMPLES == pname && | 5546 if (GL_MAX_SAMPLES == pname && |
| 5543 features().use_img_for_multisampled_render_to_texture) { | 5547 features().use_img_for_multisampled_render_to_texture) { |
| 5544 return GL_MAX_SAMPLES_IMG; | 5548 return GL_MAX_SAMPLES_IMG; |
| 5545 } | 5549 } |
| 5550 if (GL_ALIASED_POINT_SIZE_RANGE == pname && |
| 5551 feature_info_->gl_version_info().is_desktop_core_profile) { |
| 5552 return GL_POINT_SIZE_RANGE; |
| 5553 } |
| 5546 return pname; | 5554 return pname; |
| 5547 } | 5555 } |
| 5548 | 5556 |
| 5549 void GLES2DecoderImpl::DoGetBooleanv(GLenum pname, GLboolean* params) { | 5557 void GLES2DecoderImpl::DoGetBooleanv(GLenum pname, GLboolean* params) { |
| 5550 DCHECK(params); | 5558 DCHECK(params); |
| 5551 GLsizei num_written = 0; | 5559 GLsizei num_written = 0; |
| 5552 if (GetNumValuesReturnedForGLGet(pname, &num_written)) { | 5560 if (GetNumValuesReturnedForGLGet(pname, &num_written)) { |
| 5553 scoped_ptr<GLint[]> values(new GLint[num_written]); | 5561 scoped_ptr<GLint[]> values(new GLint[num_written]); |
| 5554 if (!state_.GetStateAsGLint(pname, values.get(), &num_written)) { | 5562 if (!state_.GetStateAsGLint(pname, values.get(), &num_written)) { |
| 5555 GetHelper(pname, values.get(), &num_written); | 5563 GetHelper(pname, values.get(), &num_written); |
| (...skipping 10069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15625 } | 15633 } |
| 15626 | 15634 |
| 15627 // Include the auto-generated part of this file. We split this because it means | 15635 // Include the auto-generated part of this file. We split this because it means |
| 15628 // we can easily edit the non-auto generated parts right here in this file | 15636 // we can easily edit the non-auto generated parts right here in this file |
| 15629 // instead of having to edit some template or the code generator. | 15637 // instead of having to edit some template or the code generator. |
| 15630 #include "base/macros.h" | 15638 #include "base/macros.h" |
| 15631 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 15639 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 15632 | 15640 |
| 15633 } // namespace gles2 | 15641 } // namespace gles2 |
| 15634 } // namespace gpu | 15642 } // namespace gpu |
| OLD | NEW |