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

Side by Side Diff: webkit/gpu/context_provider_in_process.h

Issue 12217099: Implement the Platform::sharedOffscreenGraphicsContext3D method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop was_created 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 WEBKIT_GPU_CONTEXT_PROVIDER_IN_PROCESS_H_
6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER 6 #define WEBKIT_GPU_CONTEXT_PROVIDER_IN_PROCESS_H_
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"
11 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 11
12 namespace WebKit { class WebGraphicsContext3D; }
12 13
13 namespace webkit { 14 namespace webkit {
14 namespace gpu { 15 namespace gpu {
15 class GrContextForWebGraphicsContext3D; 16 class GrContextForWebGraphicsContext3D;
16 }
17 }
18 17
19 namespace content { 18 class ContextProviderInProcess : public cc::ContextProvider {
20
21 // Implementation of cc::ContextProvider that provides a
22 // WebGraphicsContext3DCommandBufferImpl context and a GrContext.
23 class ContextProviderCommandBuffer : public cc::ContextProvider {
24 public: 19 public:
25 ContextProviderCommandBuffer(); 20 enum InProcessType {
21 IN_PROCESS,
22 IN_PROCESS_COMMAND_BUFFER,
23 };
24 explicit ContextProviderInProcess(InProcessType type);
26 25
27 virtual bool InitializeOnMainThread() OVERRIDE; 26 virtual bool InitializeOnMainThread() OVERRIDE;
28 virtual bool BindToCurrentThread() OVERRIDE; 27 virtual bool BindToCurrentThread() OVERRIDE;
29 virtual WebGraphicsContext3DCommandBufferImpl* Context3d() OVERRIDE; 28 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE;
30 virtual class GrContext* GrContext() OVERRIDE; 29 virtual class GrContext* GrContext() OVERRIDE;
31 virtual void VerifyContexts() OVERRIDE; 30 virtual void VerifyContexts() OVERRIDE;
32 31
33 bool DestroyedOnMainThread(); 32 bool DestroyedOnMainThread();
34 33
35 protected: 34 protected:
36 virtual ~ContextProviderCommandBuffer(); 35 virtual ~ContextProviderInProcess();
37 36
38 // Subclass must provide an implementation to create an offscreen context. 37 scoped_ptr<WebKit::WebGraphicsContext3D> CreateOffscreenContext3d();
39 virtual scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
40 CreateOffscreenContext3d() = 0;
41 38
42 virtual void OnLostContext(); 39 virtual void OnLostContext();
43 virtual void OnMemoryAllocationChanged(bool nonzero_allocation); 40 virtual void OnMemoryAllocationChanged(bool nonzero_allocation);
44 41
45 private: 42 private:
46 43 InProcessType type_;
47 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; 44 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_;
48 scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_; 45 scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_;
49 46
50 base::Lock destroyed_lock_; 47 base::Lock destroyed_lock_;
51 bool destroyed_; 48 bool destroyed_;
52 49
53 class LostContextCallbackProxy; 50 class LostContextCallbackProxy;
54 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; 51 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_;
55 52
56 class MemoryAllocationCallbackProxy; 53 class MemoryAllocationCallbackProxy;
57 scoped_ptr<MemoryAllocationCallbackProxy> memory_allocation_callback_proxy_; 54 scoped_ptr<MemoryAllocationCallbackProxy> memory_allocation_callback_proxy_;
58 }; 55 };
59 56
60 } // namespace content 57 } // namespace gpu
58 } // namespace webkit
61 59
62 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER 60 #endif // WEBKIT_GPU_CONTEXT_PROVIDER_IN_PROCESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698