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

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

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android build Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER
6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER
7
8 #include "base/memory/scoped_ptr.h"
9 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
10 #include "ui/gl/context_provider.h"
11
12 namespace webkit {
13 namespace gpu {
14 class GrContextForWebGraphicsContext3D;
15 }
16 }
17
18 namespace content {
19
20 // Implementation of ui::ContextProvider that provides a
21 // WebGraphicsContext3DCommandBufferImpl context and a GrContext.
22 class ContextProviderCommandBuffer : public ui::ContextProvider {
23 public:
24 ContextProviderCommandBuffer();
25
26 virtual bool InitializeOnMainThread() OVERRIDE;
27 virtual bool BindToCurrentThread() OVERRIDE;
28 virtual WebGraphicsContext3DCommandBufferImpl* Context3d() OVERRIDE;
29 virtual class GrContext* GrContext() OVERRIDE;
30 virtual void VerifyContexts() OVERRIDE;
31
32 bool destroyed() const { return destroyed_; }
33
34 protected:
35 virtual ~ContextProviderCommandBuffer();
36
37 // Subclass must provide an implementation to create an offscreen context.
38 virtual scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
39 CreateOffscreenContext3d() = 0;
40
41 virtual void OnLostContext();
42 virtual void OnMemoryAllocationChanged(bool nonzero_allocation);
43
44 private:
45
46 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_;
47 scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_;
48 bool destroyed_;
49
50 class LostContextCallbackProxy;
51 scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_;
52
53 class MemoryAllocationCallbackProxy;
54 scoped_ptr<MemoryAllocationCallbackProxy> memory_allocation_callback_proxy_;
55 };
56
57 } // namespace content
58
59 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698