OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2849 } | 2849 } |
2850 } | 2850 } |
2851 | 2851 |
2852 void GLES2DecoderImpl::DoGenerateMipmap(GLenum target) { | 2852 void GLES2DecoderImpl::DoGenerateMipmap(GLenum target) { |
2853 TextureManager::TextureInfo* info = GetTextureInfoForTarget(target); | 2853 TextureManager::TextureInfo* info = GetTextureInfoForTarget(target); |
2854 if (!info || !texture_manager()->MarkMipmapsGenerated(feature_info_, info)) { | 2854 if (!info || !texture_manager()->MarkMipmapsGenerated(feature_info_, info)) { |
2855 SetGLError(GL_INVALID_OPERATION, | 2855 SetGLError(GL_INVALID_OPERATION, |
2856 "glGenerateMipmaps: Can not generate mips for npot textures"); | 2856 "glGenerateMipmaps: Can not generate mips for npot textures"); |
2857 return; | 2857 return; |
2858 } | 2858 } |
| 2859 // Workaround for Mac driver bug. In the large scheme of things setting |
| 2860 // glTexParamter twice for glGenerateMipmap is probably not a lage performance |
| 2861 // hit so there's probably no need to make this conditional. |
| 2862 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR); |
2859 glGenerateMipmapEXT(target); | 2863 glGenerateMipmapEXT(target); |
| 2864 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, info->min_filter()); |
2860 } | 2865 } |
2861 | 2866 |
2862 bool GLES2DecoderImpl::GetHelper( | 2867 bool GLES2DecoderImpl::GetHelper( |
2863 GLenum pname, GLint* params, GLsizei* num_written) { | 2868 GLenum pname, GLint* params, GLsizei* num_written) { |
2864 DCHECK(num_written); | 2869 DCHECK(num_written); |
2865 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { | 2870 if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { |
2866 switch (pname) { | 2871 switch (pname) { |
2867 case GL_IMPLEMENTATION_COLOR_READ_FORMAT: | 2872 case GL_IMPLEMENTATION_COLOR_READ_FORMAT: |
2868 *num_written = 1; | 2873 *num_written = 1; |
2869 if (params) { | 2874 if (params) { |
(...skipping 3514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6384 return error::kNoError; | 6389 return error::kNoError; |
6385 } | 6390 } |
6386 | 6391 |
6387 // Include the auto-generated part of this file. We split this because it means | 6392 // Include the auto-generated part of this file. We split this because it means |
6388 // we can easily edit the non-auto generated parts right here in this file | 6393 // we can easily edit the non-auto generated parts right here in this file |
6389 // instead of having to edit some template or the code generator. | 6394 // instead of having to edit some template or the code generator. |
6390 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 6395 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
6391 | 6396 |
6392 } // namespace gles2 | 6397 } // namespace gles2 |
6393 } // namespace gpu | 6398 } // namespace gpu |
OLD | NEW |