| 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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 : tex_image_failed(false), | 701 : tex_image_failed(false), |
| 702 texture_upload_count(0), | 702 texture_upload_count(0), |
| 703 texsubimage_faster_than_teximage( | 703 texsubimage_faster_than_teximage( |
| 704 workarounds.texsubimage_faster_than_teximage), | 704 workarounds.texsubimage_faster_than_teximage), |
| 705 force_cube_map_positive_x_allocation( | 705 force_cube_map_positive_x_allocation( |
| 706 workarounds.force_cube_map_positive_x_allocation), | 706 workarounds.force_cube_map_positive_x_allocation), |
| 707 force_cube_complete(workarounds.force_cube_complete), | 707 force_cube_complete(workarounds.force_cube_complete), |
| 708 unpack_alignment_workaround_with_unpack_buffer( | 708 unpack_alignment_workaround_with_unpack_buffer( |
| 709 workarounds.unpack_alignment_workaround_with_unpack_buffer), | 709 workarounds.unpack_alignment_workaround_with_unpack_buffer), |
| 710 unpack_overlapping_rows_separately_unpack_buffer( | 710 unpack_overlapping_rows_separately_unpack_buffer( |
| 711 workarounds.unpack_overlapping_rows_separately_unpack_buffer) {} | 711 workarounds.unpack_overlapping_rows_separately_unpack_buffer), |
| 712 unpack_image_height_workaround_with_unpack_buffer( |
| 713 workarounds.unpack_image_height_workaround_with_unpack_buffer) {} |
| 712 | 714 |
| 713 // This indicates all the following texSubImage*D calls that are part of the | 715 // This indicates all the following texSubImage*D calls that are part of the |
| 714 // failed texImage*D call should be ignored. The client calls have a lock | 716 // failed texImage*D call should be ignored. The client calls have a lock |
| 715 // around them, so it will affect only a single texImage*D + texSubImage*D | 717 // around them, so it will affect only a single texImage*D + texSubImage*D |
| 716 // group. | 718 // group. |
| 717 bool tex_image_failed; | 719 bool tex_image_failed; |
| 718 | 720 |
| 719 // Command buffer stats. | 721 // Command buffer stats. |
| 720 int texture_upload_count; | 722 int texture_upload_count; |
| 721 base::TimeDelta total_texture_upload_time; | 723 base::TimeDelta total_texture_upload_time; |
| 722 | 724 |
| 723 bool texsubimage_faster_than_teximage; | 725 bool texsubimage_faster_than_teximage; |
| 724 bool force_cube_map_positive_x_allocation; | 726 bool force_cube_map_positive_x_allocation; |
| 725 bool force_cube_complete; | 727 bool force_cube_complete; |
| 726 bool unpack_alignment_workaround_with_unpack_buffer; | 728 bool unpack_alignment_workaround_with_unpack_buffer; |
| 727 bool unpack_overlapping_rows_separately_unpack_buffer; | 729 bool unpack_overlapping_rows_separately_unpack_buffer; |
| 730 bool unpack_image_height_workaround_with_unpack_buffer; |
| 728 }; | 731 }; |
| 729 | 732 |
| 730 // This class keeps track of the textures and their sizes so we can do NPOT and | 733 // This class keeps track of the textures and their sizes so we can do NPOT and |
| 731 // texture complete checking. | 734 // texture complete checking. |
| 732 // | 735 // |
| 733 // NOTE: To support shared resources an instance of this class will need to be | 736 // NOTE: To support shared resources an instance of this class will need to be |
| 734 // shared by multiple GLES2Decoders. | 737 // shared by multiple GLES2Decoders. |
| 735 class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider { | 738 class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider { |
| 736 public: | 739 public: |
| 737 class GPU_EXPORT DestructionObserver { | 740 class GPU_EXPORT DestructionObserver { |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 void DoTexSubImageWithAlignmentWorkaround( | 1166 void DoTexSubImageWithAlignmentWorkaround( |
| 1164 DecoderTextureState* texture_state, | 1167 DecoderTextureState* texture_state, |
| 1165 ContextState* state, | 1168 ContextState* state, |
| 1166 const DoTexSubImageArguments& args); | 1169 const DoTexSubImageArguments& args); |
| 1167 | 1170 |
| 1168 void DoTexSubImageRowByRowWorkaround(DecoderTextureState* texture_state, | 1171 void DoTexSubImageRowByRowWorkaround(DecoderTextureState* texture_state, |
| 1169 ContextState* state, | 1172 ContextState* state, |
| 1170 const DoTexSubImageArguments& args, | 1173 const DoTexSubImageArguments& args, |
| 1171 const PixelStoreParams& unpack_params); | 1174 const PixelStoreParams& unpack_params); |
| 1172 | 1175 |
| 1176 void DoTexSubImageLayerByLayerWorkaround( |
| 1177 DecoderTextureState* texture_state, |
| 1178 ContextState* state, |
| 1179 const DoTexSubImageArguments& args, |
| 1180 const PixelStoreParams& unpack_params); |
| 1181 |
| 1173 void DoCubeMapWorkaround( | 1182 void DoCubeMapWorkaround( |
| 1174 DecoderTextureState* texture_state, | 1183 DecoderTextureState* texture_state, |
| 1175 ContextState* state, | 1184 ContextState* state, |
| 1176 DecoderFramebufferState* framebuffer_state, | 1185 DecoderFramebufferState* framebuffer_state, |
| 1177 TextureRef* texture_ref, | 1186 TextureRef* texture_ref, |
| 1178 const char* function_name, | 1187 const char* function_name, |
| 1179 const DoTexImageArguments& args); | 1188 const DoTexImageArguments& args); |
| 1180 | 1189 |
| 1181 void StartTracking(TextureRef* texture); | 1190 void StartTracking(TextureRef* texture); |
| 1182 void StopTracking(TextureRef* texture); | 1191 void StopTracking(TextureRef* texture); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1254 private: | 1263 private: |
| 1255 DecoderTextureState* texture_state_; | 1264 DecoderTextureState* texture_state_; |
| 1256 base::TimeTicks begin_time_; | 1265 base::TimeTicks begin_time_; |
| 1257 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 1266 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
| 1258 }; | 1267 }; |
| 1259 | 1268 |
| 1260 } // namespace gles2 | 1269 } // namespace gles2 |
| 1261 } // namespace gpu | 1270 } // namespace gpu |
| 1262 | 1271 |
| 1263 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 1272 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
| OLD | NEW |