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