Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: gpu/command_buffer/service/texture_manager.h

Issue 2827573007: Reset TexImage2D base level to workaround Intel mac driver bug (Closed)
Patch Set: Add gpu unittests Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 Texture* texture_; 690 Texture* texture_;
691 GLuint client_id_; 691 GLuint client_id_;
692 GLint num_observers_; 692 GLint num_observers_;
693 bool force_context_lost_; 693 bool force_context_lost_;
694 694
695 DISALLOW_COPY_AND_ASSIGN(TextureRef); 695 DISALLOW_COPY_AND_ASSIGN(TextureRef);
696 }; 696 };
697 697
698 // Holds data that is per gles2_cmd_decoder, but is related to to the 698 // Holds data that is per gles2_cmd_decoder, but is related to to the
699 // TextureManager. 699 // TextureManager.
700 struct DecoderTextureState { 700 struct GPU_EXPORT DecoderTextureState {
701 // total_texture_upload_time automatically initialized to 0 in default 701 // total_texture_upload_time automatically initialized to 0 in default
702 // constructor. 702 // constructor.
703 explicit DecoderTextureState(const GpuDriverBugWorkarounds& workarounds); 703 explicit DecoderTextureState(const GpuDriverBugWorkarounds& workarounds);
704 704
705 // This indicates all the following texSubImage*D calls that are part of the 705 // This indicates all the following texSubImage*D calls that are part of the
706 // failed texImage*D call should be ignored. The client calls have a lock 706 // failed texImage*D call should be ignored. The client calls have a lock
707 // around them, so it will affect only a single texImage*D + texSubImage*D 707 // around them, so it will affect only a single texImage*D + texSubImage*D
708 // group. 708 // group.
709 bool tex_image_failed; 709 bool tex_image_failed;
710 710
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 DecoderTextureState* texture_state, 1122 DecoderTextureState* texture_state,
1123 ContextState* state, 1123 ContextState* state,
1124 DecoderFramebufferState* framebuffer_state, 1124 DecoderFramebufferState* framebuffer_state,
1125 TextureRef* texture_ref, 1125 TextureRef* texture_ref,
1126 const char* function_name, 1126 const char* function_name,
1127 const DoTexImageArguments& args) { 1127 const DoTexImageArguments& args) {
1128 DoCubeMapWorkaround(texture_state, state, framebuffer_state, 1128 DoCubeMapWorkaround(texture_state, state, framebuffer_state,
1129 texture_ref, function_name, args); 1129 texture_ref, function_name, args);
1130 } 1130 }
1131 1131
1132 void DoTexImage(DecoderTextureState* texture_state,
1133 ContextState* state,
1134 DecoderFramebufferState* framebuffer_state,
1135 const char* function_name,
1136 TextureRef* texture_ref,
1137 const DoTexImageArguments& args);
1138
yizhou.jiang 2017/06/09 07:58:16 I move DoTexImage to public in order to test it in
1132 private: 1139 private:
1133 friend class Texture; 1140 friend class Texture;
1134 friend class TextureRef; 1141 friend class TextureRef;
1135 1142
1136 // Helper for Initialize(). 1143 // Helper for Initialize().
1137 scoped_refptr<TextureRef> CreateDefaultAndBlackTextures( 1144 scoped_refptr<TextureRef> CreateDefaultAndBlackTextures(
1138 GLenum target, 1145 GLenum target,
1139 GLuint* black_texture); 1146 GLuint* black_texture);
1140 1147
1141 void DoTexImage(
1142 DecoderTextureState* texture_state,
1143 ContextState* state,
1144 DecoderFramebufferState* framebuffer_state,
1145 const char* function_name,
1146 TextureRef* texture_ref,
1147 const DoTexImageArguments& args);
1148
1149 // Reserve memory for the texture and set its attributes so it can be filled 1148 // Reserve memory for the texture and set its attributes so it can be filled
1150 // with TexSubImage. The image contents are undefined after this function, 1149 // with TexSubImage. The image contents are undefined after this function,
1151 // so make sure it's subsequently filled in its entirety. 1150 // so make sure it's subsequently filled in its entirety.
1152 void ReserveTexImageToBeFilled(DecoderTextureState* texture_state, 1151 void ReserveTexImageToBeFilled(DecoderTextureState* texture_state,
1153 ContextState* state, 1152 ContextState* state,
1154 DecoderFramebufferState* framebuffer_state, 1153 DecoderFramebufferState* framebuffer_state,
1155 const char* function_name, 1154 const char* function_name,
1156 TextureRef* texture_ref, 1155 TextureRef* texture_ref,
1157 const DoTexImageArguments& args); 1156 const DoTexImageArguments& args);
1158 1157
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 1245
1247 ServiceDiscardableManager* discardable_manager_; 1246 ServiceDiscardableManager* discardable_manager_;
1248 1247
1249 DISALLOW_COPY_AND_ASSIGN(TextureManager); 1248 DISALLOW_COPY_AND_ASSIGN(TextureManager);
1250 }; 1249 };
1251 1250
1252 } // namespace gles2 1251 } // namespace gles2
1253 } // namespace gpu 1252 } // namespace gpu
1254 1253
1255 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ 1254 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698