| 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 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2376 TextureRef* texture_ref; | 2376 TextureRef* texture_ref; |
| 2377 if (!ValidateTexImage(state, function_name, args, &texture_ref)) { | 2377 if (!ValidateTexImage(state, function_name, args, &texture_ref)) { |
| 2378 return; | 2378 return; |
| 2379 } | 2379 } |
| 2380 | 2380 |
| 2381 Buffer* buffer = state->bound_pixel_unpack_buffer.get(); | 2381 Buffer* buffer = state->bound_pixel_unpack_buffer.get(); |
| 2382 | 2382 |
| 2383 // ValidateTexImage is passed already. | 2383 // ValidateTexImage is passed already. |
| 2384 Texture* texture = texture_ref->texture(); | 2384 Texture* texture = texture_ref->texture(); |
| 2385 bool need_cube_map_workaround = | 2385 bool need_cube_map_workaround = |
| 2386 !feature_info_->IsES3Enabled() && |
| 2386 texture->target() == GL_TEXTURE_CUBE_MAP && | 2387 texture->target() == GL_TEXTURE_CUBE_MAP && |
| 2387 (texture_state->force_cube_complete || | 2388 (texture_state->force_cube_complete || |
| 2388 (texture_state->force_cube_map_positive_x_allocation && | 2389 (texture_state->force_cube_map_positive_x_allocation && |
| 2389 args.target != GL_TEXTURE_CUBE_MAP_POSITIVE_X)); | 2390 args.target != GL_TEXTURE_CUBE_MAP_POSITIVE_X)); |
| 2390 if (need_cube_map_workaround && !buffer) { | 2391 if (need_cube_map_workaround && !buffer) { |
| 2391 // TODO(zmo): The following code does not work with an unpack buffer bound. | 2392 // TODO(zmo): The following code does not work with an unpack buffer bound. |
| 2392 std::vector<GLenum> undefined_faces; | 2393 std::vector<GLenum> undefined_faces; |
| 2393 if (texture_state->force_cube_complete) { | 2394 if (texture_state->force_cube_complete) { |
| 2394 int width = 0; | 2395 int width = 0; |
| 2395 int height = 0; | 2396 int height = 0; |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3378 uint32_t TextureManager::GetServiceIdGeneration() const { | 3379 uint32_t TextureManager::GetServiceIdGeneration() const { |
| 3379 return current_service_id_generation_; | 3380 return current_service_id_generation_; |
| 3380 } | 3381 } |
| 3381 | 3382 |
| 3382 void TextureManager::IncrementServiceIdGeneration() { | 3383 void TextureManager::IncrementServiceIdGeneration() { |
| 3383 current_service_id_generation_++; | 3384 current_service_id_generation_++; |
| 3384 } | 3385 } |
| 3385 | 3386 |
| 3386 } // namespace gles2 | 3387 } // namespace gles2 |
| 3387 } // namespace gpu | 3388 } // namespace gpu |
| OLD | NEW |