| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 limits.min_transfer_buffer_size = 4 * 1024; | 179 limits.min_transfer_buffer_size = 4 * 1024; |
| 180 limits.max_transfer_buffer_size = full_screen_texture_size_in_bytes; | 180 limits.max_transfer_buffer_size = full_screen_texture_size_in_bytes; |
| 181 // This context is used for doing async readbacks, so allow at least a full | 181 // This context is used for doing async readbacks, so allow at least a full |
| 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 bool automatic_flushes = false; | 185 bool automatic_flushes = false; |
| 186 GURL url("chrome://gpu/RenderWidgetHostViewAndroid"); | 186 GURL url("chrome://gpu/RenderWidgetHostViewAndroid"); |
| 187 | 187 |
| 188 provider_ = new ContextProviderCommandBuffer( | 188 provider_ = new ContextProviderCommandBuffer( |
| 189 std::move(gpu_channel_host), gpu::kNullSurfaceHandle, url, | 189 std::move(gpu_channel_host), gpu::GPU_STREAM_DEFAULT, |
| 190 gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, url, |
| 190 gfx::PreferIntegratedGpu, automatic_flushes, limits, attributes, nullptr, | 191 gfx::PreferIntegratedGpu, automatic_flushes, limits, attributes, nullptr, |
| 191 command_buffer_metrics::BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); | 192 command_buffer_metrics::BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); |
| 192 if (!provider_->BindToCurrentThread()) | 193 if (!provider_->BindToCurrentThread()) |
| 193 return; | 194 return; |
| 194 provider_->ContextGL()->TraceBeginCHROMIUM( | 195 provider_->ContextGL()->TraceBeginCHROMIUM( |
| 195 "gpu_toplevel", | 196 "gpu_toplevel", |
| 196 base::StringPrintf("CmdBufferImageTransportFactory-%p", provider_.get()) | 197 base::StringPrintf("CmdBufferImageTransportFactory-%p", provider_.get()) |
| 197 .c_str()); | 198 .c_str()); |
| 198 provider_->SetLostContextCallback( | 199 provider_->SetLostContextCallback( |
| 199 base::Bind(&GLHelperHolder::OnContextLost, base::Unretained(this))); | 200 base::Bind(&GLHelperHolder::OnContextLost, base::Unretained(this))); |
| (...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2013 results->orientationAngle = display.RotationAsDegree(); | 2014 results->orientationAngle = display.RotationAsDegree(); |
| 2014 results->orientationType = | 2015 results->orientationType = |
| 2015 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2016 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 2016 gfx::DeviceDisplayInfo info; | 2017 gfx::DeviceDisplayInfo info; |
| 2017 results->depth = info.GetBitsPerPixel(); | 2018 results->depth = info.GetBitsPerPixel(); |
| 2018 results->depthPerComponent = info.GetBitsPerComponent(); | 2019 results->depthPerComponent = info.GetBitsPerComponent(); |
| 2019 results->isMonochrome = (results->depthPerComponent == 0); | 2020 results->isMonochrome = (results->depthPerComponent == 0); |
| 2020 } | 2021 } |
| 2021 | 2022 |
| 2022 } // namespace content | 2023 } // namespace content |
| OLD | NEW |