OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_IMAGE_DATA_PROXY_H_ | 5 #ifndef PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
6 #define PPAPI_PPB_IMAGE_DATA_PROXY_H_ | 6 #define PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 virtual ppapi::thunk::PPB_ImageData_API* AsPPB_ImageData_API() OVERRIDE; | 52 virtual ppapi::thunk::PPB_ImageData_API* AsPPB_ImageData_API() OVERRIDE; |
53 virtual void LastPluginRefWasDeleted() OVERRIDE; | 53 virtual void LastPluginRefWasDeleted() OVERRIDE; |
54 | 54 |
55 // PPB_ImageData API. | 55 // PPB_ImageData API. |
56 virtual PP_Bool Describe(PP_ImageDataDesc* desc) OVERRIDE; | 56 virtual PP_Bool Describe(PP_ImageDataDesc* desc) OVERRIDE; |
57 virtual void* Map() OVERRIDE; | 57 virtual void* Map() OVERRIDE; |
58 virtual void Unmap() OVERRIDE; | 58 virtual void Unmap() OVERRIDE; |
59 virtual int32_t GetSharedMemory(int* handle, uint32_t* byte_count) OVERRIDE; | 59 virtual int32_t GetSharedMemory(int* handle, uint32_t* byte_count) OVERRIDE; |
60 virtual SkCanvas* GetPlatformCanvas() OVERRIDE; | 60 virtual SkCanvas* GetPlatformCanvas() OVERRIDE; |
61 virtual SkCanvas* GetCanvas() OVERRIDE; | 61 virtual SkCanvas* GetCanvas() OVERRIDE; |
| 62 virtual void SetUsedInReplaceContents() OVERRIDE; |
62 | 63 |
63 const PP_ImageDataDesc& desc() const { return desc_; } | 64 const PP_ImageDataDesc& desc() const { return desc_; } |
64 | 65 |
65 void set_used_in_replace_contents() { used_in_replace_contents_ = true; } | |
66 | |
67 // Prepares this image data to be recycled to the plugin. The contents will be | 66 // Prepares this image data to be recycled to the plugin. The contents will be |
68 // cleared if zero_contents is set. | 67 // cleared if zero_contents is set. |
69 void RecycleToPlugin(bool zero_contents); | 68 void RecycleToPlugin(bool zero_contents); |
70 | 69 |
71 #if !defined(OS_NACL) | 70 #if !defined(OS_NACL) |
72 static ImageHandle NullHandle(); | 71 static ImageHandle NullHandle(); |
73 static ImageHandle HandleFromInt(int32_t i); | 72 static ImageHandle HandleFromInt(int32_t i); |
74 #endif | 73 #endif |
75 | 74 |
76 private: | 75 private: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Host->Plugin message handlers. | 128 // Host->Plugin message handlers. |
130 void OnPluginMsgNotifyUnusedImageData(const HostResource& old_image_data); | 129 void OnPluginMsgNotifyUnusedImageData(const HostResource& old_image_data); |
131 | 130 |
132 DISALLOW_COPY_AND_ASSIGN(PPB_ImageData_Proxy); | 131 DISALLOW_COPY_AND_ASSIGN(PPB_ImageData_Proxy); |
133 }; | 132 }; |
134 | 133 |
135 } // namespace proxy | 134 } // namespace proxy |
136 } // namespace ppapi | 135 } // namespace ppapi |
137 | 136 |
138 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ | 137 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
OLD | NEW |