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

Side by Side Diff: content/common/gpu/client/context_provider_command_buffer.h

Issue 1324413003: Move gpu memory calculations to Compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment + android_arm64_dbg_recipe bot issue. Created 5 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ 5 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_
6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ 6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 30 matching lines...) Expand all
41 class GrContext* GrContext() override; 41 class GrContext* GrContext() override;
42 void InvalidateGrContext(uint32_t state) override; 42 void InvalidateGrContext(uint32_t state) override;
43 void SetupLock() override; 43 void SetupLock() override;
44 base::Lock* GetLock() override; 44 base::Lock* GetLock() override;
45 Capabilities ContextCapabilities() override; 45 Capabilities ContextCapabilities() override;
46 void VerifyContexts() override; 46 void VerifyContexts() override;
47 void DeleteCachedResources() override; 47 void DeleteCachedResources() override;
48 bool DestroyedOnMainThread() override; 48 bool DestroyedOnMainThread() override;
49 void SetLostContextCallback( 49 void SetLostContextCallback(
50 const LostContextCallback& lost_context_callback) override; 50 const LostContextCallback& lost_context_callback) override;
51 void SetMemoryPolicyChangedCallback(
52 const MemoryPolicyChangedCallback& memory_policy_changed_callback)
53 override;
54 51
55 protected: 52 protected:
56 ContextProviderCommandBuffer( 53 ContextProviderCommandBuffer(
57 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, 54 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d,
58 CommandBufferContextType type); 55 CommandBufferContextType type);
59 ~ContextProviderCommandBuffer() override; 56 ~ContextProviderCommandBuffer() override;
60 57
61 void OnLostContext(); 58 void OnLostContext();
62 void OnMemoryAllocationChanged(const gpu::MemoryAllocation& allocation);
63 59
64 private: 60 private:
65 void InitializeCapabilities(); 61 void InitializeCapabilities();
66 62
67 base::ThreadChecker main_thread_checker_; 63 base::ThreadChecker main_thread_checker_;
68 base::ThreadChecker context_thread_checker_; 64 base::ThreadChecker context_thread_checker_;
69 65
70 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; 66 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_;
71 scoped_ptr<GrContextForWebGraphicsContext3D> gr_context_; 67 scoped_ptr<GrContextForWebGraphicsContext3D> gr_context_;
72 68
73 cc::ContextProvider::Capabilities capabilities_; 69 cc::ContextProvider::Capabilities capabilities_;
74 CommandBufferContextType context_type_; 70 CommandBufferContextType context_type_;
75 std::string debug_name_; 71 std::string debug_name_;
76 72
77 LostContextCallback lost_context_callback_; 73 LostContextCallback lost_context_callback_;
78 MemoryPolicyChangedCallback memory_policy_changed_callback_;
79 74
80 base::Lock main_thread_lock_; 75 base::Lock main_thread_lock_;
81 bool destroyed_; 76 bool destroyed_;
82 77
83 base::Lock context_lock_; 78 base::Lock context_lock_;
84 79
85 class LostContextCallbackProxy; 80 class LostContextCallbackProxy;
86 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; 81 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_;
87 }; 82 };
88 83
89 } // namespace content 84 } // namespace content
90 85
91 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ 86 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_
OLDNEW
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.cc ('k') | content/common/gpu/client/context_provider_command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698