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

Side by Side Diff: trunk/src/content/browser/renderer_host/render_widget_host_view_android.cc

Issue 24262008: Revert 224473 "Remove dependency on ui::ScaleFactor from ui/gfx" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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/browser/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 if (!IsSurfaceAvailableForCopy()) { 560 if (!IsSurfaceAvailableForCopy()) {
561 callback.Run(false, SkBitmap()); 561 callback.Run(false, SkBitmap());
562 return; 562 return;
563 } 563 }
564 564
565 const gfx::Display& display = 565 const gfx::Display& display =
566 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); 566 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
567 float device_scale_factor = display.device_scale_factor(); 567 float device_scale_factor = display.device_scale_factor();
568 568
569 DCHECK_EQ(device_scale_factor, 569 DCHECK_EQ(device_scale_factor,
570 ui::GetImageScale(GetScaleFactorForView(this))); 570 ui::GetScaleFactorScale(GetScaleFactorForView(this)));
571 571
572 const gfx::Size& dst_size_in_pixel = ConvertViewSizeToPixel(this, dst_size); 572 const gfx::Size& dst_size_in_pixel = ConvertViewSizeToPixel(this, dst_size);
573 gfx::Rect src_subrect_in_pixel = 573 gfx::Rect src_subrect_in_pixel =
574 ConvertRectToPixel(device_scale_factor, src_subrect); 574 ConvertRectToPixel(device_scale_factor, src_subrect);
575 575
576 scoped_ptr<cc::CopyOutputRequest> request; 576 scoped_ptr<cc::CopyOutputRequest> request;
577 if (src_subrect_in_pixel.size() == dst_size_in_pixel) { 577 if (src_subrect_in_pixel.size() == dst_size_in_pixel) {
578 request = cc::CopyOutputRequest::CreateBitmapRequest(base::Bind( 578 request = cc::CopyOutputRequest::CreateBitmapRequest(base::Bind(
579 &RenderWidgetHostViewAndroid::PrepareBitmapCopyOutputResult, 579 &RenderWidgetHostViewAndroid::PrepareBitmapCopyOutputResult,
580 dst_size_in_pixel, 580 dst_size_in_pixel,
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 // RenderWidgetHostView, public: 1307 // RenderWidgetHostView, public:
1308 1308
1309 // static 1309 // static
1310 RenderWidgetHostView* 1310 RenderWidgetHostView*
1311 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { 1311 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) {
1312 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); 1312 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget);
1313 return new RenderWidgetHostViewAndroid(rwhi, NULL); 1313 return new RenderWidgetHostViewAndroid(rwhi, NULL);
1314 } 1314 }
1315 1315
1316 } // namespace content 1316 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698