| OLD | NEW |
| 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 #include "ppapi/proxy/ppb_image_data_proxy.h" | 5 #include "ppapi/proxy/ppb_image_data_proxy.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy | 7 #include <string.h> // For memcpy |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "ppapi/c/pp_completion_callback.h" | 13 #include "ppapi/c/pp_completion_callback.h" |
| 14 #include "ppapi/c/pp_errors.h" | 14 #include "ppapi/c/pp_errors.h" |
| 15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
| 16 #include "ppapi/proxy/plugin_dispatcher.h" | 16 #include "ppapi/proxy/plugin_dispatcher.h" |
| 17 #include "ppapi/proxy/plugin_resource_tracker.h" | 17 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 18 #include "ppapi/proxy/ppapi_messages.h" | 18 #include "ppapi/proxy/ppapi_messages.h" |
| 19 #include "ppapi/shared_impl/host_resource.h" | 19 #include "ppapi/shared_impl/host_resource.h" |
| 20 #include "ppapi/shared_impl/resource.h" |
| 20 #include "ppapi/thunk/thunk.h" | 21 #include "ppapi/thunk/thunk.h" |
| 21 #include "skia/ext/platform_canvas.h" | 22 #include "skia/ext/platform_canvas.h" |
| 22 #include "ui/gfx/surface/transport_dib.h" | 23 #include "ui/gfx/surface/transport_dib.h" |
| 23 | 24 |
| 24 using ppapi::HostResource; | 25 using ppapi::HostResource; |
| 26 using ppapi::Resource; |
| 25 | 27 |
| 26 namespace pp { | 28 namespace pp { |
| 27 namespace proxy { | 29 namespace proxy { |
| 28 | 30 |
| 29 namespace { | 31 namespace { |
| 30 | 32 |
| 31 InterfaceProxy* CreateImageDataProxy(Dispatcher* dispatcher, | 33 InterfaceProxy* CreateImageDataProxy(Dispatcher* dispatcher, |
| 32 const void* target_interface) { | 34 const void* target_interface) { |
| 33 return new PPB_ImageData_Proxy(dispatcher, target_interface); | 35 return new PPB_ImageData_Proxy(dispatcher, target_interface); |
| 34 } | 36 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 59 | 61 |
| 60 bool PPB_ImageData_Proxy::OnMessageReceived(const IPC::Message& msg) { | 62 bool PPB_ImageData_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 61 return false; | 63 return false; |
| 62 } | 64 } |
| 63 | 65 |
| 64 // ImageData ------------------------------------------------------------------- | 66 // ImageData ------------------------------------------------------------------- |
| 65 | 67 |
| 66 ImageData::ImageData(const HostResource& resource, | 68 ImageData::ImageData(const HostResource& resource, |
| 67 const PP_ImageDataDesc& desc, | 69 const PP_ImageDataDesc& desc, |
| 68 ImageHandle handle) | 70 ImageHandle handle) |
| 69 : PluginResource(resource), | 71 : Resource(resource), |
| 70 desc_(desc) { | 72 desc_(desc) { |
| 71 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
| 72 transport_dib_.reset(TransportDIB::CreateWithHandle(handle)); | 74 transport_dib_.reset(TransportDIB::CreateWithHandle(handle)); |
| 73 #else | 75 #else |
| 74 transport_dib_.reset(TransportDIB::Map(handle)); | 76 transport_dib_.reset(TransportDIB::Map(handle)); |
| 75 #endif | 77 #endif |
| 76 } | 78 } |
| 77 | 79 |
| 78 ImageData::~ImageData() { | 80 ImageData::~ImageData() { |
| 79 } | 81 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return reinterpret_cast<ImageHandle>(i); | 129 return reinterpret_cast<ImageHandle>(i); |
| 128 #elif defined(OS_MACOSX) | 130 #elif defined(OS_MACOSX) |
| 129 return ImageHandle(i, false); | 131 return ImageHandle(i, false); |
| 130 #else | 132 #else |
| 131 return static_cast<ImageHandle>(i); | 133 return static_cast<ImageHandle>(i); |
| 132 #endif | 134 #endif |
| 133 } | 135 } |
| 134 | 136 |
| 135 } // namespace proxy | 137 } // namespace proxy |
| 136 } // namespace pp | 138 } // namespace pp |
| OLD | NEW |