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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.h

Issue 2257533006: Free worker context resources on idle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-cleanup2
Patch Set: rebase Created 4 years, 3 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_CLIENT_GLES2_IMPLEMENTATION_H_ 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ 6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 const gfx::Rect& display_bounds, 205 const gfx::Rect& display_bounds,
206 const gfx::RectF& uv_rect) override; 206 const gfx::RectF& uv_rect) override;
207 uint64_t ShareGroupTracingGUID() const override; 207 uint64_t ShareGroupTracingGUID() const override;
208 void SetErrorMessageCallback( 208 void SetErrorMessageCallback(
209 const base::Callback<void(const char*, int32_t)>& callback) override; 209 const base::Callback<void(const char*, int32_t)>& callback) override;
210 std::unique_ptr<ScopedVisibility> ClientBecameVisible() override; 210 std::unique_ptr<ScopedVisibility> ClientBecameVisible() override;
211 void ClientBecameNotVisible( 211 void ClientBecameNotVisible(
212 std::unique_ptr<ScopedVisibility> visibility) override; 212 std::unique_ptr<ScopedVisibility> visibility) override;
213 bool AnyClientsVisible() const override; 213 bool AnyClientsVisible() const override;
214 214
215 std::unique_ptr<ScopedBusy> ClientBecameBusy() override;
216 void ClientBecameNotBusy(std::unique_ptr<ScopedBusy> busy) override;
217 void SetIdleCallback(const base::Closure& callback) override;
218
215 // TODO(danakj): Move to ContextSupport once ContextProvider doesn't need to 219 // TODO(danakj): Move to ContextSupport once ContextProvider doesn't need to
216 // intercept it. 220 // intercept it.
217 void SetLostContextCallback(const base::Closure& callback); 221 void SetLostContextCallback(const base::Closure& callback);
218 222
219 void GetProgramInfoCHROMIUMHelper(GLuint program, 223 void GetProgramInfoCHROMIUMHelper(GLuint program,
220 std::vector<int8_t>* result); 224 std::vector<int8_t>* result);
221 GLint GetAttribLocationHelper(GLuint program, const char* name); 225 GLint GetAttribLocationHelper(GLuint program, const char* name);
222 GLint GetUniformLocationHelper(GLuint program, const char* name); 226 GLint GetUniformLocationHelper(GLuint program, const char* name);
223 GLint GetFragDataIndexEXTHelper(GLuint program, const char* name); 227 GLint GetFragDataIndexEXTHelper(GLuint program, const char* name);
224 GLint GetFragDataLocationHelper(GLuint program, const char* name); 228 GLint GetFragDataLocationHelper(GLuint program, const char* name);
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 void RemoveMappedBufferRangeById(GLuint buffer); 693 void RemoveMappedBufferRangeById(GLuint buffer);
690 void ClearMappedBufferRangeMap(); 694 void ClearMappedBufferRangeMap();
691 695
692 void DrawElementsImpl(GLenum mode, GLsizei count, GLenum type, 696 void DrawElementsImpl(GLenum mode, GLsizei count, GLenum type,
693 const void* indices, const char* func_name); 697 const void* indices, const char* func_name);
694 void UpdateCachedExtensionsIfNeeded(); 698 void UpdateCachedExtensionsIfNeeded();
695 void InvalidateCachedExtensions(); 699 void InvalidateCachedExtensions();
696 700
697 PixelStoreParams GetUnpackParameters(Dimension dimension); 701 PixelStoreParams GetUnpackParameters(Dimension dimension);
698 702
703 void RunIdleCallback(uint32_t callback_generation) const;
704 void CancelIdleCallback();
705
699 GLES2Util util_; 706 GLES2Util util_;
700 GLES2CmdHelper* helper_; 707 GLES2CmdHelper* helper_;
701 TransferBufferInterface* transfer_buffer_; 708 TransferBufferInterface* transfer_buffer_;
702 std::string last_error_; 709 std::string last_error_;
703 DebugMarkerManager debug_marker_manager_; 710 DebugMarkerManager debug_marker_manager_;
704 std::string this_in_hex_; 711 std::string this_in_hex_;
705 712
706 std::queue<int32_t> swap_buffers_tokens_; 713 std::queue<int32_t> swap_buffers_tokens_;
707 std::queue<int32_t> rate_limit_tokens_; 714 std::queue<int32_t> rate_limit_tokens_;
708 715
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 823
817 std::unique_ptr<QueryTracker> query_tracker_; 824 std::unique_ptr<QueryTracker> query_tracker_;
818 std::unique_ptr<IdAllocator> query_id_allocator_; 825 std::unique_ptr<IdAllocator> query_id_allocator_;
819 826
820 std::unique_ptr<BufferTracker> buffer_tracker_; 827 std::unique_ptr<BufferTracker> buffer_tracker_;
821 828
822 base::Callback<void(const char*, int32_t)> error_message_callback_; 829 base::Callback<void(const char*, int32_t)> error_message_callback_;
823 base::Closure lost_context_callback_; 830 base::Closure lost_context_callback_;
824 bool lost_context_callback_run_ = false; 831 bool lost_context_callback_run_ = false;
825 832
833 // |idle_lock_| must be held while accessing |idle_callback_|, |is_idle_| or
834 // |current_idle_callback_generation_|.
835 mutable base::Lock idle_lock_;
836 base::Closure idle_callback_;
837 bool is_idle_ = true;
838 uint32_t current_idle_callback_generation_ = 0;
839
826 int current_trace_stack_; 840 int current_trace_stack_;
827 841
828 GpuControl* gpu_control_; 842 GpuControl* gpu_control_;
829 843
844 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
845
830 Capabilities capabilities_; 846 Capabilities capabilities_;
831 847
832 // Flag to indicate whether the implementation can retain resources, or 848 // Flag to indicate whether the implementation can retain resources, or
833 // whether it should aggressively free them. 849 // whether it should aggressively free them.
834 bool aggressively_free_resources_ = false; 850 bool aggressively_free_resources_ = false;
835 851
836 uint32_t num_visible_clients_ = 0; 852 uint32_t num_visible_clients_ = 0;
837 853
838 // Result of last GetString(GL_EXTENSIONS), used to keep 854 // Result of last GetString(GL_EXTENSIONS), used to keep
839 // GetString(GL_EXTENSIONS), GetStringi(GL_EXTENSIONS, index) and 855 // GetString(GL_EXTENSIONS), GetStringi(GL_EXTENSIONS, index) and
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 901
886 inline bool GLES2Implementation::GetTexParameterivHelper( 902 inline bool GLES2Implementation::GetTexParameterivHelper(
887 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { 903 GLenum /* target */, GLenum /* pname */, GLint* /* params */) {
888 return false; 904 return false;
889 } 905 }
890 906
891 } // namespace gles2 907 } // namespace gles2
892 } // namespace gpu 908 } // namespace gpu
893 909
894 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ 910 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/context_support.h ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698