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 <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2012 // destroyed. | 2012 // destroyed. |
2013 DCHECK_EQ(id_, 0u); | 2013 DCHECK_EQ(id_, 0u); |
2014 } | 2014 } |
2015 | 2015 |
2016 void BackTexture::Create() { | 2016 void BackTexture::Create() { |
2017 ScopedGLErrorSuppressor suppressor("BackTexture::Create", | 2017 ScopedGLErrorSuppressor suppressor("BackTexture::Create", |
2018 state_->GetErrorState()); | 2018 state_->GetErrorState()); |
2019 Destroy(); | 2019 Destroy(); |
2020 glGenTextures(1, &id_); | 2020 glGenTextures(1, &id_); |
2021 ScopedTextureBinder binder(state_, id_, GL_TEXTURE_2D); | 2021 ScopedTextureBinder binder(state_, id_, GL_TEXTURE_2D); |
2022 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | 2022 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
2023 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | 2023 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
2024 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 2024 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
2025 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 2025 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
2026 | 2026 |
2027 // TODO(apatrick): Attempt to diagnose crbug.com/97775. If SwapBuffers is | 2027 // TODO(apatrick): Attempt to diagnose crbug.com/97775. If SwapBuffers is |
2028 // never called on an offscreen context, no data will ever be uploaded to the | 2028 // never called on an offscreen context, no data will ever be uploaded to the |
2029 // saved offscreen color texture (it is deferred until to when SwapBuffers | 2029 // saved offscreen color texture (it is deferred until to when SwapBuffers |
2030 // is called). My idea is that some nvidia drivers might have a bug where | 2030 // is called). My idea is that some nvidia drivers might have a bug where |
2031 // deleting a texture that has never been populated might cause a | 2031 // deleting a texture that has never been populated might cause a |
2032 // crash. | 2032 // crash. |
2033 glTexImage2D( | 2033 glTexImage2D( |
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3286 1, // depth | 3286 1, // depth |
3287 0, // border | 3287 0, // border |
3288 GL_RGBA, | 3288 GL_RGBA, |
3289 GL_UNSIGNED_BYTE, | 3289 GL_UNSIGNED_BYTE, |
3290 true); | 3290 true); |
3291 texture_manager()->SetParameteri( | 3291 texture_manager()->SetParameteri( |
3292 "UpdateParentTextureInfo", | 3292 "UpdateParentTextureInfo", |
3293 GetErrorState(), | 3293 GetErrorState(), |
3294 offscreen_saved_color_texture_info_.get(), | 3294 offscreen_saved_color_texture_info_.get(), |
3295 GL_TEXTURE_MAG_FILTER, | 3295 GL_TEXTURE_MAG_FILTER, |
3296 GL_NEAREST); | 3296 GL_LINEAR); |
3297 texture_manager()->SetParameteri( | 3297 texture_manager()->SetParameteri( |
3298 "UpdateParentTextureInfo", | 3298 "UpdateParentTextureInfo", |
3299 GetErrorState(), | 3299 GetErrorState(), |
3300 offscreen_saved_color_texture_info_.get(), | 3300 offscreen_saved_color_texture_info_.get(), |
3301 GL_TEXTURE_MIN_FILTER, | 3301 GL_TEXTURE_MIN_FILTER, |
3302 GL_NEAREST); | 3302 GL_LINEAR); |
3303 texture_manager()->SetParameteri( | 3303 texture_manager()->SetParameteri( |
3304 "UpdateParentTextureInfo", | 3304 "UpdateParentTextureInfo", |
3305 GetErrorState(), | 3305 GetErrorState(), |
3306 offscreen_saved_color_texture_info_.get(), | 3306 offscreen_saved_color_texture_info_.get(), |
3307 GL_TEXTURE_WRAP_S, | 3307 GL_TEXTURE_WRAP_S, |
3308 GL_CLAMP_TO_EDGE); | 3308 GL_CLAMP_TO_EDGE); |
3309 texture_manager()->SetParameteri( | 3309 texture_manager()->SetParameteri( |
3310 "UpdateParentTextureInfo", | 3310 "UpdateParentTextureInfo", |
3311 GetErrorState(), | 3311 GetErrorState(), |
3312 offscreen_saved_color_texture_info_.get(), | 3312 offscreen_saved_color_texture_info_.get(), |
(...skipping 7617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10930 } | 10930 } |
10931 } | 10931 } |
10932 | 10932 |
10933 // Include the auto-generated part of this file. We split this because it means | 10933 // Include the auto-generated part of this file. We split this because it means |
10934 // we can easily edit the non-auto generated parts right here in this file | 10934 // we can easily edit the non-auto generated parts right here in this file |
10935 // instead of having to edit some template or the code generator. | 10935 // instead of having to edit some template or the code generator. |
10936 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10936 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10937 | 10937 |
10938 } // namespace gles2 | 10938 } // namespace gles2 |
10939 } // namespace gpu | 10939 } // namespace gpu |
OLD | NEW |