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

Side by Side Diff: ppapi/proxy/ppb_graphics_2d_proxy.h

Issue 7740038: Use macros to define pepper interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New patch Created 9 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_font_proxy.cc ('k') | ppapi/proxy/ppb_graphics_2d_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 PPAPI_PPB_GRAPHICS_2D_PROXY_H_ 5 #ifndef PPAPI_PPB_GRAPHICS_2D_PROXY_H_
6 #define PPAPI_PPB_GRAPHICS_2D_PROXY_H_ 6 #define PPAPI_PPB_GRAPHICS_2D_PROXY_H_
7 7
8 #include "ppapi/c/pp_bool.h" 8 #include "ppapi/c/pp_bool.h"
9 #include "ppapi/c/pp_completion_callback.h" 9 #include "ppapi/c/pp_completion_callback.h"
10 #include "ppapi/c/pp_module.h" 10 #include "ppapi/c/pp_module.h"
11 #include "ppapi/c/pp_module.h" 11 #include "ppapi/c/pp_module.h"
12 #include "ppapi/c/pp_resource.h" 12 #include "ppapi/c/pp_resource.h"
13 #include "ppapi/c/pp_size.h" 13 #include "ppapi/c/pp_size.h"
14 #include "ppapi/c/pp_var.h" 14 #include "ppapi/c/pp_var.h"
15 #include "ppapi/cpp/completion_callback.h" 15 #include "ppapi/cpp/completion_callback.h"
16 #include "ppapi/proxy/interface_proxy.h" 16 #include "ppapi/proxy/interface_proxy.h"
17 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" 17 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h"
18 #include "ppapi/shared_impl/host_resource.h" 18 #include "ppapi/shared_impl/host_resource.h"
19 19
20 struct PPB_Graphics2D; 20 struct PPB_Graphics2D;
21 struct PP_Point; 21 struct PP_Point;
22 struct PP_Rect; 22 struct PP_Rect;
23 23
24 namespace ppapi { 24 namespace ppapi {
25 namespace proxy { 25 namespace proxy {
26 26
27 class PPB_Graphics2D_Proxy : public InterfaceProxy { 27 class PPB_Graphics2D_Proxy : public InterfaceProxy {
28 public: 28 public:
29 PPB_Graphics2D_Proxy(Dispatcher* dispatcher, const void* target_interface); 29 PPB_Graphics2D_Proxy(Dispatcher* dispatcher);
30 virtual ~PPB_Graphics2D_Proxy(); 30 virtual ~PPB_Graphics2D_Proxy();
31 31
32 static const Info* GetInfo();
33
34 static PP_Resource CreateProxyResource(PP_Instance instance, 32 static PP_Resource CreateProxyResource(PP_Instance instance,
35 const PP_Size& size, 33 const PP_Size& size,
36 PP_Bool is_always_opaque); 34 PP_Bool is_always_opaque);
37 35
38 const PPB_Graphics2D* ppb_graphics_2d_target() const {
39 return static_cast<const PPB_Graphics2D*>(target_interface());
40 }
41
42 // InterfaceProxy implementation. 36 // InterfaceProxy implementation.
43 virtual bool OnMessageReceived(const IPC::Message& msg); 37 virtual bool OnMessageReceived(const IPC::Message& msg);
44 38
39 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_GRAPHICS_2D;
40
45 private: 41 private:
46 // Plugin->renderer message handlers. 42 // Plugin->renderer message handlers.
47 void OnMsgPaintImageData(const ppapi::HostResource& graphics_2d, 43 void OnMsgPaintImageData(const ppapi::HostResource& graphics_2d,
48 const ppapi::HostResource& image_data, 44 const ppapi::HostResource& image_data,
49 const PP_Point& top_left, 45 const PP_Point& top_left,
50 bool src_rect_specified, 46 bool src_rect_specified,
51 const PP_Rect& src_rect); 47 const PP_Rect& src_rect);
52 void OnMsgScroll(const ppapi::HostResource& graphics_2d, 48 void OnMsgScroll(const ppapi::HostResource& graphics_2d,
53 bool clip_specified, 49 bool clip_specified,
54 const PP_Rect& clip, 50 const PP_Rect& clip,
55 const PP_Point& amount); 51 const PP_Point& amount);
56 void OnMsgReplaceContents(const ppapi::HostResource& graphics_2d, 52 void OnMsgReplaceContents(const ppapi::HostResource& graphics_2d,
57 const ppapi::HostResource& image_data); 53 const ppapi::HostResource& image_data);
58 void OnMsgFlush(const ppapi::HostResource& graphics_2d); 54 void OnMsgFlush(const ppapi::HostResource& graphics_2d);
59 55
60 // Renderer->plugin message handlers. 56 // Renderer->plugin message handlers.
61 void OnMsgFlushACK(const ppapi::HostResource& graphics_2d, 57 void OnMsgFlushACK(const ppapi::HostResource& graphics_2d,
62 int32_t pp_error); 58 int32_t pp_error);
63 59
64 // Called in the renderer to send the given flush ACK to the plugin. 60 // Called in the renderer to send the given flush ACK to the plugin.
65 void SendFlushACKToPlugin(int32_t result, 61 void SendFlushACKToPlugin(int32_t result,
66 const ppapi::HostResource& graphics_2d); 62 const ppapi::HostResource& graphics_2d);
67 63
68 pp::CompletionCallbackFactory<PPB_Graphics2D_Proxy, 64 pp::CompletionCallbackFactory<PPB_Graphics2D_Proxy,
69 ProxyNonThreadSafeRefCount> callback_factory_; 65 ProxyNonThreadSafeRefCount> callback_factory_;
66
67 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics2D_Proxy);
70 }; 68 };
71 69
72 } // namespace proxy 70 } // namespace proxy
73 } // namespace ppapi 71 } // namespace ppapi
74 72
75 #endif // PPAPI_PPB_GRAPHICS_2D_PROXY_H_ 73 #endif // PPAPI_PPB_GRAPHICS_2D_PROXY_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_font_proxy.cc ('k') | ppapi/proxy/ppb_graphics_2d_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698