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/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 last_frame_info_->output_surface_id); | 1104 last_frame_info_->output_surface_id); |
1105 | 1105 |
1106 ack_callbacks_.push(ack_callback); | 1106 ack_callbacks_.push(ack_callback); |
1107 } | 1107 } |
1108 | 1108 |
1109 last_frame_info_.reset(new LastFrameInfo(output_surface_id, frame.Pass())); | 1109 last_frame_info_.reset(new LastFrameInfo(output_surface_id, frame.Pass())); |
1110 } | 1110 } |
1111 | 1111 |
1112 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( | 1112 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( |
1113 const cc::CompositorFrameMetadata& frame_metadata) { | 1113 const cc::CompositorFrameMetadata& frame_metadata) { |
| 1114 if (!content_view_core_) |
| 1115 return; |
| 1116 |
1114 // This is a subset of OnSwapCompositorFrame() used in the synchronous | 1117 // This is a subset of OnSwapCompositorFrame() used in the synchronous |
1115 // compositor flow. | 1118 // compositor flow. |
1116 OnFrameMetadataUpdated(frame_metadata); | 1119 OnFrameMetadataUpdated(frame_metadata); |
1117 ComputeContentsSize(frame_metadata); | 1120 ComputeContentsSize(frame_metadata); |
1118 | 1121 |
1119 // DevTools ScreenCast support for Android WebView. | 1122 // DevTools ScreenCast support for Android WebView. |
1120 WebContents* web_contents = content_view_core_->GetWebContents(); | 1123 WebContents* web_contents = content_view_core_->GetWebContents(); |
1121 if (DevToolsAgentHost::HasFor(web_contents)) { | 1124 if (DevToolsAgentHost::HasFor(web_contents)) { |
1122 scoped_refptr<DevToolsAgentHost> dtah = | 1125 scoped_refptr<DevToolsAgentHost> dtah = |
1123 DevToolsAgentHost::GetOrCreateFor(web_contents); | 1126 DevToolsAgentHost::GetOrCreateFor(web_contents); |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 results->orientationAngle = display.RotationAsDegree(); | 1797 results->orientationAngle = display.RotationAsDegree(); |
1795 results->orientationType = | 1798 results->orientationType = |
1796 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1799 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1797 gfx::DeviceDisplayInfo info; | 1800 gfx::DeviceDisplayInfo info; |
1798 results->depth = info.GetBitsPerPixel(); | 1801 results->depth = info.GetBitsPerPixel(); |
1799 results->depthPerComponent = info.GetBitsPerComponent(); | 1802 results->depthPerComponent = info.GetBitsPerComponent(); |
1800 results->isMonochrome = (results->depthPerComponent == 0); | 1803 results->isMonochrome = (results->depthPerComponent == 0); |
1801 } | 1804 } |
1802 | 1805 |
1803 } // namespace content | 1806 } // namespace content |
OLD | NEW |