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/sys_utils.h" | 9 #include "base/android/sys_utils.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 // Unblock the compositor. | 924 // Unblock the compositor. |
925 BrowserThread::PostTask( | 925 BrowserThread::PostTask( |
926 BrowserThread::UI, FROM_HERE, | 926 BrowserThread::UI, FROM_HERE, |
927 base::Bind(&RenderViewDevToolsAgentHost::SynchronousSwapCompositorFrame, | 927 base::Bind(&RenderViewDevToolsAgentHost::SynchronousSwapCompositorFrame, |
928 static_cast<RenderViewDevToolsAgentHost*>(dtah.get()), | 928 static_cast<RenderViewDevToolsAgentHost*>(dtah.get()), |
929 frame_metadata)); | 929 frame_metadata)); |
930 } | 930 } |
931 } | 931 } |
932 | 932 |
933 void RenderWidgetHostViewAndroid::SetOverlayVideoMode(bool enabled) { | 933 void RenderWidgetHostViewAndroid::SetOverlayVideoMode(bool enabled) { |
934 layer_->SetContentsOpaque(!enabled); | 934 if (layer_) |
| 935 layer_->SetContentsOpaque(!enabled); |
935 } | 936 } |
936 | 937 |
937 void RenderWidgetHostViewAndroid::SynchronousCopyContents( | 938 void RenderWidgetHostViewAndroid::SynchronousCopyContents( |
938 const gfx::Rect& src_subrect_in_pixel, | 939 const gfx::Rect& src_subrect_in_pixel, |
939 const gfx::Size& dst_size_in_pixel, | 940 const gfx::Size& dst_size_in_pixel, |
940 const base::Callback<void(bool, const SkBitmap&)>& callback, | 941 const base::Callback<void(bool, const SkBitmap&)>& callback, |
941 const SkBitmap::Config config) { | 942 const SkBitmap::Config config) { |
942 SynchronousCompositor* compositor = | 943 SynchronousCompositor* compositor = |
943 SynchronousCompositorImpl::FromID(host_->GetProcess()->GetID(), | 944 SynchronousCompositorImpl::FromID(host_->GetProcess()->GetID(), |
944 host_->GetRoutingID()); | 945 host_->GetRoutingID()); |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1451 results->availableRect = display.work_area(); | 1452 results->availableRect = display.work_area(); |
1452 results->deviceScaleFactor = display.device_scale_factor(); | 1453 results->deviceScaleFactor = display.device_scale_factor(); |
1453 results->orientationAngle = display.RotationAsDegree(); | 1454 results->orientationAngle = display.RotationAsDegree(); |
1454 gfx::DeviceDisplayInfo info; | 1455 gfx::DeviceDisplayInfo info; |
1455 results->depth = info.GetBitsPerPixel(); | 1456 results->depth = info.GetBitsPerPixel(); |
1456 results->depthPerComponent = info.GetBitsPerComponent(); | 1457 results->depthPerComponent = info.GetBitsPerComponent(); |
1457 results->isMonochrome = (results->depthPerComponent == 0); | 1458 results->isMonochrome = (results->depthPerComponent == 0); |
1458 } | 1459 } |
1459 | 1460 |
1460 } // namespace content | 1461 } // namespace content |
OLD | NEW |