| 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 } | 790 } |
| 791 | 791 |
| 792 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( | 792 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( |
| 793 const cc::CompositorFrameMetadata& frame_metadata) { | 793 const cc::CompositorFrameMetadata& frame_metadata) { |
| 794 // This is a subset of OnSwapCompositorFrame() used in the synchronous | 794 // This is a subset of OnSwapCompositorFrame() used in the synchronous |
| 795 // compositor flow. | 795 // compositor flow. |
| 796 UpdateContentViewCoreFrameMetadata(frame_metadata); | 796 UpdateContentViewCoreFrameMetadata(frame_metadata); |
| 797 ComputeContentsSize(frame_metadata); | 797 ComputeContentsSize(frame_metadata); |
| 798 } | 798 } |
| 799 | 799 |
| 800 float RenderWidgetHostViewAndroid::GetDeviceScaleFactor() const { |
| 801 return content_view_core_->GetDeviceScaleFactor(); |
| 802 } |
| 803 |
| 800 void RenderWidgetHostViewAndroid::UpdateContentViewCoreFrameMetadata( | 804 void RenderWidgetHostViewAndroid::UpdateContentViewCoreFrameMetadata( |
| 801 const cc::CompositorFrameMetadata& frame_metadata) { | 805 const cc::CompositorFrameMetadata& frame_metadata) { |
| 802 if (content_view_core_) { | 806 if (content_view_core_) { |
| 803 // All offsets and sizes are in CSS pixels. | 807 // All offsets and sizes are in CSS pixels. |
| 804 content_view_core_->UpdateFrameInfo( | 808 content_view_core_->UpdateFrameInfo( |
| 805 frame_metadata.root_scroll_offset, | 809 frame_metadata.root_scroll_offset, |
| 806 frame_metadata.page_scale_factor, | 810 frame_metadata.page_scale_factor, |
| 807 gfx::Vector2dF(frame_metadata.min_page_scale_factor, | 811 gfx::Vector2dF(frame_metadata.min_page_scale_factor, |
| 808 frame_metadata.max_page_scale_factor), | 812 frame_metadata.max_page_scale_factor), |
| 809 frame_metadata.root_layer_size, | 813 frame_metadata.root_layer_size, |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 // RenderWidgetHostView, public: | 1384 // RenderWidgetHostView, public: |
| 1381 | 1385 |
| 1382 // static | 1386 // static |
| 1383 RenderWidgetHostView* | 1387 RenderWidgetHostView* |
| 1384 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1388 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 1385 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1389 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 1386 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1390 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 1387 } | 1391 } |
| 1388 | 1392 |
| 1389 } // namespace content | 1393 } // namespace content |
| OLD | NEW |