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

Side by Side Diff: cc/output/context_provider.h

Issue 916723002: cc: Add threaded GPU rasterization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement ContextProviderInProcess::DetachFromThread(). Created 5 years, 10 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 CC_OUTPUT_CONTEXT_PROVIDER_H_ 5 #ifndef CC_OUTPUT_CONTEXT_PROVIDER_H_
6 #define CC_OUTPUT_CONTEXT_PROVIDER_H_ 6 #define CC_OUTPUT_CONTEXT_PROVIDER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "cc/base/cc_export.h" 10 #include "cc/base/cc_export.h"
(...skipping 13 matching lines...) Expand all
24 namespace cc { 24 namespace cc {
25 struct ManagedMemoryPolicy; 25 struct ManagedMemoryPolicy;
26 26
27 class ContextProvider : public base::RefCountedThreadSafe<ContextProvider> { 27 class ContextProvider : public base::RefCountedThreadSafe<ContextProvider> {
28 public: 28 public:
29 // Bind the 3d context to the current thread. This should be called before 29 // Bind the 3d context to the current thread. This should be called before
30 // accessing the contexts. Calling it more than once should have no effect. 30 // accessing the contexts. Calling it more than once should have no effect.
31 // Once this function has been called, the class should only be accessed 31 // Once this function has been called, the class should only be accessed
32 // from the same thread. 32 // from the same thread.
33 virtual bool BindToCurrentThread() = 0; 33 virtual bool BindToCurrentThread() = 0;
34 virtual void DetachFromThread() {}
34 35
35 virtual gpu::gles2::GLES2Interface* ContextGL() = 0; 36 virtual gpu::gles2::GLES2Interface* ContextGL() = 0;
36 virtual gpu::ContextSupport* ContextSupport() = 0; 37 virtual gpu::ContextSupport* ContextSupport() = 0;
37 virtual class GrContext* GrContext() = 0; 38 virtual class GrContext* GrContext() = 0;
38 39
39 struct Capabilities { 40 struct Capabilities {
40 gpu::Capabilities gpu; 41 gpu::Capabilities gpu;
41 size_t max_transfer_buffer_usage_bytes; 42 size_t max_transfer_buffer_usage_bytes;
42 43
43 CC_EXPORT Capabilities(); 44 CC_EXPORT Capabilities();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; 85 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0;
85 86
86 protected: 87 protected:
87 friend class base::RefCountedThreadSafe<ContextProvider>; 88 friend class base::RefCountedThreadSafe<ContextProvider>;
88 virtual ~ContextProvider() {} 89 virtual ~ContextProvider() {}
89 }; 90 };
90 91
91 } // namespace cc 92 } // namespace cc
92 93
93 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ 94 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698