Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura.cc ('k') | ui/app_list/views/app_list_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698