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 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2673 | 2673 |
2674 PP_Resource PepperPluginInstanceImpl::CreateExternalFileReference( | 2674 PP_Resource PepperPluginInstanceImpl::CreateExternalFileReference( |
2675 const base::FilePath& external_file_path) { | 2675 const base::FilePath& external_file_path) { |
2676 PPB_FileRef_Impl* ref = PPB_FileRef_Impl::CreateExternal( | 2676 PPB_FileRef_Impl* ref = PPB_FileRef_Impl::CreateExternal( |
2677 pp_instance(), external_file_path, ""); | 2677 pp_instance(), external_file_path, ""); |
2678 return ref->GetReference(); | 2678 return ref->GetReference(); |
2679 } | 2679 } |
2680 | 2680 |
2681 PP_Resource PepperPluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image, | 2681 PP_Resource PepperPluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image, |
2682 float scale) { | 2682 float scale) { |
2683 ui::ScaleFactor scale_factor = ui::GetScaleFactorFromScale(scale); | 2683 gfx::ImageSkiaRep image_skia_rep = source_image->GetRepresentation(scale); |
2684 gfx::ImageSkiaRep image_skia_rep = source_image->GetRepresentation( | |
2685 scale_factor); | |
2686 | 2684 |
2687 if (image_skia_rep.is_null() || image_skia_rep.scale_factor() != scale_factor) | 2685 if (image_skia_rep.is_null() || image_skia_rep.scale() != scale) |
2688 return 0; | 2686 return 0; |
2689 | 2687 |
2690 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( | 2688 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( |
2691 pp_instance(), | 2689 pp_instance(), |
2692 PPB_ImageData_Impl::PLATFORM)); | 2690 PPB_ImageData_Impl::PLATFORM)); |
2693 if (!image_data->Init( | 2691 if (!image_data->Init( |
2694 PPB_ImageData_Impl::GetNativeImageDataFormat(), | 2692 PPB_ImageData_Impl::GetNativeImageDataFormat(), |
2695 image_skia_rep.pixel_width(), | 2693 image_skia_rep.pixel_width(), |
2696 image_skia_rep.pixel_height(), | 2694 image_skia_rep.pixel_height(), |
2697 false)) { | 2695 false)) { |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2964 // Running out-of-process. Initiate an IPC call to notify the plugin | 2962 // Running out-of-process. Initiate an IPC call to notify the plugin |
2965 // process. | 2963 // process. |
2966 ppapi::proxy::HostDispatcher* dispatcher = | 2964 ppapi::proxy::HostDispatcher* dispatcher = |
2967 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 2965 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
2968 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 2966 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
2969 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 2967 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
2970 } | 2968 } |
2971 } | 2969 } |
2972 | 2970 |
2973 } // namespace content | 2971 } // namespace content |
OLD | NEW |