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 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 bool force_context_lost_; | 691 bool force_context_lost_; |
692 | 692 |
693 DISALLOW_COPY_AND_ASSIGN(TextureRef); | 693 DISALLOW_COPY_AND_ASSIGN(TextureRef); |
694 }; | 694 }; |
695 | 695 |
696 // Holds data that is per gles2_cmd_decoder, but is related to to the | 696 // Holds data that is per gles2_cmd_decoder, but is related to to the |
697 // TextureManager. | 697 // TextureManager. |
698 struct DecoderTextureState { | 698 struct DecoderTextureState { |
699 // total_texture_upload_time automatically initialized to 0 in default | 699 // total_texture_upload_time automatically initialized to 0 in default |
700 // constructor. | 700 // constructor. |
701 explicit DecoderTextureState(const GpuDriverBugWorkarounds& workarounds) | 701 explicit DecoderTextureState(const GpuDriverBugWorkarounds& workarounds); |
702 : tex_image_failed(false), | |
703 texture_upload_count(0), | |
704 texsubimage_faster_than_teximage( | |
705 workarounds.texsubimage_faster_than_teximage), | |
706 force_cube_map_positive_x_allocation( | |
707 workarounds.force_cube_map_positive_x_allocation), | |
708 force_cube_complete(workarounds.force_cube_complete), | |
709 unpack_alignment_workaround_with_unpack_buffer( | |
710 workarounds.unpack_alignment_workaround_with_unpack_buffer), | |
711 unpack_overlapping_rows_separately_unpack_buffer( | |
712 workarounds.unpack_overlapping_rows_separately_unpack_buffer), | |
713 unpack_image_height_workaround_with_unpack_buffer( | |
714 workarounds.unpack_image_height_workaround_with_unpack_buffer) {} | |
715 | 702 |
716 // This indicates all the following texSubImage*D calls that are part of the | 703 // This indicates all the following texSubImage*D calls that are part of the |
717 // failed texImage*D call should be ignored. The client calls have a lock | 704 // failed texImage*D call should be ignored. The client calls have a lock |
718 // around them, so it will affect only a single texImage*D + texSubImage*D | 705 // around them, so it will affect only a single texImage*D + texSubImage*D |
719 // group. | 706 // group. |
720 bool tex_image_failed; | 707 bool tex_image_failed; |
721 | 708 |
722 // Command buffer stats. | 709 // Command buffer stats. |
723 int texture_upload_count; | 710 int texture_upload_count; |
724 base::TimeDelta total_texture_upload_time; | 711 base::TimeDelta total_texture_upload_time; |
725 | 712 |
726 bool texsubimage_faster_than_teximage; | 713 bool texsubimage_faster_than_teximage; |
727 bool force_cube_map_positive_x_allocation; | 714 bool force_cube_map_positive_x_allocation; |
728 bool force_cube_complete; | 715 bool force_cube_complete; |
| 716 bool force_int_or_srgb_cube_texture_complete; |
729 bool unpack_alignment_workaround_with_unpack_buffer; | 717 bool unpack_alignment_workaround_with_unpack_buffer; |
730 bool unpack_overlapping_rows_separately_unpack_buffer; | 718 bool unpack_overlapping_rows_separately_unpack_buffer; |
731 bool unpack_image_height_workaround_with_unpack_buffer; | 719 bool unpack_image_height_workaround_with_unpack_buffer; |
732 }; | 720 }; |
733 | 721 |
734 // This class keeps track of the textures and their sizes so we can do NPOT and | 722 // This class keeps track of the textures and their sizes so we can do NPOT and |
735 // texture complete checking. | 723 // texture complete checking. |
736 // | 724 // |
737 // NOTE: To support shared resources an instance of this class will need to be | 725 // NOTE: To support shared resources an instance of this class will need to be |
738 // shared by multiple GLES2Decoders. | 726 // shared by multiple GLES2Decoders. |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 private: | 1252 private: |
1265 DecoderTextureState* texture_state_; | 1253 DecoderTextureState* texture_state_; |
1266 base::TimeTicks begin_time_; | 1254 base::TimeTicks begin_time_; |
1267 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 1255 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
1268 }; | 1256 }; |
1269 | 1257 |
1270 } // namespace gles2 | 1258 } // namespace gles2 |
1271 } // namespace gpu | 1259 } // namespace gpu |
1272 | 1260 |
1273 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 1261 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
OLD | NEW |