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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
436 first_face.height == 0 || | 436 first_face.height == 0 || |
437 first_face.depth == 0) { | 437 first_face.depth == 0) { |
438 return CAN_RENDER_NEVER; | 438 return CAN_RENDER_NEVER; |
439 } | 439 } |
440 } | 440 } |
441 | 441 |
442 bool needs_mips = NeedsMips(); | 442 bool needs_mips = NeedsMips(); |
443 if (needs_mips) { | 443 if (needs_mips) { |
444 if (!texture_complete()) | 444 if (!texture_complete()) |
445 return CAN_RENDER_NEVER; | 445 return CAN_RENDER_NEVER; |
446 if (target_ == GL_TEXTURE_CUBE_MAP && !cube_complete()) | |
447 return CAN_RENDER_NEVER; | |
448 } | 446 } |
449 | 447 |
448 if (target_ == GL_TEXTURE_CUBE_MAP && !cube_complete()) | |
449 return CAN_RENDER_NEVER; | |
dshwang
2015/08/18 07:18:16
I change the CL's goal. Texture::GetCanRenderCondi
| |
450 | |
450 bool is_npot_compatible = !needs_mips && | 451 bool is_npot_compatible = !needs_mips && |
451 wrap_s_ == GL_CLAMP_TO_EDGE && | 452 wrap_s_ == GL_CLAMP_TO_EDGE && |
452 wrap_t_ == GL_CLAMP_TO_EDGE; | 453 wrap_t_ == GL_CLAMP_TO_EDGE; |
453 | 454 |
454 if (!is_npot_compatible) { | 455 if (!is_npot_compatible) { |
455 if (target_ == GL_TEXTURE_RECTANGLE_ARB) | 456 if (target_ == GL_TEXTURE_RECTANGLE_ARB) |
456 return CAN_RENDER_NEVER; | 457 return CAN_RENDER_NEVER; |
457 else if (npot()) | 458 else if (npot()) |
458 return CAN_RENDER_ONLY_IF_NPOT; | 459 return CAN_RENDER_ONLY_IF_NPOT; |
459 } | 460 } |
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2099 // The link to the memory tracking |client_id| is given a higher importance | 2100 // The link to the memory tracking |client_id| is given a higher importance |
2100 // than other refs. | 2101 // than other refs. |
2101 if (ref == ref->texture()->memory_tracking_ref_) | 2102 if (ref == ref->texture()->memory_tracking_ref_) |
2102 importance = 2; | 2103 importance = 2; |
2103 | 2104 |
2104 pmd->AddOwnershipEdge(client_guid, service_guid, importance); | 2105 pmd->AddOwnershipEdge(client_guid, service_guid, importance); |
2105 } | 2106 } |
2106 | 2107 |
2107 } // namespace gles2 | 2108 } // namespace gles2 |
2108 } // namespace gpu | 2109 } // namespace gpu |
OLD | NEW |