| 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/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2448 return false; | 2448 return false; |
| 2449 } | 2449 } |
| 2450 // TODO(ccameron): Add a separate texture from |texture_target| for | 2450 // TODO(ccameron): Add a separate texture from |texture_target| for |
| 2451 // [Compressed]Tex[Sub]Image2D and related functions. | 2451 // [Compressed]Tex[Sub]Image2D and related functions. |
| 2452 // http://crbug.com/536854 | 2452 // http://crbug.com/536854 |
| 2453 if (args.target == GL_TEXTURE_RECTANGLE_ARB) { | 2453 if (args.target == GL_TEXTURE_RECTANGLE_ARB) { |
| 2454 ERRORSTATE_SET_GL_ERROR_INVALID_ENUM( | 2454 ERRORSTATE_SET_GL_ERROR_INVALID_ENUM( |
| 2455 error_state, function_name, args.target, "target"); | 2455 error_state, function_name, args.target, "target"); |
| 2456 return false; | 2456 return false; |
| 2457 } | 2457 } |
| 2458 if (feature_info_->IsWebGL1OrES2Context()) { |
| 2459 switch (args.format) { |
| 2460 case GL_DEPTH_COMPONENT: |
| 2461 case GL_DEPTH_STENCIL: |
| 2462 if (args.target != GL_TEXTURE_2D) { |
| 2463 ERRORSTATE_SET_GL_ERROR( |
| 2464 error_state, GL_INVALID_OPERATION, function_name, |
| 2465 "invalid target for depth/stencil textures"); |
| 2466 return false; |
| 2467 } |
| 2468 break; |
| 2469 default: |
| 2470 break; |
| 2471 } |
| 2472 } |
| 2458 if (!ValidateTextureParameters( | 2473 if (!ValidateTextureParameters( |
| 2459 error_state, function_name, true, args.format, args.type, | 2474 error_state, function_name, true, args.format, args.type, |
| 2460 args.internal_format, args.level)) { | 2475 args.internal_format, args.level)) { |
| 2461 return false; | 2476 return false; |
| 2462 } | 2477 } |
| 2463 if (!ValidForTarget(args.target, args.level, | 2478 if (!ValidForTarget(args.target, args.level, |
| 2464 args.width, args.height, args.depth) || | 2479 args.width, args.height, args.depth) || |
| 2465 args.border != 0) { | 2480 args.border != 0) { |
| 2466 ERRORSTATE_SET_GL_ERROR( | 2481 ERRORSTATE_SET_GL_ERROR( |
| 2467 error_state, GL_INVALID_VALUE, function_name, | 2482 error_state, GL_INVALID_VALUE, function_name, |
| (...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3687 uint32_t TextureManager::GetServiceIdGeneration() const { | 3702 uint32_t TextureManager::GetServiceIdGeneration() const { |
| 3688 return current_service_id_generation_; | 3703 return current_service_id_generation_; |
| 3689 } | 3704 } |
| 3690 | 3705 |
| 3691 void TextureManager::IncrementServiceIdGeneration() { | 3706 void TextureManager::IncrementServiceIdGeneration() { |
| 3692 current_service_id_generation_++; | 3707 current_service_id_generation_++; |
| 3693 } | 3708 } |
| 3694 | 3709 |
| 3695 } // namespace gles2 | 3710 } // namespace gles2 |
| 3696 } // namespace gpu | 3711 } // namespace gpu |
| OLD | NEW |