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

Side by Side Diff: blimp/client/compositor/blimp_context_provider.h

Issue 1317743002: cc: Implement shared worker contexts. (v1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tear down Created 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ 5 #ifndef BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_
6 #define BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ 6 #define BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.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 16 matching lines...) Expand all
27 void DetachFromThread() override; 27 void DetachFromThread() override;
28 Capabilities ContextCapabilities() override; 28 Capabilities ContextCapabilities() override;
29 gpu::gles2::GLES2Interface* ContextGL() override; 29 gpu::gles2::GLES2Interface* ContextGL() override;
30 gpu::ContextSupport* ContextSupport() override; 30 gpu::ContextSupport* ContextSupport() override;
31 class GrContext* GrContext() override; 31 class GrContext* GrContext() override;
32 void InvalidateGrContext(uint32_t state) override; 32 void InvalidateGrContext(uint32_t state) override;
33 void SetupLock() override; 33 void SetupLock() override;
34 base::Lock* GetLock() override; 34 base::Lock* GetLock() override;
35 void VerifyContexts() override; 35 void VerifyContexts() override;
36 void DeleteCachedResources() override; 36 void DeleteCachedResources() override;
37 bool DestroyedOnMainThread() override; 37 bool HasBeenLostOnMainThread() override;
38 void SetLostContextCallback( 38 void SetLostContextCallback(
39 const LostContextCallback& lost_context_callback) override; 39 const LostContextCallback& lost_context_callback) override;
40 void SetMemoryPolicyChangedCallback( 40 void SetMemoryPolicyChangedCallback(
41 const MemoryPolicyChangedCallback& memory_policy_changed_callback) 41 const MemoryPolicyChangedCallback& memory_policy_changed_callback)
42 override; 42 override;
43 bool HasBeenDestroyed() override;
43 44
44 protected: 45 protected:
45 explicit BlimpContextProvider(gfx::AcceleratedWidget widget); 46 explicit BlimpContextProvider(gfx::AcceleratedWidget widget);
46 ~BlimpContextProvider() override; 47 ~BlimpContextProvider() override;
47 48
48 private: 49 private:
49 void OnLostContext(); 50 void OnLostContext();
50 51
51 base::ThreadChecker main_thread_checker_; 52 base::ThreadChecker main_thread_checker_;
52 base::ThreadChecker context_thread_checker_; 53 base::ThreadChecker context_thread_checker_;
53 54
54 base::Lock context_lock_; 55 base::Lock context_lock_;
55 scoped_ptr<gpu::GLInProcessContext> context_; 56 scoped_ptr<gpu::GLInProcessContext> context_;
56 skia::RefPtr<class GrContext> gr_context_; 57 skia::RefPtr<class GrContext> gr_context_;
57 58
58 cc::ContextProvider::Capabilities capabilities_; 59 cc::ContextProvider::Capabilities capabilities_;
59 60
60 LostContextCallback lost_context_callback_; 61 LostContextCallback lost_context_callback_;
61 62
62 base::Lock destroyed_lock_; 63 base::Lock lost_lock_;
63 bool destroyed_; 64 bool lost_;
64 65
65 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); 66 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider);
66 }; 67 };
67 68
68 } // namespace blimp 69 } // namespace blimp
69 70
70 #endif // BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ 71 #endif // BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_
OLDNEW
« no previous file with comments | « android_webview/browser/aw_render_thread_context_provider.cc ('k') | blimp/client/compositor/blimp_context_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698