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

Side by Side Diff: webkit/plugins/ppapi/ppb_graphics_3d_impl.h

Issue 20165002: Move webkit/plugins/ppapi to content/renderer/pepper. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: more more clang fun Created 7 years, 5 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) 2012 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 WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h"
10 #include "ppapi/shared_impl/resource.h"
11 #include "webkit/plugins/ppapi/plugin_delegate.h"
12
13 namespace webkit {
14 namespace ppapi {
15
16 class PPB_Graphics3D_Impl : public ::ppapi::PPB_Graphics3D_Shared {
17 public:
18 virtual ~PPB_Graphics3D_Impl();
19
20 static PP_Resource Create(PP_Instance instance,
21 PP_Resource share_context,
22 const int32_t* attrib_list);
23 static PP_Resource CreateRaw(PP_Instance instance,
24 PP_Resource share_context,
25 const int32_t* attrib_list);
26
27 // PPB_Graphics3D_API trusted implementation.
28 virtual PP_Bool SetGetBuffer(int32_t transfer_buffer_id) OVERRIDE;
29 virtual gpu::CommandBuffer::State GetState() OVERRIDE;
30 virtual int32_t CreateTransferBuffer(uint32_t size) OVERRIDE;
31 virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE;
32 virtual PP_Bool GetTransferBuffer(int32_t id,
33 int* shm_handle,
34 uint32_t* shm_size) OVERRIDE;
35 virtual PP_Bool Flush(int32_t put_offset) OVERRIDE;
36 virtual gpu::CommandBuffer::State FlushSync(int32_t put_offset) OVERRIDE;
37 virtual gpu::CommandBuffer::State FlushSyncFast(
38 int32_t put_offset,
39 int32_t last_known_get) OVERRIDE;
40 virtual uint32_t InsertSyncPoint() OVERRIDE;
41
42 // Binds/unbinds the graphics of this context with the associated instance.
43 // Returns true if binding/unbinding is successful.
44 bool BindToInstance(bool bind);
45
46 // Returns true if the backing texture is always opaque.
47 bool IsOpaque();
48
49 // Notifications about the view's progress painting. See PluginInstance.
50 // These messages are used to send Flush callbacks to the plugin.
51 void ViewWillInitiatePaint();
52 void ViewInitiatedPaint();
53 void ViewFlushedPaint();
54
55 PluginDelegate::PlatformContext3D* platform_context() {
56 return platform_context_.get();
57 }
58
59 protected:
60 // ppapi::PPB_Graphics3D_Shared overrides.
61 virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE;
62 virtual int32 DoSwapBuffers() OVERRIDE;
63
64 private:
65 explicit PPB_Graphics3D_Impl(PP_Instance instance);
66
67 static PP_Bool IsGpuBlacklisted();
68
69 bool Init(PPB_Graphics3D_API* share_context,
70 const int32_t* attrib_list);
71 bool InitRaw(PPB_Graphics3D_API* share_context,
72 const int32_t* attrib_list);
73
74 // Notifications received from the GPU process.
75 void OnSwapBuffers();
76 void OnContextLost();
77 void OnConsoleMessage(const std::string& msg, int id);
78 // Notifications sent to plugin.
79 void SendContextLost();
80
81 // True if context is bound to instance.
82 bool bound_to_instance_;
83 // True when waiting for compositor to commit our backing texture.
84 bool commit_pending_;
85 // PluginDelegate's 3D Context. Responsible for providing the command buffer.
86 scoped_ptr<PluginDelegate::PlatformContext3D> platform_context_;
87 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_;
88
89 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl);
90 };
91
92 } // namespace ppapi
93 } // namespace webkit
94
95 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_gpu_blacklist_private_impl.cc ('k') | webkit/plugins/ppapi/ppb_graphics_3d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698