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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |