OLD | NEW |
---|---|
(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 PPAPI_PROXY_GRAPHICS_2D_RESOURCE_H_ | |
6 #define PPAPI_PROXY_GRAPHICS_2D_RESOURCE_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "ppapi/proxy/plugin_resource.h" | |
10 #include "ppapi/proxy/ppapi_proxy_export.h" | |
11 #include "ppapi/shared_impl/api_id.h" | |
12 #include "ppapi/thunk/ppb_graphics_2d_api.h" | |
13 | |
14 namespace ppapi { | |
15 | |
16 class TrackedCallback; | |
17 | |
18 namespace proxy { | |
19 | |
20 class PPAPI_PROXY_EXPORT Graphics2DResource | |
21 : public PluginResource, | |
22 public NON_EXPORTED_BASE(thunk::PPB_Graphics2D_API) { | |
23 public: | |
24 Graphics2DResource(Connection connection, | |
25 PP_Instance instance, | |
26 const PP_Size& size, | |
27 PP_Bool is_always_opaque); | |
28 | |
29 virtual ~Graphics2DResource(); | |
30 | |
31 // Resource overrides. | |
32 virtual thunk::PPB_Graphics2D_API* AsPPB_Graphics2D_API() OVERRIDE; | |
33 | |
34 // PPB_Graphics2D_API overrides. | |
35 virtual PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque) OVERRIDE; | |
36 virtual void PaintImageData(PP_Resource image_data, | |
37 const PP_Point* top_left, | |
38 const PP_Rect* src_rect) OVERRIDE; | |
39 virtual void Scroll(const PP_Rect* clip_rect, | |
40 const PP_Point* amount) OVERRIDE; | |
41 virtual void ReplaceContents(PP_Resource image_data) OVERRIDE; | |
42 virtual bool SetScale(float scale) OVERRIDE; | |
43 virtual float GetScale() OVERRIDE; | |
44 virtual int32_t Flush(scoped_refptr<TrackedCallback> callback, | |
45 PP_Resource* old_image_data) OVERRIDE; | |
46 virtual bool ReadImageData(PP_Resource image, | |
47 const PP_Point* top_left) OVERRIDE; | |
48 | |
49 private: | |
50 static const ApiID kApiID = API_ID_PPB_GRAPHICS_2D; | |
brettw
2012/10/19 21:44:13
You shouldn't need this line any more, it's only u
victorhsieh
2012/10/22 02:18:53
Done.
| |
51 | |
52 void OnPluginMsgFlushACK(const ResourceMessageReplyParams& params); | |
53 | |
54 const PP_Size size_; | |
55 const PP_Bool is_always_opaque_; | |
56 float scale_; | |
57 | |
58 scoped_refptr<TrackedCallback> current_flush_callback_; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(Graphics2DResource); | |
61 }; | |
62 | |
63 } // namespace proxy | |
64 } // namespace ppapi | |
65 | |
66 #endif // PPAPI_PROXY_GRAPHICS_2D_RESOURCE_H_ | |
OLD | NEW |