Chromium Code Reviews| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1927 ErrorState* error_state = state->GetErrorState(); | 1927 ErrorState* error_state = state->GetErrorState(); |
| 1928 const Validators* validators = feature_info_->validators(); | 1928 const Validators* validators = feature_info_->validators(); |
| 1929 if (((args.command_type == DoTexImageArguments::kTexImage2D) && | 1929 if (((args.command_type == DoTexImageArguments::kTexImage2D) && |
| 1930 !validators->texture_target.IsValid(args.target)) || | 1930 !validators->texture_target.IsValid(args.target)) || |
| 1931 ((args.command_type == DoTexImageArguments::kTexImage3D) && | 1931 ((args.command_type == DoTexImageArguments::kTexImage3D) && |
| 1932 !validators->texture_3_d_target.IsValid(args.target))) { | 1932 !validators->texture_3_d_target.IsValid(args.target))) { |
| 1933 ERRORSTATE_SET_GL_ERROR_INVALID_ENUM( | 1933 ERRORSTATE_SET_GL_ERROR_INVALID_ENUM( |
| 1934 error_state, function_name, args.target, "target"); | 1934 error_state, function_name, args.target, "target"); |
| 1935 return false; | 1935 return false; |
| 1936 } | 1936 } |
| 1937 // TODO(ccameron): Add a separate texture from |texture_target| for | |
| 1938 // [Compressed]Tex[Sub]Image2D and related functions. | |
| 1939 // http://crbug.com/536854 | |
| 1940 if (texture->target() == GL_TEXTURE_RECTANGLE_ARB) { | |
|
piman
2015/09/29 16:23:32
Did you mean args.target ?
ccameron
2015/09/29 18:19:18
Oops -- yes.
| |
| 1941 ERRORSTATE_SET_GL_ERROR_INVALID_ENUM( | |
| 1942 error_state, function_name, args.target, "target"); | |
| 1943 return false; | |
| 1944 } | |
| 1937 if (!ValidateTextureParameters( | 1945 if (!ValidateTextureParameters( |
| 1938 error_state, function_name, args.format, args.type, | 1946 error_state, function_name, args.format, args.type, |
| 1939 args.internal_format, args.level)) { | 1947 args.internal_format, args.level)) { |
| 1940 return false; | 1948 return false; |
| 1941 } | 1949 } |
| 1942 if (!ValidForTarget(args.target, args.level, | 1950 if (!ValidForTarget(args.target, args.level, |
| 1943 args.width, args.height, args.depth) || | 1951 args.width, args.height, args.depth) || |
| 1944 args.border != 0) { | 1952 args.border != 0) { |
| 1945 ERRORSTATE_SET_GL_ERROR( | 1953 ERRORSTATE_SET_GL_ERROR( |
| 1946 error_state, GL_INVALID_VALUE, function_name, | 1954 error_state, GL_INVALID_VALUE, function_name, |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2207 pmd->AddOwnershipEdge(client_guid, service_guid, importance); | 2215 pmd->AddOwnershipEdge(client_guid, service_guid, importance); |
| 2208 | 2216 |
| 2209 // Dump all sub-levels held by the texture. They will appear below the main | 2217 // Dump all sub-levels held by the texture. They will appear below the main |
| 2210 // gl/textures/client_X/texture_Y dump. | 2218 // gl/textures/client_X/texture_Y dump. |
| 2211 ref->texture()->DumpLevelMemory(pmd, memory_tracker_->ClientTracingId(), | 2219 ref->texture()->DumpLevelMemory(pmd, memory_tracker_->ClientTracingId(), |
| 2212 dump_name); | 2220 dump_name); |
| 2213 } | 2221 } |
| 2214 | 2222 |
| 2215 } // namespace gles2 | 2223 } // namespace gles2 |
| 2216 } // namespace gpu | 2224 } // namespace gpu |
| OLD | NEW |