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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "base/sys_info.h" | 19 #include "base/sys_info.h" |
20 #include "base/threading/worker_pool.h" | 20 #include "base/threading/worker_pool.h" |
21 #include "cc/layers/layer.h" | 21 #include "cc/layers/layer.h" |
22 #include "cc/layers/layer_settings.h" | |
23 #include "cc/layers/surface_layer.h" | 22 #include "cc/layers/surface_layer.h" |
24 #include "cc/output/compositor_frame.h" | 23 #include "cc/output/compositor_frame.h" |
25 #include "cc/output/compositor_frame_ack.h" | 24 #include "cc/output/compositor_frame_ack.h" |
26 #include "cc/output/copy_output_request.h" | 25 #include "cc/output/copy_output_request.h" |
27 #include "cc/output/copy_output_result.h" | 26 #include "cc/output/copy_output_result.h" |
28 #include "cc/output/latency_info_swap_promise.h" | 27 #include "cc/output/latency_info_swap_promise.h" |
29 #include "cc/output/viewport_selection_bound.h" | 28 #include "cc/output/viewport_selection_bound.h" |
30 #include "cc/resources/single_release_callback.h" | 29 #include "cc/resources/single_release_callback.h" |
31 #include "cc/surfaces/surface.h" | 30 #include "cc/surfaces/surface.h" |
32 #include "cc/surfaces/surface_factory.h" | 31 #include "cc/surfaces/surface_factory.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 } | 438 } |
440 | 439 |
441 scoped_refptr<cc::Layer> RenderWidgetHostViewAndroid::CreateDelegatedLayer() | 440 scoped_refptr<cc::Layer> RenderWidgetHostViewAndroid::CreateDelegatedLayer() |
442 const { | 441 const { |
443 scoped_refptr<cc::Layer> delegated_layer; | 442 scoped_refptr<cc::Layer> delegated_layer; |
444 DCHECK(!surface_id_.is_null()); | 443 DCHECK(!surface_id_.is_null()); |
445 cc::SurfaceManager* manager = CompositorImpl::GetSurfaceManager(); | 444 cc::SurfaceManager* manager = CompositorImpl::GetSurfaceManager(); |
446 DCHECK(manager); | 445 DCHECK(manager); |
447 // manager must outlive compositors using it. | 446 // manager must outlive compositors using it. |
448 scoped_refptr<cc::SurfaceLayer> surface_layer = cc::SurfaceLayer::Create( | 447 scoped_refptr<cc::SurfaceLayer> surface_layer = cc::SurfaceLayer::Create( |
449 cc::LayerSettings(), | |
450 base::Bind(&SatisfyCallback, base::Unretained(manager)), | 448 base::Bind(&SatisfyCallback, base::Unretained(manager)), |
451 base::Bind(&RequireCallback, base::Unretained(manager))); | 449 base::Bind(&RequireCallback, base::Unretained(manager))); |
452 surface_layer->SetSurfaceId(surface_id_, 1.f, texture_size_in_layer_); | 450 surface_layer->SetSurfaceId(surface_id_, 1.f, texture_size_in_layer_); |
453 delegated_layer = surface_layer; | 451 delegated_layer = surface_layer; |
454 delegated_layer->SetBounds(texture_size_in_layer_); | 452 delegated_layer->SetBounds(texture_size_in_layer_); |
455 delegated_layer->SetIsDrawable(true); | 453 delegated_layer->SetIsDrawable(true); |
456 delegated_layer->SetContentsOpaque(true); | 454 delegated_layer->SetContentsOpaque(true); |
457 | 455 |
458 return delegated_layer; | 456 return delegated_layer; |
459 } | 457 } |
(...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 results->orientationAngle = display.RotationAsDegree(); | 2021 results->orientationAngle = display.RotationAsDegree(); |
2024 results->orientationType = | 2022 results->orientationType = |
2025 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2023 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
2026 gfx::DeviceDisplayInfo info; | 2024 gfx::DeviceDisplayInfo info; |
2027 results->depth = info.GetBitsPerPixel(); | 2025 results->depth = info.GetBitsPerPixel(); |
2028 results->depthPerComponent = info.GetBitsPerComponent(); | 2026 results->depthPerComponent = info.GetBitsPerComponent(); |
2029 results->isMonochrome = (results->depthPerComponent == 0); | 2027 results->isMonochrome = (results->depthPerComponent == 0); |
2030 } | 2028 } |
2031 | 2029 |
2032 } // namespace content | 2030 } // namespace content |
OLD | NEW |