| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // screen readback to be mapped. | 182 // screen readback to be mapped. |
| 183 limits.mapped_memory_reclaim_limit = full_screen_texture_size_in_bytes; | 183 limits.mapped_memory_reclaim_limit = full_screen_texture_size_in_bytes; |
| 184 | 184 |
| 185 constexpr bool automatic_flushes = false; | 185 constexpr bool automatic_flushes = false; |
| 186 constexpr bool support_locking = false; | 186 constexpr bool support_locking = false; |
| 187 const GURL url("chrome://gpu/RenderWidgetHostViewAndroid"); | 187 const GURL url("chrome://gpu/RenderWidgetHostViewAndroid"); |
| 188 | 188 |
| 189 provider_ = new ContextProviderCommandBuffer( | 189 provider_ = new ContextProviderCommandBuffer( |
| 190 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT, | 190 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT, |
| 191 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, url, | 191 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, url, |
| 192 gfx::PreferIntegratedGpu, automatic_flushes, support_locking, limits, | 192 gl::PreferIntegratedGpu, automatic_flushes, support_locking, limits, |
| 193 attributes, nullptr, | 193 attributes, nullptr, |
| 194 command_buffer_metrics::BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); | 194 command_buffer_metrics::BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); |
| 195 if (!provider_->BindToCurrentThread()) | 195 if (!provider_->BindToCurrentThread()) |
| 196 return; | 196 return; |
| 197 provider_->ContextGL()->TraceBeginCHROMIUM( | 197 provider_->ContextGL()->TraceBeginCHROMIUM( |
| 198 "gpu_toplevel", | 198 "gpu_toplevel", |
| 199 base::StringPrintf("CmdBufferImageTransportFactory-%p", provider_.get()) | 199 base::StringPrintf("CmdBufferImageTransportFactory-%p", provider_.get()) |
| 200 .c_str()); | 200 .c_str()); |
| 201 provider_->SetLostContextCallback( | 201 provider_->SetLostContextCallback( |
| 202 base::Bind(&GLHelperHolder::OnContextLost, base::Unretained(this))); | 202 base::Bind(&GLHelperHolder::OnContextLost, base::Unretained(this))); |
| (...skipping 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2021 results->orientationAngle = display.RotationAsDegree(); | 2021 results->orientationAngle = display.RotationAsDegree(); |
| 2022 results->orientationType = | 2022 results->orientationType = |
| 2023 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2023 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 2024 gfx::DeviceDisplayInfo info; | 2024 gfx::DeviceDisplayInfo info; |
| 2025 results->depth = info.GetBitsPerPixel(); | 2025 results->depth = info.GetBitsPerPixel(); |
| 2026 results->depthPerComponent = info.GetBitsPerComponent(); | 2026 results->depthPerComponent = info.GetBitsPerComponent(); |
| 2027 results->isMonochrome = (results->depthPerComponent == 0); | 2027 results->isMonochrome = (results->depthPerComponent == 0); |
| 2028 } | 2028 } |
| 2029 | 2029 |
| 2030 } // namespace content | 2030 } // namespace content |
| OLD | NEW |