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 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2665 const GURL& PepperPluginInstanceImpl::GetPluginURL() { | 2665 const GURL& PepperPluginInstanceImpl::GetPluginURL() { |
2666 return plugin_url_; | 2666 return plugin_url_; |
2667 } | 2667 } |
2668 | 2668 |
2669 base::FilePath PepperPluginInstanceImpl::GetModulePath() { | 2669 base::FilePath PepperPluginInstanceImpl::GetModulePath() { |
2670 return module_->path(); | 2670 return module_->path(); |
2671 } | 2671 } |
2672 | 2672 |
2673 PP_Resource PepperPluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image, | 2673 PP_Resource PepperPluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image, |
2674 float scale) { | 2674 float scale) { |
2675 ui::ScaleFactor scale_factor = ui::GetScaleFactorFromScale(scale); | 2675 gfx::ImageSkiaRep image_skia_rep = source_image->GetRepresentation(scale); |
2676 gfx::ImageSkiaRep image_skia_rep = source_image->GetRepresentation( | |
2677 scale_factor); | |
2678 | 2676 |
2679 if (image_skia_rep.is_null() || image_skia_rep.scale_factor() != scale_factor) | 2677 if (image_skia_rep.is_null() || image_skia_rep.scale() != scale) |
2680 return 0; | 2678 return 0; |
2681 | 2679 |
2682 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( | 2680 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( |
2683 pp_instance(), | 2681 pp_instance(), |
2684 PPB_ImageData_Impl::PLATFORM)); | 2682 PPB_ImageData_Impl::PLATFORM)); |
2685 if (!image_data->Init( | 2683 if (!image_data->Init( |
2686 PPB_ImageData_Impl::GetNativeImageDataFormat(), | 2684 PPB_ImageData_Impl::GetNativeImageDataFormat(), |
2687 image_skia_rep.pixel_width(), | 2685 image_skia_rep.pixel_width(), |
2688 image_skia_rep.pixel_height(), | 2686 image_skia_rep.pixel_height(), |
2689 false)) { | 2687 false)) { |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2974 // Running out-of-process. Initiate an IPC call to notify the plugin | 2972 // Running out-of-process. Initiate an IPC call to notify the plugin |
2975 // process. | 2973 // process. |
2976 ppapi::proxy::HostDispatcher* dispatcher = | 2974 ppapi::proxy::HostDispatcher* dispatcher = |
2977 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 2975 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
2978 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 2976 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
2979 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 2977 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
2980 } | 2978 } |
2981 } | 2979 } |
2982 | 2980 |
2983 } // namespace content | 2981 } // namespace content |
OLD | NEW |