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

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

Issue 12212100: Provide shared context to Platform API in renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseforreals Created 7 years, 9 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 | Annotate | Revision Log
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 5 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER
6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER 6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "cc/context_provider.h" 10 #include "cc/context_provider.h"
(...skipping 11 matching lines...) Expand all
22 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. 22 // WebGraphicsContext3DCommandBufferImpl context and a GrContext.
23 class ContextProviderCommandBuffer : public cc::ContextProvider { 23 class ContextProviderCommandBuffer : public cc::ContextProvider {
24 public: 24 public:
25 ContextProviderCommandBuffer(); 25 ContextProviderCommandBuffer();
26 26
27 virtual bool InitializeOnMainThread() OVERRIDE; 27 virtual bool InitializeOnMainThread() OVERRIDE;
28 virtual bool BindToCurrentThread() OVERRIDE; 28 virtual bool BindToCurrentThread() OVERRIDE;
29 virtual WebGraphicsContext3DCommandBufferImpl* Context3d() OVERRIDE; 29 virtual WebGraphicsContext3DCommandBufferImpl* Context3d() OVERRIDE;
30 virtual class GrContext* GrContext() OVERRIDE; 30 virtual class GrContext* GrContext() OVERRIDE;
31 virtual void VerifyContexts() OVERRIDE; 31 virtual void VerifyContexts() OVERRIDE;
32 32 virtual bool DestroyedOnMainThread() OVERRIDE;
33 bool DestroyedOnMainThread();
34 33
35 protected: 34 protected:
36 virtual ~ContextProviderCommandBuffer(); 35 virtual ~ContextProviderCommandBuffer();
37 36
38 // Subclass must provide an implementation to create an offscreen context. 37 // Subclass must provide an implementation to create an offscreen context.
39 virtual scoped_ptr<WebGraphicsContext3DCommandBufferImpl> 38 virtual scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
40 CreateOffscreenContext3d() = 0; 39 CreateOffscreenContext3d() = 0;
41 40
42 virtual void OnLostContext(); 41 virtual void OnLostContext();
43 virtual void OnMemoryAllocationChanged(bool nonzero_allocation); 42 virtual void OnMemoryAllocationChanged(bool nonzero_allocation);
44 43
45 private: 44 private:
46 45
47 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; 46 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_;
48 scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_; 47 scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_;
49 48
50 base::Lock destroyed_lock_; 49 base::Lock destroyed_lock_;
51 bool destroyed_; 50 bool destroyed_;
52 51
53 class LostContextCallbackProxy; 52 class LostContextCallbackProxy;
54 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; 53 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_;
55 54
56 class MemoryAllocationCallbackProxy; 55 class MemoryAllocationCallbackProxy;
57 scoped_ptr<MemoryAllocationCallbackProxy> memory_allocation_callback_proxy_; 56 scoped_ptr<MemoryAllocationCallbackProxy> memory_allocation_callback_proxy_;
58 }; 57 };
59 58
60 } // namespace content 59 } // namespace content
61 60
62 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER 61 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER
OLDNEW
« no previous file with comments | « content/browser/renderer_host/image_transport_factory.cc ('k') | content/common/webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698