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

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

Issue 2378583003: Ping watchdog thread during GpuChannel destruction (Closed)
Patch Set: Fix lifetime and use nullptr Created 4 years, 2 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 20 matching lines...) Expand all
31 31
32 class GLES2Decoder; 32 class GLES2Decoder;
33 class GLStreamTextureImage; 33 class GLStreamTextureImage;
34 struct ContextState; 34 struct ContextState;
35 struct DecoderFramebufferState; 35 struct DecoderFramebufferState;
36 class Display; 36 class Display;
37 class ErrorState; 37 class ErrorState;
38 class FeatureInfo; 38 class FeatureInfo;
39 class FramebufferManager; 39 class FramebufferManager;
40 class MailboxManager; 40 class MailboxManager;
41 class ProgressReporter;
41 class Texture; 42 class Texture;
42 class TextureManager; 43 class TextureManager;
43 class TextureRef; 44 class TextureRef;
44 45
45 class GPU_EXPORT TextureBase { 46 class GPU_EXPORT TextureBase {
46 public: 47 public:
47 explicit TextureBase(GLuint service_id); 48 explicit TextureBase(GLuint service_id);
48 virtual ~TextureBase(); 49 virtual ~TextureBase();
49 50
50 // The service side OpenGL id of the texture. 51 // The service side OpenGL id of the texture.
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 kNumDefaultTextures 759 kNumDefaultTextures
759 }; 760 };
760 761
761 TextureManager(MemoryTracker* memory_tracker, 762 TextureManager(MemoryTracker* memory_tracker,
762 FeatureInfo* feature_info, 763 FeatureInfo* feature_info,
763 GLsizei max_texture_size, 764 GLsizei max_texture_size,
764 GLsizei max_cube_map_texture_size, 765 GLsizei max_cube_map_texture_size,
765 GLsizei max_rectangle_texture_size, 766 GLsizei max_rectangle_texture_size,
766 GLsizei max_3d_texture_size, 767 GLsizei max_3d_texture_size,
767 GLsizei max_array_texture_layers, 768 GLsizei max_array_texture_layers,
768 bool use_default_textures); 769 bool use_default_textures,
770 ProgressReporter* progress_reporter);
769 ~TextureManager() override; 771 ~TextureManager() override;
770 772
771 void set_framebuffer_manager(FramebufferManager* manager) { 773 void set_framebuffer_manager(FramebufferManager* manager) {
772 framebuffer_manager_ = manager; 774 framebuffer_manager_ = manager;
773 } 775 }
774 776
775 // Init the texture manager. 777 // Init the texture manager.
776 bool Initialize(); 778 bool Initialize();
777 779
778 // Must call before destruction. 780 // Must call before destruction.
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 // TextureInfos are only for textures the client side can access. 1230 // TextureInfos are only for textures the client side can access.
1229 GLuint black_texture_ids_[kNumDefaultTextures]; 1231 GLuint black_texture_ids_[kNumDefaultTextures];
1230 1232
1231 // The default textures for each target (texture name = 0) 1233 // The default textures for each target (texture name = 0)
1232 scoped_refptr<TextureRef> default_textures_[kNumDefaultTextures]; 1234 scoped_refptr<TextureRef> default_textures_[kNumDefaultTextures];
1233 1235
1234 std::vector<DestructionObserver*> destruction_observers_; 1236 std::vector<DestructionObserver*> destruction_observers_;
1235 1237
1236 uint32_t current_service_id_generation_; 1238 uint32_t current_service_id_generation_;
1237 1239
1240 // Used to notify the watchdog thread of progress during destruction,
1241 // preventing time-outs when destruction takes a long time. May be null when
1242 // using in-process command buffer.
1243 ProgressReporter* progress_reporter_;
1244
1238 DISALLOW_COPY_AND_ASSIGN(TextureManager); 1245 DISALLOW_COPY_AND_ASSIGN(TextureManager);
1239 }; 1246 };
1240 1247
1241 // This class records texture upload time when in scope. 1248 // This class records texture upload time when in scope.
1242 class ScopedTextureUploadTimer { 1249 class ScopedTextureUploadTimer {
1243 public: 1250 public:
1244 explicit ScopedTextureUploadTimer(DecoderTextureState* texture_state); 1251 explicit ScopedTextureUploadTimer(DecoderTextureState* texture_state);
1245 ~ScopedTextureUploadTimer(); 1252 ~ScopedTextureUploadTimer();
1246 1253
1247 private: 1254 private:
1248 DecoderTextureState* texture_state_; 1255 DecoderTextureState* texture_state_;
1249 base::TimeTicks begin_time_; 1256 base::TimeTicks begin_time_;
1250 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); 1257 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer);
1251 }; 1258 };
1252 1259
1253 } // namespace gles2 1260 } // namespace gles2
1254 } // namespace gpu 1261 } // namespace gpu
1255 1262
1256 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ 1263 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698