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 9054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9065 } | 9065 } |
9066 const void* pixels = NULL; | 9066 const void* pixels = NULL; |
9067 if (pixels_shm_id != 0 || pixels_shm_offset != 0) { | 9067 if (pixels_shm_id != 0 || pixels_shm_offset != 0) { |
9068 pixels = GetSharedMemoryAs<const void*>( | 9068 pixels = GetSharedMemoryAs<const void*>( |
9069 pixels_shm_id, pixels_shm_offset, pixels_size); | 9069 pixels_shm_id, pixels_shm_offset, pixels_size); |
9070 if (!pixels) { | 9070 if (!pixels) { |
9071 return error::kOutOfBounds; | 9071 return error::kOutOfBounds; |
9072 } | 9072 } |
9073 } | 9073 } |
9074 | 9074 |
| 9075 // For testing only. Allows us to stress the ability to respond to OOM errors. |
| 9076 if (workarounds().simulate_out_of_memory_on_large_textures && |
| 9077 (width * height >= 4096 * 4096)) { |
| 9078 LOCAL_SET_GL_ERROR( |
| 9079 GL_OUT_OF_MEMORY, |
| 9080 "glTexImage2D", "synthetic out of memory"); |
| 9081 return error::kNoError; |
| 9082 } |
| 9083 |
9075 TextureManager::DoTextImage2DArguments args = { | 9084 TextureManager::DoTextImage2DArguments args = { |
9076 target, level, internal_format, width, height, border, format, type, | 9085 target, level, internal_format, width, height, border, format, type, |
9077 pixels, pixels_size}; | 9086 pixels, pixels_size}; |
9078 texture_manager()->ValidateAndDoTexImage2D( | 9087 texture_manager()->ValidateAndDoTexImage2D( |
9079 &texture_state_, &state_, &framebuffer_state_, args); | 9088 &texture_state_, &state_, &framebuffer_state_, args); |
9080 | 9089 |
9081 // This may be a slow command. Exit command processing to allow for | 9090 // This may be a slow command. Exit command processing to allow for |
9082 // context preemption and GPU watchdog checks. | 9091 // context preemption and GPU watchdog checks. |
9083 ExitCommandProcessingEarly(); | 9092 ExitCommandProcessingEarly(); |
9084 return error::kNoError; | 9093 return error::kNoError; |
(...skipping 3474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12559 } | 12568 } |
12560 } | 12569 } |
12561 | 12570 |
12562 // Include the auto-generated part of this file. We split this because it means | 12571 // Include the auto-generated part of this file. We split this because it means |
12563 // we can easily edit the non-auto generated parts right here in this file | 12572 // we can easily edit the non-auto generated parts right here in this file |
12564 // instead of having to edit some template or the code generator. | 12573 // instead of having to edit some template or the code generator. |
12565 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 12574 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
12566 | 12575 |
12567 } // namespace gles2 | 12576 } // namespace gles2 |
12568 } // namespace gpu | 12577 } // namespace gpu |
OLD | NEW |